summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Split the "selfcontained" configure option in twoHEADQtCreator4.15.1QtCreator4.15.0-rc1QtCreator4.15.0-beta2QtCreator4.15.0-beta1QtCreator4.15.0QtCreator4.14.2QtCreator4.14.1QtCreator4.14.0-rc1QtCreator4.14.0-beta2QtCreator4.14.0-beta1QtCreator4.14.0QtCreator4.13.3QtCreator4.13.2QtCreator4.13.1QtCreator4.13.0-rc1QtCreator4.13.0-beta2QtCreator4.13.0-beta1QtCreator4.13.0QtCreator4.12.4QtCreator4.12.3QtCreator4.12.2QtCreator4.12.1QtCreator4.12.0-rc1QtCreator4.12.0-beta2QtCreator4.12.0-beta1QtCreator4.12.0QtCreator4.11.2QtCreator4.11.0-rc1QtCreator4.11.0-beta2QtCreator4.11.0-beta1QtCreator4.11.0master5.04.154.144.134.124.1112.011.010.0Ulf Hermann2019-08-261-1/+1
| | | | | | | | upstream is growing an option to install elf.h. We want to use that. Change-Id: Ica5bf0cdf281eb17ef29e0e1029662a5a9d875b1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Merge tag 'elfutils-0.175'Ulf Hermann2019-01-092-0/+8
|\ | | | | | | | | | | elfutils 0.175 release Change-Id: I409f41767af349d0521351dd733879ad31c65aab
| * libcpu: Recognize bpf jump variants BPF_JLT, BPF_JLE, BPF_JSLT and BPF_JSLEMark Wielaard2018-11-092-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux kernel 4.13 introduced 4 more jump class variants. commit 92b31a9af73b3a3fc801899335d6c47966351830 Author: Daniel Borkmann <daniel@iogearbox.net> Date: Thu Aug 10 01:39:55 2017 +0200 bpf: add BPF_J{LT,LE,SLT,SLE} instructions For conditional jumping on unsigned and signed < and <= between a register and another register or immediate. Add these new constants to bpf.h, recognize them in bpf_disasm and update the testfile-bpf-dis1.expect file. Signed-off-by: Mark Wielaard <mark@klomp.org>
* | Merge tag 'elfutils-0.174'Ulf Hermann2018-10-114-2/+8
|\| | | | | | | | | | | elfutils 0.174 release Change-Id: Ibcbdfca61cf0b65391ab6d0ad00f18ba61027e07
| * Consolidate error.h inclusion in system.hRoss Burton2018-07-054-2/+8
| | | | | | | | | | | | | | | | | | error.h isn't standard and so isn't part of the musl C library. To easy future porting, consolidate the inclusion of error.h into system.h. https://sourceware.org/bugzilla/show_bug.cgi?id=21008 Signed-off-by: Ross Burton <ross.burton@intel.com>
* | Add a header for eu_compat.dll, and export more functionsQtCreator4.8.1QtCreator4.8.0-rc1QtCreator4.8.0-beta2QtCreator4.8.0-beta1QtCreator4.8.04.8Ulf Hermann2018-07-253-0/+82
| | | | | | | | | | | | | | | | We obviously need strdup, and it doesn't hurt to also export realloc and calloc. Change-Id: Ia4af48faaec2bcf24c3e07002711cd6153f684bf Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Don't install versioned DLLs on windowsUlf Hermann2018-07-241-11/+3
| | | | | | | | | | | | | | | | 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-138-1026/+32
|\| | | | | | | | | | | elfutils 0.173 release Change-Id: I83dc56dd15c26fe7acf4ce73c29df65b8b65e757
| * Prepare for 0.171.elfutils-0.171Mark Wielaard2018-06-012-2/+6
| | | | | | | | | | | | | | Set version to 0.171. Update po/*.po files. Mention DWARF5, split dwarf and GNU DebugFission support in NEWS. Signed-off-by: Mark Wielaard <mark@klomp.org>
| * Use fallthrough attribute.Joshua Watt2018-02-102-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * lib: Remove md5 and sha1 implementations.Mark Wielaard2017-10-206-1023/+9
| | | | | | | | | | | | Only the testcase md5-sha1-test used them. So also remove that testcase. Signed-off-by: Mark Wielaard <mark@klomp.org>
| * Make sure packed structs follow the gcc memory layoutUlf Hermann2017-09-202-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 if gcc complains about __attribute__ (visibility(..))Ulf Hermann2017-08-182-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If so, define attribute_hidden to be empty. Also, use attribute_hidden in all places where we hide symbols. If this attribute is missing, it simply means that we cannot hide private symbols in the binary using attributes. This disables some optimizations and may increase the risk of symbol name clashes with other libraries, but is not fatal. However, we still employ linker version scripts to explicitly define the exported symbols. This serves much of the same purpose. Also, as all our symbols are prefixed with the library name, and "__" for private ones, the chance of clashes is low anyway. Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
| * Check for -z,defs, -z,relro, -fPIC, -fPIE before using themUlf Hermann2017-08-182-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Fix typos in lib/Makefile.amUlf Hermann2017-12-111-3/+7
| | | | | | | | | | | | | | | | We want to uninstall the compat library in the uninstall step and we want to properly clean the build artifacts on make clean. Change-Id: Id26a80c19a68fb79a9194d0065f81b5a189af8d1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge tag 'elfutils-0.170'Ulf Hermann2017-08-173-1/+88
|\| | | | | | | | | | | elfutils 0.170 release Change-Id: I37d03645902b9f0a9fb708af1551db8843537799
| * backends: Don't depend on linux/bpf.h to compile bpf disassembler.Mark Wielaard2017-07-243-1/+88
| | | | | | | | | | | | | | | | | | 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>
* | 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-082-2/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-052-2/+6
| | | | | | | | | | | | | | 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 <mark@klomp.org>
| * Avoid double-including config.hUlf Hermann2017-05-023-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <ulf.hermann@qt.io>
* | Provide build rules for a compatibility libraryUlf Hermann2017-05-083-2/+46
| | | | | | | | | | | | | | | | | | | | | | | | 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 <christian.kandeler@qt.io>
* | 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 <christian.kandeler@qt.io>
* | Use OS-specific pathsUlf Hermann2017-05-082-0/+21
| | | | | | | | | | | | | | | | | | | | 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 <christian.kandeler@qt.io>
* | Open files in O_BINARYUlf Hermann2017-05-082-0/+8
| | | | | | | | | | | | | | | | | | 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 <christian.kandeler@qt.io>
* | Define unlocked io functions to locked ones if they are unavailableUlf Hermann2017-05-042-0/+33
| | | | | | | | | | | | | | The locked IO functions will still do the job, albeit a bit slower. Change-Id: I65c2b6aaa00374302aff3bcf4852a252e1eefd17 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Add fake features.h for win32Ulf Hermann2017-05-031-2/+8
| | | | | | | | | | | | | | | | gnulib #defines all the types we need from it, so it is empty. We still need it because other files #include it. Change-Id: I0bb4ee71bcb3e983b41f640c12ef5b9f09b6b03c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | If f(un)lockfile is unavailable define it awayUlf Hermann2017-05-031-0/+7
| | | | | | | | | | | | | | | | | | Sometimes _POSIX_THREAD_SAFE_FUNCTIONS is still set in this case, which in turn leads to build problems in getopt.c (which would define the functions to nop anyway if it knew they aren't present). Change-Id: I76debd27f1d1ed968cc663db4b60adb5f0052d4b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Fix typoUlf Hermann2017-05-021-1/+1
| | | | | | | | | | Change-Id: Id980ba7c2caaf6a2f541b682790f03e33cea3ea4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Add a "selfcontained" mode to provide missing headers on windowsUlf Hermann2017-05-022-1/+53
| | | | | | | | | | | | | | | | | | | | | | On windows there is no features.h, uid_t, gid_t, mode_t, and pid_t are not defined and there is also no elf.h. To make it possible to build other software against libelf and libdw, install our own version of elf.h, and a bare-bones features.h that provides exactly the above declarations. Change-Id: I9df3c8cbffe431b8b6834dbd2246e38df4f5e172 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Make sure packed structs follow the gcc memory layoutUlf Hermann2017-05-021-0/+8
| | | | | | | | | | | | | | | | 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>
* | Check if gcc complains about __attribute__ (visibility(..))Ulf Hermann2017-04-282-0/+9
| | | | | | | | | | | | | | | | If so, define attribute_hidden to be empty. Also, use attribute_hidden in all places where we hide symbols. Change-Id: I37353459710dbbd1c6c6c46110514fc18515c814 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Check for -z,defs, -z,relro, -fPIC, -fPIE before using themUlf Hermann2017-04-282-1/+5
| | | | | | | | | | | | | | | | | | 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>
* | Drop handrolled or #ifdef'ed libc replacementsUlf Hermann2017-04-283-6/+6
| | | | | | | | | | | | | | | | | | mempcpy, memrchr, rawmemchr, and argp are provided by gnulib now. We don't need to define them locally and we don't need to search for an external libargp. Change-Id: I131ca4bc2d77c597b99c296c28259a3600e5d1b5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Avoid double-including config.hUlf Hermann2017-04-263-4/+9
|/ | | | | | | | | | | | | | | | | 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. Change-Id: Ib78dd7e058ef8ac93cd379dcd14a2ffbc86c1988 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Move print_version into printversion.{h|c}Ulf Hermann2017-02-175-21/+65
| | | | | | | | Rename version.c so that the implementation is called after the header and the header doesn't clash with the toplevel version.h. print_version depends on argp and is only used in the tools. Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
* Check for existence of mempcpyUlf Hermann2017-02-173-1/+11
| | | | | | If it doesn't exist, provide a definition based on memcpy. Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
* Always use the same method to query the system page sizeUlf Hermann2017-02-152-1/+5
| | | | | | | This makes it easier to write a replacement for it on systems where sysconf(3) doesn't exist. Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
* Move color handling into a separate headerUlf Hermann2017-02-155-34/+72
| | | | | | | | We only need it in nm.c and objdump.c, but it pulls in argp as dependency. By dropping it from libeu.h, the libraries can be compiled without argp. Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix TEMP_FAILURE_RETRY definition when not defined.Luiz Angelo Daros de Luca2016-12-303-1/+7
| | | | | | https://sourceware.org/bugzilla/show_bug.cgi?id=21001 Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
* http://elfutils.org/ is now hosted at http://sourceware.org/elfutils/Mark Wielaard2016-12-244-2/+57
| | | | | | | | | | | | | | | | | fedorahosted used to be our home, but we are now hosted at sourceware. Change the elfutils project home to http://elfutils.org/ Point hosted services (email, release, git, bug tracker and web pages) to https://sourceware.org/elfutils/ Move design notes from README to NOTES. Add URLs for home, releases, bugs, git and mailinglist to README. Make the --version output of all tools the same by using a common print_version function and update the publicly shown copyright holder to the elfutils developers. Signed-off-by: Mark Wielaard <mark@klomp.org>
* Do not depend on some non-POSIX features.Akihiko Odaki2016-10-133-0/+29
| | | | | | | | Define/open code memrchr, rawmemchr, powerof2 and TEMP_FAILURE_RETRY if not available through system headers. Signed-off-by: Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* lib: Provide MAX and MIN in system.hAkihiko Odaki2016-10-129-48/+106
| | | | | | | | | | This change also creates a new header file libeu.h to provide the prototypes for the function of libeu. That hides the definition of function crc32, which can conflict with zlib, from libelf. It also prevents mistakes to refer those functions from a component which doesn't link with libeu, such as libelf. Signed-off-by: Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
* Use -fPIC instead of -fpic when generating PIC code.Jose E. Marchesi2015-10-062-1/+6
| | | | | | | This avoids relocation overflows in sparc/sparc64 targets while linking, where the reachable data using -fpic is only 4kb. Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com>
* Remove old-style function definitions.Mark Wielaard2015-09-237-80/+38
| | | | | | | We already require -std=gnu99 and old-style function definitions might hide some compiler warnings. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Fix sanitize-undefined config check. Don't ALLOW_UNALIGNED when checking.Mark Wielaard2015-06-052-1/+6
| | | | | | | | | The -fsanitize=undefined check need to use AC_LINK_IFELSE to make sure libubsan is installed. When doing undefined checking we should disable ALLOW_UNALIGNED memory accesses to catch issues where we do unaligned accesses by accident. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Allow disabling symbol versioning at configure timeMax Filippov2015-04-232-3/+7
| | | | | | | | | | | | | Due to missing symbol versioning support in uClibc calls to versioned functions that internally call different version of themselves results in infinite recursion. Introduce macro SYMBOL_VERSIONING and use it instead of plain SHARED to decide whether symbol versioning is needed. Control this macro definition with new configure option --disable-symbol-versioning. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* lib: Add missing config.h #include to crc32_file.c.Lei Zhang2014-01-172-0/+8
| | | | | | Without config.h, there is no possibility of large file support. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* lib: Avoid the hash-lookup division if possibleJosh Stone2013-12-132-2/+7
| | | | | | | | | | | | | For Dwarf_Abbrev codes, the most common case is that they're packed at the low end, saving uleb128 encoding size. Since the hash table is always resized to be no more than 90% full, those codes are always less than the table size, and dividing for the remainder is unnecessary. Dwarf_Dies are frequently created anew, and need to find abbrev each time, so even that one division becomes a noticeable hotspot. This patch adds a branch to avoid it, which is very predictable for the CPU. Signed-off-by: Josh Stone <jistone@redhat.com>
* New macro COMPAT_VERSION_NEWPROTO.Jan Kratochvil2013-04-302-0/+10
| | | | | | | lib/ * eu-config.h (COMPAT_VERSION_NEWPROTO): New. Twice. Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
* Unify {BE,LE}{32,64} in lib/system.h.Jan Kratochvil2013-04-262-0/+9
| | | | | | | | | | | | lib/ * system.h (LE64, BE64): Move here the definitions from libdwfl/link_map.c. libdwfl/ * link_map.c (BE32, BE64, LE32, LE64): Delete the definitions, move them to lib/system.h. Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>