summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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-0845-5150/+5700
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Prepare for 0.169.elfutils-0.169Mark Wielaard2017-05-0513-5079/+5189
| | | | | | | | | | | | | | Set version to 0.169. Update copyright year. Update po/*.po files. And add user visible changes to new 0.169 NEWS section. Signed-off-by: Mark Wielaard <[email protected]>
| * Make elf section sorting more deterministicUlf Hermann2017-05-032-1/+13
| | | | | | | | | | | | | | | | | | At least one test (dwfl-addr-sect) depends on the order of elf sections with equal addresses. This is not guaranteed by the code. Compare also by end address and section index to tell entries apart. Signed-off-by: Ulf Hermann <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
| * Don't look for kernel version if not running on linuxUlf Hermann2017-05-022-0/+13
| | | | | | | | | | | | | | We don't want to use it, even if it exists. Signed-off-by: Ulf Hermann <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
| * Add frame pointer unwinding for aarch64 and relax backtrace testcases.Ulf Hermann2017-05-0211-2/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-029-3/+135
| | | | | | | | | | | | | | 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-029-1/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
| * tests: Add core backtracegen check and regen ppc32 backtrace testfiles.Mark Wielaard2017-05-025-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a check to check_core to make sure the backtracegen function is found in the backtrace. This function is in the middle of the backtrace in the main executable and if not found it means the backtrace was incomplete or the frame was skipped (which could happen on a bad frame pointer only unwind). This showed that the ppc32 backtrace test files were missing DWARF CFI for the main executable. Regenerated them to include full CFI. Signed-off-by: Mark Wielaard <[email protected]>
| * Revert "Optionally allow unknown symbols in the backtrace tests"Mark Wielaard2017-05-023-31/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f9971cb422df39adea7e8c7e22689b879e39c626. Allowing no symbol resolving at all makes it too hard to see whether the test actually tests anything. But do keep "address out of range" as allowed error in check_err. This can be interpreted as DWARF not available (if end of callstack marker is missing, which it unfortunately often is missing even if CFI is available.). Signed-off-by: Mark Wielaard <[email protected]>
| * Avoid double-including config.hUlf Hermann2017-05-0262-11/+291
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | config.h doesn't have include guards, so including it twice is bad. We deal with this by checking for PACKAGE_NAME, but only in some places. Once we start using gnulib, we will need to include config.h before any gnulib-generated headers. This is problematic if we include it transitively through our own private headers. In order to set a clear rule about inclusion of config.h, it is now included in every .c file as first header, but not in any header. This will definitely avoid double-inclusion and satisfy the condition that it has to be included before gnulib headers. It comes at the price of adding some redundancy, but there is no clean way to avoid this. Signed-off-by: Ulf Hermann <[email protected]>
| * Use F_GETFD rather than F_GETFL to check validity of file descriptorUlf Hermann2017-05-022-1/+5
| | | | | | | | | | | | | | F_GETFD is both cheaper and easier to port, and otherwise has the same effect here. Signed-off-by: Ulf Hermann <[email protected]>
| * Make __attribute__ conditional in all installed headersUlf Hermann2017-05-028-33/+54
| | | | | | | | | | | | | | | | | | | | __attribute__ is a GNU extension. If we want to link against the libraries using a different compiler, it needs to be disabled. It was already disabled in libdw.h, and this patch extends this to the other headers. We move the defines to libelf.h as that is included in all the others. Signed-off-by: Ulf Hermann <[email protected]>
| * Fix nesting of bracesUlf Hermann2017-04-282-1/+5
| | | | | | | | | | | | | | | | The way it was before it didn't actually test if elf_update failed, but rather did something random. !!(<some number>) is a boolean and boolean true can be represented as anything non-0, including negative numbers. Signed-off-by: Ulf Hermann <[email protected]>
| * On elf_update, remember when we mmap()Ulf Hermann2017-04-282-0/+6
| | | | | | | | | | | | Otherwise we skip the munmap() later. This leaks resources. Signed-off-by: Ulf Hermann <[email protected]>
| * Avoid signed/unsigned comparisonUlf Hermann2017-04-272-1/+5
| | | | | | | | | | | | | | | | | | | | | | Some compilers implicitly cast the result of uint_fast16_t * uint_fast16_t to something signed and then complain about the comparison to (unsigned) size_t. Casting phnum to size_t is a good idea anyway as 16bit multiplication can easily overflow and we are not checking for this. Signed-off-by: Ulf Hermann <[email protected]>
| * Include strings.h to make ffs availableUlf Hermann2017-04-272-0/+5
| | | | | | | | | | | | We cannot rely on it to be available from any of the other headers. Signed-off-by: Ulf Hermann <[email protected]>
| * Protect against integer overflow on shnumUlf Hermann2017-04-274-19/+33
| | | | | | | | | | | | | | If shnum is 0, the many "shnum - 1" would result in an overflow. Check it for 0, and only subtract once, rather than on every usage. Signed-off-by: Ulf Hermann <[email protected]>
| * Add EXEEXT to gendisUlf Hermann2017-04-262-3/+7
| | | | | | | | | | | | | | Otherwise the build will fail on systems that actually need file extension for executables. Signed-off-by: Ulf Hermann <[email protected]>
| * Include endian.h when handling BYTE_ORDERUlf Hermann2017-04-262-0/+5
| | | | | | | | | | | | BYTE_ORDER and friends are customarily defined in endian.h. Signed-off-by: Ulf Hermann <[email protected]>
| * Add missing entries to .gitignoreUlf Hermann2017-04-262-0/+6
| | | | | | | | Signed-off-by: Ulf Hermann <[email protected]>
| * Avoid YESSTR and NOSTRUlf Hermann2017-04-265-21/+32
| | | | | | | | | | | | | | | | | | Those are deprecated and apparently some implementations of nl_langinfo return empty strings for them. The tests even tested for those empty strings even though the intention of the code was clearly to output "yes" or "no" there. Signed-off-by: Ulf Hermann <[email protected]>
| * Don't use comparison_fn_tUlf Hermann2017-04-262-2/+6
| | | | | | | | | | | | Not all search.h declare it, and it is not very helpful anyway. Signed-off-by: Ulf Hermann <[email protected]>
| * Clean up linux-specific system includesUlf Hermann2017-04-2613-14/+35
| | | | | | | | | | | | We only include them where we actually need them and only on linux. Signed-off-by: Ulf Hermann <[email protected]>
| * Include sys/types.h before fts.hUlf Hermann2017-04-252-1/+9
| | | | | | | | | | | | | | The bad fts not only needs to be included before config.h, but also requires various special types without including sys/types.h. Signed-off-by: Ulf Hermann <[email protected]>
| * libelf: Initialize n to zero in elf_getarsym.Mark Wielaard2017-04-192-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | When building with gcc -Os it seems we can inline read_number_entries but if that function fails then n will not be initialized. GCC seems not to realize that in that case n won't be used at all. Explicitly initialize n to zero to prevent a spurious error: 'n' may be used uninitialized in this function [-Werror=maybe-uninitialized] in that case. https://sourceware.org/bugzilla/show_bug.cgi?id=21011 Signed-off-by: Mark Wielaard <[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 ranlib work on windowsUlf Hermann2017-05-081-3/+26
| | | | | | | | | | Change-Id: I51b9bb88dc86c3378451e07ade19b21526b9eb0c Reviewed-by: Christian Kandeler <[email protected]>
* | Drop file name truncation and date preservation from ar.cUlf Hermann2017-05-081-28/+1
| | | | | | | | | | Change-Id: I6b5eb620bbd3d20e0dfff173917f1615cddd5718 Reviewed-by: Christian Kandeler <[email protected]>
* | Use trees rather than hashes in ar.cUlf Hermann2017-05-082-33/+48
| | | | | | | | | | | | | | The tree functions are more widely available. Change-Id: Ic11a6485ae45f83e7ec8c18dcd7fa1a1902f7ff4 Reviewed-by: Christian Kandeler <[email protected]>
* | Make strip compile on windowsUlf Hermann2017-05-081-39/+9
| | | | | | | | | | | | | | We drop the preserve_dates mode. Change-Id: I79ec3737a41f30bd942e7bc7ea6b1abe33ee9616 Reviewed-by: Christian Kandeler <[email protected]>
* | Make elfcompress compile on windowsUlf Hermann2017-05-081-1/+4
| | | | | | | | | | | | | | | | The fnmatch implementation in gnulib is buggy and cannot understand ".?(z)debug*". We split it into two patterns. Change-Id: Ia70b56a9852b442344ebdd7f2a64ae52321411cf Reviewed-by: Christian Kandeler <[email protected]>
* | Define uid_t and gid_t in system-elf-libelf-test.c if necessaryUlf Hermann2017-05-082-0/+9
| | | | | | | | | | | | | | | | | | | | | | elf.h does include features.h which should define those. However, on windows there is no features.h. We have the empty features.h in libgnu that depends on config.h being included before (which we can't), and the features.h in lib that is only available when installed in selfcontained mode. Therefore we need a workaround here. Change-Id: Ib9074d485ab56e53eb671b859e085b934a782b55 Reviewed-by: Christian Kandeler <[email protected]>
* | Remove previous test files before running the next roundUlf Hermann2017-05-082-0/+7
| | | | | | | | | | | | | | | | strip explicitly creates the new files. This will not work on windows if the files already exist. Change-Id: Icdedcd61d26c390669c5c4915ce84e91a9044f20 Reviewed-by: Christian Kandeler <[email protected]>
* | Correctly determine STACKCMD on windowsUlf Hermann2017-05-084-0/+21
| | | | | | | | | | | | | | error() will only output the file name, but with ".exe" on windows. Change-Id: Icbf9c026003d3e18abc9f68e13789d04811af48b Reviewed-by: Christian Kandeler <[email protected]>
* | Use octal numbers rather than permission macrosUlf Hermann2017-05-087-10/+21
| | | | | | | | | | | | | | | | The permission macros are not guaranteed to be defined and the octal numbers are rather well known. Change-Id: I90ea2f98013f963857946a2f150a4a7114ca2b9a Reviewed-by: Christian Kandeler <[email protected]>
* | Write to /dev/null rather than /dev/zeroUlf Hermann2017-05-082-1/+5
| | | | | | | | | | | | | | | | /dev/zero is meant for reading zeroes. /dev/null is for writing into nirvana. Change-Id: Ic04eaefd72944776a1d3515c0008baf3d3d8de09 Reviewed-by: Christian Kandeler <[email protected]>
* | Make unstrip compile on windowsUlf Hermann2017-05-082-1/+6
| | | | | | | | | | | | | | strndupa doesn't exist, so we use strndup and free. Change-Id: Ibb3fed05bcfcf9d74b31e5695e43e08766512cbf Reviewed-by: Christian Kandeler <[email protected]>
* | Cast pid_t to long long when printingUlf Hermann2017-05-082-11/+15
| | | | | | | | | | | | | | | | On windows x86_64 pid_t is 64bit wide. We need to adapt our printf format respectively. Change-Id: I0e78ed597b780ea9ede6044d9d10ef08736b9009 Reviewed-by: Christian Kandeler <[email protected]>
* | Increase stack usage limit to 512kUlf Hermann2017-05-082-2/+6
| | | | | | | | | | | | | | On windows x86_64 we need more stack in some places. Change-Id: Ic56d3294388521786bf429a24e76f21fa6d626d7 Reviewed-by: Christian Kandeler <[email protected]>
* | Generalize msvc frontent .lib generationUlf Hermann2017-05-081-1/+8
| | | | | | | | | | | | | | | | We want to generate libraries for the same machine type we're builting the dlls for, not only for x86. Change-Id: I93525647c1ff87992ad69282875c8edaec0c31fe Reviewed-by: Christian Kandeler <[email protected]>
* | Provide build rules for a compatibility libraryUlf Hermann2017-05-085-2/+51
| | | | | | | | | | | | | | | | | | | | | | | | We need to export open(), close(), malloc(), and free() from the C library we are using so that we can handle resources passed to and from elfutils correctly. For example, on Windows, calling free() on memory malloc()'d with a different C library will not work. In addition, having __cxa_demangle from the GNU libstdc++ available is very helpful, so we include that, too. Change-Id: I8e47e8f313fb3ffcc18309dadabf24acf36465f0 Reviewed-by: Christian Kandeler <[email protected]>
* | Provide a windows-specific ORIGIN_PATH for eblopenbackendUlf Hermann2017-05-082-0/+9
| | | | | | | | | | | | | | | | $ORIGIN and $LIB are not supported by all implementations of dlopen() and on windows we need backslashes as directory separators. Change-Id: I7394fcda65fa0eca8e21e4d1035fd890dac0b32d Reviewed-by: Christian Kandeler <[email protected]>
* | Make readelf compile on windowsUlf Hermann2017-05-081-1/+4
| | | | | | | | | | | | | | | | The printf format attribute is not supported there. Also, SIGBUS and SI_USER don't exist, so we don't have to check for them. Change-Id: I1472150c83946337954cbbc475318dbb05549fc2 Reviewed-by: Christian Kandeler <[email protected]>
* | Drop the trickery in printversion.hUlf Hermann2017-05-082-7/+8
| | | | | | | | | | | | | | | | | | | | The mechanism of moving argp_program_version_hook and argp_program_bug_address to .rodata is not portable and two pointers per program are not worth the effort to make it portable. Revert the pointers to be non-const. Change-Id: Iea458a5927cf31c72d972bc014229eb62fe2a5a5 Reviewed-by: Christian Kandeler <[email protected]>
* | Close files before renaming or unlinking themUlf Hermann2017-05-0811-8/+43
| | | | | | | | | | | | | | On windows we cannot rename or unlink open files. Change-Id: Ieae8712266a3e65217580d4936219767c5f26f21 Reviewed-by: Christian Kandeler <[email protected]>
* | Adapt debug info fstat check for windowsUlf Hermann2017-05-082-0/+14
| | | | | | | | | | | | | | | | | | | | | | On windows the resulting ino and dev entries are always 0, so the file would always be discarded. We apply a heuristic instead: If the ctime, mtime, mode and size of the two files are all equal then we consider them to be the same. It's exceedingly unlikely to produce two different files for which that holds by chance. Change-Id: I491c95ab8b90fc3c1b786cceae242e142b5a491f Reviewed-by: Christian Kandeler <[email protected]>
* | Use OS-specific pathsUlf Hermann2017-05-0820-100/+171
| | | | | | | | | | | | | | | | | | | | In general we need to use ';' as path separator and '\' and directory separator on windows. The shell will automatically translate paths to some extent, but we have to call "pwd -W" rather than plain "pwd" to get something useful. Change-Id: I1a117d219a2aa00c1f77ae7d3a1d92b9bae526db Reviewed-by: Christian Kandeler <[email protected]>
* | Have diff ignore line ending differences when testingUlf Hermann2017-05-085-7/+14
| | | | | | | | | | | | | | | | This accounts for the CR/LF problem we get when producing text files on windows. Change-Id: Ia37bfa31840dbb9874ab7dd37be17cc88d9da817 Reviewed-by: Christian Kandeler <[email protected]>
* | Open files in O_BINARYUlf Hermann2017-05-0886-122/+226
| | | | | | | | | | | | | | | | | | If O_BINARY is not defined, define it to 0, so that the change has no effect then. Some systems have separate binary and text modes for files, and we don't want the text mode to be used. Change-Id: If7efb5bd448c2a1c7d1eb5dab276849b1b15a3ce Reviewed-by: Christian Kandeler <[email protected]>
* | Workaround compiler not seeing assert(false)Ulf Hermann2017-05-081-0/+1
| | | | | | | | | | Change-Id: I6ea2f6f6684ce1df10c7008ad4a894c9205a267c Reviewed-by: Christian Kandeler <[email protected]>