summaryrefslogtreecommitdiffstats
path: root/backends
Commit message (Collapse)AuthorAgeFilesLines
* backends: sparc: support for live backtracesJose E. Marchesi2016-01-034-1/+137
| | | | | | | 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]>
* backends: sparc: support for core backtracesJose E. Marchesi2016-01-035-2/+111
| | | | | | | | 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]>
* Move nested functions in backends to file scope.Chih-Hung Hsieh2015-11-033-25/+40
| | | | | | | * backends/aarch64_regs.c and backends/ia64_retval.c should now compile with clang. Signed-off-by: Chih-Hung Hsieh <[email protected]>
* ppc: ppc_check_special_symbol): Also allow _SDA_BASE_ in .data section.Mark Wielaard2015-10-162-3/+13
| | | | | | | | | 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]>
* Improve AM_SILENT_RULES coverageJosh Stone2015-10-062-2/+6
| | | | | | | | | | | 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]>
* sparc: support for the check_object_attribute ebl hook.Jose E. Marchesi2015-10-064-1/+83
| | | | | | | 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]>
* sparc: fix the extraction of relocation IDs from r_type fields.Jose E. Marchesi2015-10-063-1/+27
| | | | | | | | | | 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]>
* sparc: add some missing relocation types.Jose E. Marchesi2015-10-052-0/+8
| | | | | | | This adds three missing relocation types in sparc targets: WDISP10, JMP_IREL and IRELATIVE. Signed-off-by: Jose E. Marchesi <[email protected]>
* Remove old-style function definitions.Mark Wielaard2015-09-234-22/+16
| | | | | | | We already require -std=gnu99 and old-style function definitions might hide some compiler warnings. Signed-off-by: Mark Wielaard <[email protected]>
* Replace some K&R function definitions with ansi-C definitions.Chih-Hung Hsieh2015-09-0713-60/+64
| | | | | Signed-off-by: Chih-Hung Hsieh <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* backends: Use ebl->class consistently in sparc backend.Mark Wielaard2015-09-032-6/+10
| | | | | | | | | | | 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]>
* Reduce scope of some includesPino Toscano2015-06-272-1/+5
| | | | | | | | 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]>
* Update elf.h from glibc.Mark Wielaard2015-04-282-3/+8
| | | | Signed-off-by: Mark Wielaard <[email protected]>
* backends: Add x32_corenote.cH.J. Lu2015-04-016-11/+92
| | | | | | | | 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]>
* backends: aarch64 can have _GLOBAL_OFFSET_TABLE_ point anywhere in .got.Mark Wielaard2015-03-272-5/+15
| | | | | | | | | | 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]>
* backends: COPY relocations can also happen in ET_DYN.Mark Wielaard2015-03-1312-21/+36
| | | | | | | | | 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]>
* Support STT_ARM_TFUNC symbol type in ebl_symbol_type_name hookPetr Machata2015-02-243-2/+21
| | | | Signed-off-by: Petr Machata <[email protected]>
* backends: Check sh_entsize is not zero in ppc_symbol.c (find_dyn_got).Mark Wielaard2015-01-152-1/+6
| | | | | | Found with afl-fuzz. Signed-off-by: Mark Wielaard <[email protected]>
* avoid scary command outputUlrich Drepper2014-12-182-1/+5
| | | | | | 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.
* Use elf_getphdrnum instead of accessing ehdr->e_phnum directly.Mark Wielaard2014-11-263-8/+18
| | | | | | | 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]>
* Check elf_strptr didn't fail getting section name.Mark Wielaard2014-11-172-6/+13
| | | | | | | | 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]>
* libdw: Add dwarf_peel_type. Use it in dwarf_aggregate_size.Mark Wielaard2014-11-052-18/+9
| | | | | | | | | | | | | | | 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]>
* aarch64: use <sys/user.h> defined register structuresKyle McMartin2014-08-013-4/+22
| | | | | | | | | | | 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]>
* Add ppc64le ELFv2 abi support to backends and elflint.Mark Wielaard2014-07-044-1/+37
| | | | | | | | | | 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]>
* backends: aarch64_return_value_location should handle DW_ATE_boolean.Mark Wielaard2014-07-042-0/+6
| | | | | | | Found with run-native-test.sh om debian arm64. http://bugs.debian.org/753552 Signed-off-by: Mark Wielaard <[email protected]>
* dwarf.h: Remove non-existing DW_TAG_mutable_type.Mark Wielaard2014-06-222-2/+7
| | | | | | | | | | | | | | | 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]>
* libebl: Add ebl_func_addr_mask plus ARM backend implementation.Mark Wielaard2014-06-222-0/+7
| | | | | | | | | | | | | | 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]>
* backends (*_return_value_location): call dwarf_peeled_die_typePetr Machata2014-06-2012-325/+208
| | | | | | ... instead of inlining equivalent code. Signed-off-by: Petr Machata <[email protected]>
* backends: Add ebl_check_reloc_target_type.Mark Wielaard2014-05-195-3/+26
| | | | | | | | | 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]>
* Unwinding is only supported on LinuxKurt Roeckx2014-04-233-2/+7
| | | | Signed-off-by: Kurt Roeckx <[email protected]>
* Remove mudflap build option.Mark Wielaard2014-04-182-6/+6
| | | | | | | | | 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]>
* backends: Add aarch64 native and core unwind support.Mark Wielaard2014-04-145-2/+104
| | | | | | | | 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]>
* backends: add ARM compatible mode to AARCH64Jean Pihet2014-03-302-2/+37
| | | | | | | | | 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]>
* backends: AARCH64_ABS32 and AARCH64_ABS64 are also valid in ET_REL.Mark Wielaard2014-03-192-3/+8
| | | | | | | 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]>
* backends: Make aarch64_regs.c checkable by -WprintfPetr Machata2014-01-302-22/+21
|
* backends: Add arm frame_nregs and set_initial_registers_tid.Mark Wielaard2014-01-304-2/+71
| | | | | | | | | | | | | 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]>
* backends: arm_cfi SP (r13) is restored from CFA by default.Mark Wielaard2014-01-302-0/+7
| | | | Signed-off-by: Mark Wielaard <[email protected]>
* backends: Update arm_reloc.def.Mark Wielaard2014-01-302-2/+83
| | | | | | | | | 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]>
* Use -Wformat=2 by default for all files.Mark Wielaard2014-01-303-9/+34
| | | | | | | | 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]>
* backends: aarch64_check_special_symbol check shdr is not NULL before usage.Mark Wielaard2014-01-172-3/+11
| | | | Signed-off-by: Mark Wielaard <[email protected]>
* backends: Add PPC64 machine_flag_check.Mark Wielaard2014-01-043-2/+18
| | | | | | | | | | 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]>
* backends: Add aarch64 abi_cfi.Mark Wielaard2014-01-035-2/+92
| | | | | | | | 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]>
* backends: aarch64 always has _GLOBAL_OFFSET_TABLE_ point to .got[0].Mark Wielaard2013-12-203-0/+34
| | | | | | | | | | | 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]>
* libdwfl: Introduce dwfl_module_getsym_info and dwfl_module_addrinfo.Mark Wielaard2013-12-204-1/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
* Fix s390_initreg.c patch copy/paste error.Mark Wielaard2013-12-182-4/+1
| | | | Signed-off-by: Mark Wielaard <[email protected]>
* backends: Avoid type-punning issue in s390_set_initial_registers_tid.Mark Wielaard2013-12-182-2/+18
| | | | | | | | 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]>
* unwinder: s390 and s390xJan Kratochvil2013-12-186-6/+253
| | | | Signed-off-by: Jan Kratochvil <[email protected]>
* unwinder: ppc and ppc64Jan Kratochvil2013-12-156-3/+136
| | | | Signed-off-by: Jan Kratochvil <[email protected]>
* Support AArch64 architecturePetr Machata2013-11-269-6/+968
| | | | Signed-off-by: Petr Machata <[email protected]>
* Unwinder for x86*.Jan Kratochvil2013-11-076-4/+176
| | | | | Signed-off-by: Jan Kratochvil <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>