summaryrefslogtreecommitdiffstats
path: root/backends
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'elfutils-0.175'Ulf Hermann2019-01-0918-21/+102
|\ | | | | | | | | | | elfutils 0.175 release Change-Id: I409f41767af349d0521351dd733879ad31c65aab
| * backends: Add x86_64 section_type_name for SHT_X86_64_UNWIND.Mark Wielaard2018-11-093-2/+20
| | | | | | | | | | | | | | | | Makes sure that eu-readelf and eu-elflint recognize and show the x86_64 specific section type correctly. Signed-off-by: Mark Wielaard <mark@klomp.org> Tested-by: Milian Wolff <milian.wolff@kdab.com>
| * backends: ppc use define instead of const for size of dwarf_regs array.Mark Wielaard2018-10-202-4/+9
| | | | | | | | | | | | | | | | | | The size of the dwarf_regs is a constant, but when building without optimizations the compiler doesn't see that and will warn that it cannot proof the stack size is bounded. Use a define instead of a const, so the compiler will use a constant expression everywhere. Signed-off-by: Mark Wielaard <mark@klomp.org>
| * Handle ADD/SUB relocationsAndreas Schwab2018-10-1316-15/+73
| | | | | | | | | | | | This adds support for ADD and SUB relocations as seen on RISC-V. Signed-off-by: Andreas Schwab <schwab@suse.de>
* | Merge tag 'elfutils-0.174'Ulf Hermann2018-10-1115-15/+350
|\| | | | | | | | | | | elfutils 0.174 release Change-Id: Ibcbdfca61cf0b65391ab6d0ad00f18ba61027e07
| * backends: Use elf_getshdrstrndx to find .odp section in ppc64_initMark Wielaard2018-09-132-2/+8
| | | | | | | | | | | | | | | | | | The .odp section is found by name. But ppc64_init used the e_shstrndx Ehdr field for that. This is wrong if the file contains more than SHN_LORESERVE sections. Use elf_getshdrstrndx instead to find the shstrtab section. Signed-off-by: Mark Wielaard <mark@klomp.org>
| * backends: Always use elf_getshdrstrndx in check_special_symbol.Mark Wielaard2018-09-136-10/+31
| | | | | | | | | | | | | | | | | | | | The check_special_symbol backend functions used the Ehdr e_shstrndx field to get at the name of sections. This is not correct if there are more than SHN_LORESERVE sections. Always use elf_getshdrstrndx to get the shstrtab section. And drop the Ehdr argument that isn't necessary anymore. Signed-off-by: Mark Wielaard <mark@klomp.org>
| * backends: add abi_cfi and set_initial_registers_tid callbacks for M68KAndreas Schwab2018-07-225-1/+153
| | | | | | | | | | | | This fixes all testsuite failures. Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
| * Fix typo in riscv_register_infoAndreas Schwab2018-07-192-1/+5
| | | | | | | | Signed-off-by: Andreas Schwab <schwab@suse.de>
| * backends: add core_note callback for RISC-VAndreas Schwab2018-07-174-1/+68
| | | | | | | | Signed-off-by: Andreas Schwab <schwab@suse.de>
| * backends: add set_initial_registers_tid callback for RISC-VAndreas Schwab2018-07-134-1/+86
| | | | | | | | | | | | | | This fixes the backtrace-dwarf and deleted tests, and lets backtrace-native run a bit further. Signed-off-by: Andreas Schwab <schwab@suse.de>
* | Don't install versioned DLLs on windowsUlf Hermann2018-07-241-2/+16
| | | | | | | | | | | | | | | | Nobody can use those, and as windows doesn't have proper symlinks, they take up lots of space. Change-Id: If62db984c7ac62e798a88e3a4ecd15962683d001 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge tag 'elfutils-0.173'Ulf Hermann2018-07-1330-38/+669
|\| | | | | | | | | | | elfutils 0.173 release Change-Id: I83dc56dd15c26fe7acf4ce73c29df65b8b65e757
| * backends,bpf: add proper relocation supportYonghong Song2018-06-215-1/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to libdw does not have proper BPF relocation support, the pahole cannot display filenames correctly for objects with default llvm options. So we have to invent a special option "llc -march=bpf -mattr=dwarfris" to prevent llvm from generating cross-section dwarf relocation records (https://reviews.llvm.org/rL326505). The pahole related discussion is in linux netdev mailing list (http://lists.openwall.net/netdev/2018/06/15/38, etc.) We would like to add proper BPF relocation support to libdw so eventually we could retire the special llc bpf flag "-mattr=dwarfris". The bpf relocations are defined in llvm_repo:include/llvm/BinaryFormat/ELFRelocs/BPF.def: ELF_RELOC(R_BPF_NONE, 0) ELF_RELOC(R_BPF_64_64, 1) ELF_RELOC(R_BPF_64_32, 10) Removed the relocation type R_BPF_MAP_FD whoes name does not confirm to llvm definition and replaced it with R_BPF_64_64. The BPF object is just a relocatible object, not an executable or a shared library, so assign ELF type to REL only in bpf_reloc.def. Signed-off-by: Yonghong Song <yhs@fb.com>
| * libelf: Sync elf.h from glibc.Mark Wielaard2018-06-212-1/+4
| | | | | | | | | | | | Add NT_PPC_PKEY, R_BPF_64_64 and R_BPF_64_32. Remove R_BPF_MAP_FD. Signed-off-by: Mark Wielaard <mark@klomp.org>
| * backends: add abi_cfi and register_info callbacks for RISC-VAndreas Schwab2018-06-205-1/+264
| | | | | | | | | | | | | | | | From https://github.com/riscv/riscv-isa-manual/raw/master/release/riscv-spec-v2.2.pdf and GCC source. Signed-off-by: Andreas Schwab <schwab@suse.de>
| * backends: add checks for _GLOBAL_OFFSET_TABLE_ and __global_pointer$ on riscvAndreas Schwab2018-05-153-0/+38
| | | | | | | | Signed-off-by: Andreas Schwab <schwab@suse.de>
| * Add support for RISC-VAndreas Schwab2018-04-235-2/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements initial support for the RISC-V architecture. It has been tested with qemu linux-user emulation <https://build.opensuse.org/package/live_build_log/openSUSE:Factory:RISCV/elfutils/standard/riscv64>, with the following unresolved issues FAIL: run-strip-strmerge.sh =========================== elflint /home/abuild/rpmbuild/BUILD/elfutils-0.170/tests/elfstrmerge section [32] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0x51c0 does not match .got section address 0x5010 section [32] '.symtab': symbol 119: st_value out of bounds FAIL run-strip-strmerge.sh (exit status: 1) FAIL: run-elflint-self.sh ========================= section [33] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0x6220 does not match .got section address 0x6008 section [33] '.symtab': symbol 135: st_value out of bounds *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/addr2line section [33] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0x91d8 does not match .got section address 0x9040 section [33] '.symtab': symbol 163: st_value out of bounds *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elfcmp section [33] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0x1a2a0 does not match .got section address 0x1a040 section [33] '.symtab': symbol 267: st_value out of bounds *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint section [33] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0xd418 does not match .got section address 0xd0f0 section [33] '.symtab': symbol 238: st_value out of bounds *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/nm section [33] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0xa2d0 does not match .got section address 0xa0b0 section [33] '.symtab': symbol 193: st_value out of bounds *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/objdump section [33] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0x2e5b8 does not match .got section address 0x2e058 section [33] '.symtab': symbol 410: st_value out of bounds *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/readelf section [32] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0x171b8 does not match .got section address 0x17010 *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/libelf/libelf.so section [32] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0x3a5b0 does not match .got section address 0x3a0d8 *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/libdw/libdw.so section [31] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0xd0c8 does not match .got section address 0xd008 *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/backends/libebl_i386.so section [31] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0xf0c8 does not match .got section address 0xf008 *** failure in /home/abuild/rpmbuild/BUILD/elfutils-0.170/src/elflint --quiet --gnu-ld /home/abuild/rpmbuild/BUILD/elfutils-0.170/backends/libebl_x86_64.so FAIL run-elflint-self.sh (exit status: 1) FAIL: run-native-test.sh ======================== /home/abuild/rpmbuild/BUILD/elfutils-0.170/tests/allregs: dwfl_module_register_names: no backend registers known FAIL run-native-test.sh (exit status: 1) FAIL: run-backtrace-native-core.sh ================================== backtrace: backtrace.c:111: callback_verify: Assertion `symname && strcmp (symname, "raise") == 0' failed. ./test-subr.sh: line 84: 26040 Aborted (core dumped) LD_LIBRARY_PATH="${built_library_path}${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" $VALGRIND_CMD "$@" backtrace-child-core.26027: no main rmdir: failed to remove 'test-26016': Directory not empty FAIL run-backtrace-native-core.sh (exit status: 1) In addition, all tests that use ptrace are failing as linux-user emulation does not implement it. There are no regressions for a x86_64 build. Signed-off-by: Andreas Schwab <schwab@suse.de>
| * aarch64: Add default cfi rule to restore SP from CFA address.Mark Wielaard2018-04-132-2/+10
| | | | | | | | | | | | | | | | | | The CFA is set by default to the stack pointer of the previous frame. So that is also how we can always restore the SP. This default aarch64 CFI rule is necessary on Fedora 28 with GCC8 to make the run-deleted.sh and run-backtrace-dwarf.sh testcases work. Signed-off-by: Mark Wielaard <mark@klomp.org>
| * Include sys/ptrace.h as early as possible.Mark Wielaard2018-02-152-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some systems, at least on Fedora 27 ppc64le with glibc 2.26-24 and kernel 4.14.18-300, including sys/ptrace.h late (after signal.h or sys/wait.h for example) will cause issues and produce errors like: In file included from /usr/include/asm/sigcontext.h:12:0, from /usr/include/bits/sigcontext.h:30, from /usr/include/signal.h:287, from /usr/include/sys/wait.h:36, from linux-pid-attach.c:38: /usr/include/sys/ptrace.h:73:3: error: expected identifier before numeric constant PTRACE_GETREGS = 12, ^ Swapping the include order fixes these issues. Signed-off-by: Mark Wielaard <mark@klomp.org>
| * Use fallthrough attribute.Joshua Watt2018-02-1019-26/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use __attribute__ ((fallthrough)) to indicate switch case fall through instead of a comment. This ensures that the fallthrough warning is not triggered even if the file is pre-processed (hence stripping the comments) before it is compiled. The actual fallback implementation is hidden behind a FALLBACK macro in case the compiler doesn't support it. Finally, the -Wimplict-fallthrough warning was upgraded to only allow the attribute to satisfy it; a comment alone is no longer sufficient. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
| * backends: Ignore GCC8 -Wpacked-not-aligned for m68k_corenote.c.Mark Wielaard2017-10-262-0/+11
| | | | | | | | | | | | | | | | | | The GCC8 -Wpacked-not-aligned warns if a structure field with explicit padding in a packed structure will be misaligned. m68k prstatus core notes are described by a packed structure which has such aligned structure fields. Signed-off-by: Mark Wielaard <mark@klomp.org>
| * Make sure packed structs follow the gcc memory layoutUlf Hermann2017-09-202-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc defaults to using struct layouts that follow the native conventions, even if __attribute__((packed)) is given. In order to get the layout we expect, we need to tell gcc to always use the gcc struct layout, at least for packed structs. To do this, we can use the gcc_struct attribute. This is important, not only for porting to windows, but also potentially for other platforms, as the bugs resulting from struct layout differences are rather subtle and hard to find. Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
| * Check for -z,defs, -z,relro, -fPIC, -fPIE before using themUlf Hermann2017-08-182-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Those flags are not available on all platforms, and omitting them when not available will not cause any harm. In particular: -z,defs disallows undefined symbols in object files. This option is unsupported if the target binary format enforces the same condition already. Furthermore it is only a compile time sanity check. When it is omitted, the same binary is produced. -z,relro instructs the loader to mark sections read-only after loading the library, where possible. This is a hardening mechanism. If it is unavailable, the functionality of the code is not affected in any way. -fPIC instructs the compiler to produce position independent code. While this is preferable to relocatable code, relocatable code also works and may even be faster. Relocatable code might just be loaded into memory multiple times for different processes. -fPIE is the same thing as -fPIC for executables rather than shared libraries. Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
* | 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 <christian.kandeler@qt.io>
* | 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 <mark@klomp.org>
| * 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 <gromero@linux.vnet.ibm.com>
| * 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 <mark@klomp.org>
| * 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 <mark@klomp.org>
| * 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 <ulf.hermann@qt.io>
| * 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 <mark@klomp.org>
| * 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 <schwab@linux-m68k.org>
| * 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 <mark@klomp.org>
* | 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 <ulf.hermann@qt.io> Signed-off-by: Mark Wielaard <mark@klomp.org>
| * 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 <mark@klomp.org>
| * 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 <ulf.hermann@qt.io>
| * 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 <ulf.hermann@qt.io>
* | 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 <christian.kandeler@qt.io>
* | 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 <christian.kandeler@qt.io>
* | 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 <christian.kandeler@qt.io>
* | 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 <christian.kandeler@qt.io>
* | 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 <christian.kandeler@qt.io>
* | 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 <christian.kandeler@qt.io>
* | 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 <christian.kandeler@qt.io>
* 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 <mark@klomp.org>
* 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 <mjw@redhat.com>
* 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 <jose.marchesi@oracle.com>
* Add m68k testsAndreas Schwab2016-07-113-1/+12
| | | | Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>