| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
This patch implements the set_initial_registers_tid hook for sparc.
It works in both sparcv9-*-* and sparc64-*-* targets.
Signed-off-by: Jose E. Marchesi <[email protected]>
|
| |
|
|
|
|
|
|
| |
This patch adds sparc support to the unwinder, providing a default CFI
program that works in both sparcv9-*-* and sparc64-*-* targets.
Signed-off-by: Jose E. Marchesi <[email protected]>
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
| |
* backends/aarch64_regs.c and backends/ia64_retval.c
should now compile with clang.
Signed-off-by: Chih-Hung Hsieh <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
The Small Data Area Base normally points to .sdata, in which case we
check it is at an offset of 0x8000. It might however fall in the
.data section, in which case we cannot check the offset. The size always
should be zero.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
Note, elfutils does not explicitly enable AM_SILENT_RULES. It's only
available starting from automake 1.11, but starting from automake 1.13
silent rules are always generated, defaulting to verbose. $(AM_V_foo)
additions should be no-ops on systems that don't support silent rules.
To be silent, use "./configure --enable-silent-rules" or "make V=0".
Signed-off-by: Josh Stone <[email protected]>
|
| |
|
|
|
|
|
| |
This makes elfutils based utilities to be aware of the ELF attribute
tags defined in sparc targets.
Signed-off-by: Jose E. Marchesi <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
This patch adds support for a RELOC_TYPE_ID transform macros that
backends can use before including common-reloc.c. The sparc backend
uses this in order to extract the relocation IDs from r_type fields.
In this target the most significative 24 bits of r_type are used to
store an additional addend in some relocation types.
Signed-off-by: Jose E. Marchesi <[email protected]>
|
| |
|
|
|
|
|
| |
This adds three missing relocation types in sparc targets: WDISP10,
JMP_IREL and IRELATIVE.
Signed-off-by: Jose E. Marchesi <[email protected]>
|
| |
|
|
|
|
|
| |
We already require -std=gnu99 and old-style function definitions might
hide some compiler warnings.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
| |
Signed-off-by: Chih-Hung Hsieh <[email protected]>
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
sparc_init would check the ELF class to register to correct core_note
handler. But sparc_register_info would check the ELF machine to determine
whether the register set was 32 or 64 bits. This caused some confusion
and assertion failures in readelf when printing core notes where the
sparc machine and class didn't seem to match up. Check the ELF class
in both sparc_unit and sparc_register_info to give consistent results.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
| |
Use some includes only according to the #ifdef block of the respective
code, or matching the fact they are Linux-only. This way, includes
potentially unportable are not unconditionally used.
Signed-off-by: Pino Toscano <[email protected]>
|
| |
|
|
| |
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
| |
This patch adds x32_corenote.c to support x32 coredump. X32 coredump is
a hybrid between ia32 coredump and x86-64 coredump. The exact formats
are described in bfd/hosts/x86-64linux.h in GNU binutils source tree.
Signed-off-by: H.J. Lu <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
When building with relro aarch64 splits .got in a writable and read-only
part. _GLOBAL_OFFSET_TABLE_ points to the first writable symbol, not the
start of .got.
https://bugzilla.redhat.com/show_bug.cgi?id=1201778
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
In particular COPY relocations might happen in PIE executables,
which are ET_DYN.
Found on Fedora Rawhide with run-elflint-self.sh.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
| |
Signed-off-by: Petr Machata <[email protected]>
|
| |
|
|
|
|
| |
Found with afl-fuzz.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
| |
The commands to check for invalid text relocations in the generated DSOs
shouldn't be displayed. They contain an echo which prints the text.
This patch suppresses the commands from being printed.
|
| |
|
|
|
|
|
| |
Using elf_getphdrnum lets us handle ELF files that use more than PN_XNUM
phdrs. And guards against some corrupt files.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
| |
Since elf_strptr can fail and return NULL we should always check the result
before usage. Debug sections are only handled by section name, so make sure
the name actually exists.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add new function dwarf_peel_type. Some type annotations in DWARF are
specified by modifier tag type wrappers instead of attributes.
For type aliases (typedef) and qualifiers (const, volatile, restrict)
tags dwarf_peel_type follows the DW_AT_type attributes till it finds
a base, user-defined, reference or pointer type DIE.
Use this new function in the backends for return type DIEs (replacing
the existing dwarf_peel_type there) and in dwarf_aggregate_size so
it can provide the sizes for qualified types too. Add a new version
and testcase for the new dwarf_aggregate_size functionality.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
glibc now supplies these (compatible) structs instead of including the
kernel's <asm/ptrace.h> header, so let's use them. Annoyingly this will
cause new elfutils to FTBFS on old glibc, and vice versa. So include a
new configure check for the new struct names and use the old ones if
they are not avilable.
Signed-off-by: Kyle McMartin <[email protected]>
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
The big endian vs little endian changes are already handled by detecting
the EI_DATA data encoding. And the function descriptors are already not
used when we see there is no .opd section. This change adds new checks
for st_other bits, new relocations and recognizes DT_PPC64_OPT.
Signed-off-by: Menanteau Guy <[email protected]>
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
| |
Found with run-native-test.sh om debian arm64.
http://bugs.debian.org/753552
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The DW_TAG_mutable_type was only mentioned in an early draft of DWARFv3.
But was removed because there are no C++ mutable qualified types. It was
replaced by a new attribute DW_AT_mutable on DW_TAG_member DIEs. The new
attribute is available in dwarf.h.
http://dwarfstd.org/ShowIssue.php?issue=050223.1
DW_TAG_mutable_type was only used internally in some backends (which
just ignored it anyway). dwarves did use it to turn it into a string
value, libabigail used it and ignored it (patches to remove sent).
GCC, GDB and binutils don't use nor define it.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The ARM EABI says that the zero bit of function symbol st_value indicates
whether the symbol points to a THUMB or ARM function. Also the return
value address in an unwind will contain the same extra bit to indicate
whether to return to a regular ARM or THUMB function. Add a new ebl
function to mask off such bits and turn a function value into a function
address so that we get the actual value that a function symbol or return
address points to. It isn't easily possible to reuse the existing
ebl_resolve_sym_value for this purpose, so we end up with another hook
that can be used from dwfl_module_getsym, handle_cfi and elflint.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
| |
... instead of inlining equivalent code.
Signed-off-by: Petr Machata <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
And implement for arm and ia64. Both have special section types that
are valid targets for a reloc. Both refer to unwind data. elflint now
just calls ebl_check_reloc_target_type instead of hard coding the
expected section types.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
| |
Signed-off-by: Kurt Roeckx <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
The --enable-mudflap configure build has been broken for 2 years without
anybody apparently noticing. GCC 4.9 removed mudflap support. Before
release we now run make distcheck with valgrind support. Removal of the
mudflap configure option simplifies the build a little.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
| |
Add aarch64 backend functions frame_nregs and set_initial_registers_tid.
Mark pc_register in aarch64 prstatus_regs as pc_register.
Add backtrace-core-aarch64 testcase.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
Add the initial register setup for AARCH64 running ARM code (so
called compat mode). This makes 'eu-stack -p' happy on ARM binaries
while running on a AARCH64 kernel.
Signed-off-by: Jean Pihet <[email protected]>
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
| |
This is tested now in a native aarch64 build by tests/run-elflint-self.sh
since we added some .o files to the self tests.
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This allows CFI unwinding for ARM. It relies on having .debug_frame around
which is always the case in our testsuite. All native backtrace tests PASS
on arm if debuginfo (for glibc) is installed on the system. Otherwise the
tests SKIP.
For non-debug unwinding ARM uses EXIDX tables, not .eh_frames, which
would have to be translated to CFI to do unwinding without .debug_frame
available.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
| |
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
The elflint self test now also checks ET_REL files. Update the list of
relocation types to include all known relocations from elf.h.
R_ARM_SWI24 was obsolete and is now named R_ARM_TLS_DESC. The only other
relocation used in the dynamic linker is R_ARM_IRELATIVE.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
| |
This just makes sure that all format strings are given as literals to
printf like functions so the compiler can see and check them. Remove
all no_Wformat, add -Wformat=2 unconditionally to AM_CFLAGS.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
| |
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
To distinguish between the current PPC64 ELF ABI and the revised
ELFv2 ABI that will not use function descriptors binutils started
to emit the version (currently 1) in the ehdr e_flags. Recognize
all valid versions (0, 1 or 2) in elflint by adding the hook
ppc64_machine_flag_check.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
| |
Setup initial CIE values for aarch64 for use with dwarf_frame functions.
Register info prefix should be the empty string (not NULL) when not used.
Add an EM_AARCH64 testcase to tests/run-addrcfi.sh to check both issues.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
Like some other architectures aarch64 has a special rule for the
_GLOBAL_OFFSET_TABLE_ symbol. Even if there is a .plt.got section the symbol
value still points to the start of the .got section. This is also what the
dynamic linker expects.
See https://sourceware.org/ml/libc-ports/2013-06/msg00057.html
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some arches like ppc64 use function descriptor values instead of function
addresses causing matching of names and addresses to fail when using
dwfl_module_getsym or dwfl_module_addrsym.
Add ebl hook to resolve any function descriptor values found in non-ET_REL
modules.
The new function dwfl_module_getsym_info doesn't adjust the symbol value
in any way, but returns the adjusted and/or resolved address associated
with the symbol separately. The new function dwfl_module_addrinfo resolves
against both the address associated with the symbol (which could be the
function entry address) value and the adjusted st_value. So that it is
easy to resolve and match either function descriptors and/or function
entry addresses.
Since these new functions also return more information they replace the
dwfl_module_getsym_elf and dwfl_module_addrsym_elf functions that never
made it into a released elfutils version.
addr2line and readelf now use the new functions when looking up functions
names. addr2line will now also display the section the address was found
in when given -x.
Extra testcases were added for both addr2line and the dwflsyms testscase.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
| |
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
| |
Use union to avoid type-punning when assigning a double to a Dwarf_Word.
gcc complains otherwise. error: dereferencing type-punned pointer will
break strict-aliasing rules.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
| |
Signed-off-by: Jan Kratochvil <[email protected]>
|
| |
|
|
| |
Signed-off-by: Jan Kratochvil <[email protected]>
|
| |
|
|
| |
Signed-off-by: Petr Machata <[email protected]>
|
| |
|
|
|
| |
Signed-off-by: Jan Kratochvil <[email protected]>
Signed-off-by: Mark Wielaard <[email protected]>
|