summaryrefslogtreecommitdiffstats
path: root/backends
Commit message (Collapse)AuthorAgeFilesLines
* Be stricter about frame pointer unwinding on ARMUlf Hermann2017-11-241-9/+11
| | | | | | | | | There were too many false positives. We require reasonable values for SP and FP now, and we check that the new value for LR is not null before we set anything. Change-Id: I91ca205d0f0ad00e1934f2007d7aa998bb597b35 Reviewed-by: Christian Kandeler <[email protected]>
* Merge tag 'elfutils-0.170'Ulf Hermann2017-08-1716-26/+196
|\ | | | | | | | | | | elfutils 0.170 release Change-Id: I37d03645902b9f0a9fb708af1551db8843537799
| * backends: sparc GOTDATA_OP[_HIX22|LOX10] can be used in ET_REL files.Mark Wielaard2017-08-022-3/+8
| | | | | | | | | | | | Tested on new GNU Compile Farm server gcc202. Signed-off-by: Mark Wielaard <[email protected]>
| * ppc64: Add HTM SPRs support to readelfGustavo Romero2017-07-253-3/+28
| | | | | | | | | | | | | | | | | | | | Since POWER8, PowerPC 64 supports Hardware Transactional Memory, which has three special purpose registers associated to it: tfhar, tfiar, and texasr. This commit add HTM SPRs set as known note type so it's possible to use 'readelf --notes' to inspect the HTM SPRs in a coredump file generated in such a machines. Signed-off-by: Gustavo Romero <[email protected]>
| * strip: Deal with ARM data marker symbols pointing to debug sections.Mark Wielaard2017-07-245-4/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ARM data marker symbols "$d" indicate the start of a sequence of data items in a section. For data only sections no data marker symbol is necessary, but may be put pointing to the start of the section. binutils however has a bug which places a data marker symbol somewhere inside the section (at least for .debug_frame). https://sourceware.org/bugzilla/show_bug.cgi?id=21809 When strip finds a symbol pointing to a debug section that would be put into the .debug file then it will copy over the whole symbol table. This isn't necessary because the symbol is redundant. Add an ebl hook to recognize data marker symbols with implementations for arm and aarch64. Use it in strip to strip such symbols from the symbol table if they point to a debug section. Signed-off-by: Mark Wielaard <[email protected]>
| * backends: Don't depend on linux/bpf.h to compile bpf disassembler.Mark Wielaard2017-07-244-12/+8
| | | | | | | | | | | | | | | | | | We only need a few constants and one structure definition from linux/bpf. Just define those in a local lib/bpf.h file. This makes sure the bpf disassembler is always build and included even when elfutils is build on older GNU/Linux systems (and even on other platforms). Signed-off-by: Mark Wielaard <[email protected]>
| * Unify linking of libasm, libelf, libdw, backendsUlf Hermann2017-07-242-3/+10
| | | | | | | | | | | | | | | | | | | | Link them all with -z,defs,-z,relro,--no-undefined, provide complete dependencies for the link steps, and add libeu.a to each one. libeu.a contains useful library functionality that each of them might use. The linker will strip unneeded symbols, so linking it in won't hurt even if none of the functions are used. Signed-off-by: Ulf Hermann <[email protected]>
| * backends: Swap sys/ptrace.h and asm/ptrace.h include order on s390.Mark Wielaard2017-07-172-1/+5
| | | | | | | | | | | | | | | | | | glibc 2.26 changed the sys/ptrace.h header so that it cannot be included after asm/ptrace.h. We still need to include the kernel asm/ptrace.h for the ptrace_area definition. Including it after sys/ptrace.h works against both old and new glibc. Signed-off-by: Mark Wielaard <[email protected]>
| * Support EM_PPC machine flagsAndreas Schwab2017-06-153-0/+16
| | | | | | | | | | | | | | This fixes the elflint self test when the compiler is configured for PIE default. Signed-off-by: Andreas Schwab <[email protected]>
| * ppc64: Add minimal fallback unwinder.Mark Wielaard2017-06-124-1/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds a minimal fallback unwinder for ppc64[le] in case we cannot find CFI for a particular address. It simply always sets the program counter to the link register, picks the previous stack pointer from the backchain, and the previous link register from the LR save area. This is enough for some simple situations when we don't have CFI and seems to work nicely in the case of perf with libdw powerpc support: https://lkml.org/lkml/2017/5/18/998 Signed-off-by: Mark Wielaard <[email protected]>
* | Merge tag 'elfutils-0.169'QtCreator4.5.1QtCreator4.5.0-rc1QtCreator4.5.0QtCreator4.4.1QtCreator4.4.0-rc1QtCreator4.4.0-beta1QtCreator4.4.04.54.4Ulf Hermann2017-05-088-4/+278
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: ChangeLog backends/ChangeLog config/ChangeLog lib/ChangeLog libasm/ChangeLog libcpu/ChangeLog libdw/ChangeLog libdwfl/ChangeLog libdwfl/derelocate.c libdwfl/linux-kernel-modules.c libebl/ChangeLog libelf/ChangeLog src/ChangeLog tests/ChangeLog Change-Id: I3b7ced947c6498290aaae27443985b84531f0bcd
| * Add frame pointer unwinding for aarch64 and relax backtrace testcases.Ulf Hermann2017-05-024-1/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we don't find any debug information for a given frame, we usually cannot unwind any further. However, the binary in question might have been compiled with frame pointers, in which case we can look up the well known frame pointer locations in the stack snapshot and use them to bridge the frames without debug information. Relax the backtrace core testcases a little by allowing a duplicate sigusr2 frame or a backtrace ending with an invalid register. Both of which can happen if the frame pointer unwinder guesses slightly wrong. Signed-off-by: Ulf Hermann <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
| * Add i386 frame pointer unwinder.Mark Wielaard2017-05-024-2/+93
| | | | | | | | | | | | | | Add a simple i386_unwind.c frame pointer unwinder as fallback if DWARF/CFI unwinding fails. Signed-off-by: Mark Wielaard <[email protected]>
| * Add frame pointer unwinding as fallback on x86_64Ulf Hermann2017-05-024-1/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If we don't find any debug information for a given frame, we usually cannot unwind any further. However, the binary in question might have been compiled with frame pointers, in which case we can look up the well known frame pointer locations in the stack snapshot and use them to bridge the frames without debug information. The "unwind" hook is the right place for this as it is so far only used on s390 and called only after trying to unwind with debug information. Signed-off-by: Ulf Hermann <[email protected]>
| * Clean up linux-specific system includesUlf Hermann2017-04-266-8/+18
| | | | | | | | | | | | We only include them where we actually need them and only on linux. Signed-off-by: Ulf Hermann <[email protected]>
* | Add frame pointer unwinding as fallback on armUlf Hermann2017-05-084-1/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we don't find any debug information for a given frame, we usually cannot unwind any further. However, the binary in question might have been compiled with frame pointers, in which case we can look up the well known frame pointer locations in the stack snapshot and use them to bridge the frames without debug information. At the moment this works only for ARM code. THUMB code uses a different mechanism for unwinding. Also, in order to figure out if a function was compiled in ARM or in THUMB mode we need a symbol table which might not be available (e.g. with JIT-compiled code). Furthermore, there doesn't seem to be a fixed convention on the order in which LR and FP are pushed to the stack on a new frame. The code assumes FP is first and LR second. This is what QV4 does. Change-Id: Iac732e11b7434043cd613d95d8cb2ac753b93920 Reviewed-by: Christian Kandeler <[email protected]>
* | Make sure packed structs follow the gcc memory layoutUlf Hermann2017-05-021-1/+1
| | | | | | | | | | | | | | | | On windows gcc by default generates code that follows the MSVC layout. We don't want that as it adds extra padding. Change-Id: I92efe5da2a2ad818783707ee96a9b8e0eb606dbd Reviewed-by: Christian Kandeler <[email protected]>
* | Generalize library namesUlf Hermann2017-04-282-16/+22
| | | | | | | | | | | | | | | | | | On windows library names end with ".dll" and the prefix "lib" us usually omitted. Take this into account and also drop the $(EXEEXT) workaround. We don't need to use noinst_PROGRAMS as there is also noinst_DATA. Change-Id: I7e4ba2432811d5ad85051ea0c9d5674eabf79b3c Reviewed-by: Christian Kandeler <[email protected]>
* | Check if we need -lintl for linking gettextUlf Hermann2017-04-281-1/+1
| | | | | | | | | | | | | | | | We might not have gettext available from libc and we cannot get it from gnulib either. Change-Id: I1cc657b13b97bcc7c0f158f11b6702c24e69695c Reviewed-by: Christian Kandeler <[email protected]>
* | Check for -z,defs, -z,relro, -fPIC, -fPIE before using themUlf Hermann2017-04-282-2/+6
| | | | | | | | | | | | | | | | | | On windows those aren't needed because the link results are no ELF files and all code is position independent anyway. gcc then complains about them, which is in turn caught by -Werror. Change-Id: Ie3d600b7c430698fc3d867a986a4d48f7ad1bbec Reviewed-by: Christian Kandeler <[email protected]>
* | Add gnulib modules to replace missing libc functionalityUlf Hermann2017-04-272-2/+11
| | | | | | | | | | | | | | | | | | | | This enables us to build a fully featured elfutils package on systems with reduced C libraries, such as windows. All the modules are built into libgnu.a, which is then linked into all binaries if --enable-gnulib is given on the configure line. Change-Id: I743fd22172bc85d9f10dcc3dad8eb921f462b554 Reviewed-by: Christian Kandeler <[email protected]>
* | Clean up linux-specific system includesUlf Hermann2017-04-216-8/+18
|/ | | | | | | We only include them where we actually need them and only on linux. Change-Id: Ic3065ffab67ba1177f63204fb91a92c5f4336dbb Reviewed-by: Christian Kandeler <[email protected]>
* backends: Add support for EM_PPC64 GNU_ATTRIBUTES.Mark Wielaard2017-03-243-0/+8
| | | | | | | | ppc64 and ppc64le ELF files can also contain a power specific .gnu.attributes section. Add support for those and recognize the new GNU_Power_ABI_FP Single-precision hard float value. Signed-off-by: Mark Wielaard <[email protected]>
* Add GCC7 -Wimplicit-fallthrough support/fixes.Mark Wielaard2016-11-107-8/+18
| | | | | | | | | | | GCC7 will have a new -Wimplicit-fallthrough warning. It did catch one small buglet in elflint option procession. So it seems useful to enable to make sure all swatch case fallthroughs are deliberate. Add configure check to detect whether gcc support -Wimplicit-fallthrough and enable it. Add fixes and explicit fallthrough comments where necessary. Signed-off-by: Mark Wielaard <[email protected]>
* sparc: fix the printing of hw capabilities object attributes.Jose E. Marchesi2016-08-242-23/+58
| | | | | | | | | | The GNU_Sparc_HWCAPS and GNU_Sparc_HWCAPS2 object attributes comprise a set of hardware capabilities that may (or not) be present in the target machine for which the object was compiled. This patch adds the support for printing a nicely formatted comma-separated list with the selected hw capabilities. Signed-off-by: Jose E. Marchesi <[email protected]>
* Add m68k testsAndreas Schwab2016-07-113-1/+12
| | | | Signed-off-by: Andreas Schwab <[email protected]>
* Add support for BPFRichard Henderson2016-06-286-4/+183
| | | | Signed-off-by: Richard Henderson <[email protected]>
* Add support for m68kAndreas Schwab2016-05-239-3/+545
| | | | Signed-off-by: Andreas Schwab <[email protected]>
* sparc: restore 32-bit build.Jose E. Marchesi2016-02-262-1/+7
| | | | | | | This patch provides a dummy sparc_set_initial_registers-tid for sparc32. This fixes the build in sparcv9-*-* targets. Signed-off-by: Jose E. Marchesi <[email protected]>
* Add support for DT_PPC_OPTAndreas Schwab2016-02-262-1/+9
| | | | | | https://sourceware.org/ml/binutils/2013-10/msg00378.html Signed-off-by: Andreas Schwab <[email protected]>
* Add new i386 and x86_64 relocation types.Mark Wielaard2016-02-193-0/+8
| | | | | | | Update elf.h from glibc and recognize R_386_GOT32X, R_X86_64_GOTPCRELX and R_x86_64_REX_GOTPCRELX as non-dynamic relocations. Signed-off-by: Mark Wielaard <[email protected]>
* Add NT_ARM_SYSTEM_CALL aarch64 syscall regset.Mark Wielaard2016-02-152-1/+17
| | | | | | | | | Linux kernel 3.18 added the NT_ARM_SYSTEM_CALL regset for aarch64. Recognize and print this new core item. https://bugzilla.redhat.com/show_bug.cgi?id=1285613 Signed-off-by: Mark Wielaard <[email protected]>
* 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]>