summaryrefslogtreecommitdiffstats
path: root/libasm
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'elfutils-0.175'Ulf Hermann2019-01-092-0/+6
|\ | | | | | | | | | | elfutils 0.175 release Change-Id: I409f41767af349d0521351dd733879ad31c65aab
| * Check sh_entsize is not zero.Mark Wielaard2018-10-202-0/+6
| | | | | | | | | | | | | | | | | | There were some recent bug reports where we trusted the ELF section header to be sane and divided the sh_size by the sh_entsize to get the number of objects in the section. This would cause a divide by zero if the file was corrupt and the sh_entsize was zero. Add checks for any such code. Signed-off-by: Mark Wielaard <[email protected]>
* | Merge tag 'elfutils-0.174'Ulf Hermann2018-10-113-2/+8
|\| | | | | | | | | | | elfutils 0.174 release Change-Id: Ibcbdfca61cf0b65391ab6d0ad00f18ba61027e07
| * Consolidate error.h inclusion in system.hRoss Burton2018-07-053-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 <[email protected]>
| * 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 <[email protected]>
* | Don't install versioned DLLs on windowsUlf Hermann2018-07-241-11/+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 <[email protected]>
* | Merge tag 'elfutils-0.170'Ulf Hermann2017-08-172-8/+21
|\| | | | | | | | | | | elfutils 0.170 release Change-Id: I37d03645902b9f0a9fb708af1551db8843537799
| * Unify linking of libasm, libelf, libdw, backendsUlf Hermann2017-07-242-6/+19
| | | | | | | | | | | | | | | | | | | | 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]>
* | 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-081-0/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * 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]>
* | Close files before renaming or unlinking themUlf Hermann2017-05-082-4/+15
| | | | | | | | | | | | | | On windows we cannot rename or unlink open files. Change-Id: Ieae8712266a3e65217580d4936219767c5f26f21 Reviewed-by: Christian Kandeler <[email protected]>
* | Skip fchown, fchmod, fadvise, fallocate if functions are unavailableUlf Hermann2017-05-042-0/+6
| | | | | | | | | | | | | | | | | | | | | | If fchmod or fchown are unavailable, then the file permission model is likely to be different from what we expect there. posix_fallocate is a rather fragile affair already on linux, and not guaranteed to do anything useful. If it's not available, the result will be the same as when it's available and unreliable. fadvise is an optimization. Change-Id: I28a77e976a0198cf80397b45eb1bc8cfb30664f5 Reviewed-by: Christian Kandeler <[email protected]>
* | Generate .lib files on PE platformsUlf Hermann2017-05-021-3/+25
| | | | | | | | | | | | | | MSVC needs them to link against .dll files. Change-Id: Iaf15391d28e0cd3292903dda2cd74b8b99a94274 Reviewed-by: Christian Kandeler <[email protected]>
* | Generalize library namesUlf Hermann2017-04-282-15/+18
| | | | | | | | | | | | | | | | | | 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-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 <[email protected]>
* | Drop handrolled or #ifdef'ed libc replacementsUlf Hermann2017-04-282-1/+5
| | | | | | | | | | | | | | | | | | 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 <[email protected]>
* | Add gnulib modules to replace missing libc functionalityUlf Hermann2017-04-272-0/+7
| | | | | | | | | | | | | | | | | | | | 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]>
* | Fix nesting of bracesUlf Hermann2017-04-271-1/+1
|/ | | | | | | | | 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. Change-Id: I1c9540d849931fc28aaa806550d178231baa8b9a Reviewed-by: Christian Kandeler <[email protected]>
* libasm: Fix one GCC7 -Wformat-truncation=2 warning.Mark Wielaard2017-03-242-3/+9
| | | | | | | | | | | Make sure that if we have really lots of labels the tempsym doesn't get truncated because it is too small to hold the whole name. This doesn't enable -Wformat-truncation=2 or fix other "issues" pointed out by enabling this warning because there are currently some issues with it. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79448 Signed-off-by: Mark Wielaard <[email protected]>
* Check for existence of mempcpyUlf Hermann2017-02-172-1/+5
| | | | | | If it doesn't exist, provide a definition based on memcpy. Signed-off-by: Ulf Hermann <[email protected]>
* lib: Provide MAX and MIN in system.hAkihiko Odaki2016-10-122-1/+4
| | | | | | | | | | 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 <[email protected]>
* dwelf: Add string table functions from ebl.Mark Wielaard2016-08-0312-50/+72
| | | | | | | | | | | | | | | | Move the strtab functions from libebl to libdw. Programs often want to create ELF/DWARF string tables. We don't want (static) linking against ebl since those are internal functions that might change. This introduces dwelf_strtab_init, dwelf_strtab_add, dwelf_strtab_add_len, dwelf_strtab_finalize, dwelf_strent_off, dwelf_strent_str and dwelf_strtab_free. Documentation for each has been added to libdwelf.h. The add fucntion got a variant that takes the length explicitly and finalize was changed to return NULL on out of memory instead of aborting. All code and tests now uses the new functions. Signed-off-by: Mark Wielaard <[email protected]>
* Add support for BPFRichard Henderson2016-06-282-2/+6
| | | | Signed-off-by: Richard Henderson <[email protected]>
* Fix GCC6 -Wnull-dereference warnings.Mark Wielaard2016-02-222-2/+7
| | | | | | | | | | | | | | | | | | | | | | | asm_begin.c: In function ‘asm_begin’: asm_begin.c:62:7: error: potential null pointer dereference [-Werror=null-dereference] __fsetlocking (result->out.file, FSETLOCKING_BYCALLER); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We set result to NULL just before this call in case of error. Fixed by only calling __fsetlocking when result is not NULL. strip.c: In function ‘handle_elf.constprop’: strip.c:1270:31: error: null pointer dereference [-Werror=null-dereference] elf_assert ((versiondata->d_size / sizeof (Elf32_Word)) ~~~~~~~~~~~^~~ src/strip.c:597:37: note: in definition of macro ‘elf_assert’ #define elf_assert(test) do { if (!(test)) goto illformed; } while (0) ^~~~ That is the wrong check, we want to check shndxdata, not versiondata here. 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]>
* Properly mark all internal function definitions.Mark Wielaard2015-09-234-0/+10
| | | | | | | | | | | | | | | | | Since we banned old style function definitions GCC is able to diagnose function definitions that don't match the function declaration: elf32_getehdr.c:78: error: conflicting types for ‘__elf64_getehdr_wrlock’ libelfP.h:498: note: previous declaration of ‘__elf64_getehdr_wrlock’ This happens on i386 because there internal functions are marked with: # define internal_function __attribute__ ((regparm (3), stdcall)) Make sure all internal function declarations and definitions are marked with internal_function. Signed-off-by: Mark Wielaard <[email protected]>
* Remove old-style function definitions.Mark Wielaard2015-09-2318-72/+30
| | | | | | | 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-074-10/+10
| | | | | Signed-off-by: Chih-Hung Hsieh <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* avoid scary command outputUlrich Drepper2014-12-182-2/+6
| | | | | | 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.
* Add configure --disable-textrelcheck option to enable CC=afl-fuzz on 32bit.Mark Wielaard2014-12-042-1/+5
| | | | | | | | | | | | | | | Using american fuzzy lop has found a lot of issues. It would be nice to make using it a bit easier. Our build files make sure that no shared library uses text relocations, but afl-gcc will insert some on i686. http://www.akkadia.org/drepper/textrelocs.html Now CC=afl-gcc ./configure --disable-textrelcheck will allow them so that afl can instrument the libraries. Don't try to use or install them except with afl-fuzz. When selinux is enabled it might prevent loading the libraries with DT_TEXTREL set. Signed-off-by: Mark Wielaard <[email protected]>
* Remove mudflap build option.Mark Wielaard2014-04-182-5/+5
| | | | | | | | | 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]>
* Check for prefixed ar, readelf, and nmMichael Forney2013-11-051-1/+1
| | | | | | | | Sometimes with cross-compile toolchains, the tools are prefixed with the target arch. Using AC_CHECK_TOOL looks for tools named like this. Signed-off-by: Michael Forney <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* Updates for Automake 1.13.Mark Wielaard2013-04-262-1/+5
| | | | | | | autoreconf will install config/test-driver, ignore it. Update gettext m4 and po files to version 0.18.2. Use AM_CPPFLAGS instead of INCLUDES. All changes are backward compatible with Automake 1.11.
* Update name, license and contributor policy.Mark Wielaard2012-06-0535-560/+665
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change name from "Red Hat elfutils" to "elfutils". * Update license of standalone tools and test from GPLv2 to GPLv3+. * Change license of libraries from GPLv2+exception to GPLv2/LGPLv3+. * Add Developer Certificate of Origin based contributor policy. top-level: - COPYING: Upgraded from GPLv2 to GPLv3. - CONTRIBUTING, COPYING-GPLv2, COPYING-LGPLv3: New files. - NEWS: Added note about new contribution and license policy. - Makefile.am: Updated to GPLv3, added new files to EXTRA_DIST. - configure.ac: Update to GPLv3, changed AC_INIT name to 'elfutils'. backends, lib, libasm, libcpu, libdw, libdwfl, libebl, libelf: - All files updated to GPLv2/LGPLv3+. Except some very small files (<5 lines) which didn't have any headers at all before, the linker .maps files and the libcpu/defs files which only contain data and libelf/elf.h which comes from glibc and is under LGPLv2+. config: - elfutils.spec.in: Add new License: headers and new %doc files. - Update all license headers to GPLv2/LGPLv3+ for files used by libs. src, tests: - All files updated to GPLv3+. Except for the test bz2 data files, the linker maps and script files and some very small files (<5 lines) that don't have any headers. Signed-off-by: Richard Fontana <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* Remove .mtn-ignore and .cvsignore files.Mark Wielaard2012-06-051-1/+0
| | | | We use .gitignore these days.
* libasm: Remove an unused variable.Roland McGrath2011-02-082-4/+5
|
* Clean up and consolidate automake magic to reduce duplication and to work ↵Roland McGrath2010-02-152-24/+9
| | | | with --disable-dependency-tracking.
* Require __thread support in compiler.Ulrich Drepper2009-01-103-110/+11
| | | | Rename --enable-tls to more appropriate --enable-thread-safety.
* merge of '4c5dbb5e116d9a9c7f9014a3dcbabba8e7d89327'Roland McGrath2008-12-042-1/+10
| | | | and 'fddaff07d3c095a3d26f41fe7a7da147c024bd96'
* propagate from branch 'com.redhat.elfutils.roland.pending.libelf-threads' ↵Ulrich Drepper2008-12-042-10/+1
| | | | | | (head fc97c9c202b5d7d7699a3b1d5c53007a2ef37bb1) to branch 'com.redhat.elfutils' (head 67cccb9bfffc1a7fe3d8d355a2d9b6d0e489ff81)
* [USE_TLS] Link libasm.so with libpthread.Ulrich Drepper2008-12-042-1/+10
|
* Fix up bogon and missing log entries from .pmachata.threads branch.Roland McGrath2008-08-251-6/+1
|
* propagate from branch 'com.redhat.elfutils.pmachata.threads' (head ↵Ulrich Drepper2008-08-161-1/+6
| | | | | | 8bd3bc10eb015c96f7bafcc6a22c973620b57dd8) to branch 'com.redhat.elfutils' (head c5a11b6b3329382f1b5ffd0020f0d93c64176f20)
* Better symbol retrieval function interface. Allow larger output buffers.Ulrich Drepper2008-01-113-7/+13
|
* propagate from branch 'com.redhat.elfutils.roland.pending' (head ↵Ulrich Drepper2008-01-092-3/+7
| | | | | | 26cc2ce45739af072e7ff4fdab5e8eb7cd756d50) to branch 'com.redhat.elfutils' (head bb519012dee7013b2cab5c2f5ed465cb3821b063)
* Rewrite matcher to allow easier handling of SSE instructions.Ulrich Drepper2008-01-033-29/+66
| | | | A\\Correct/add copyrights.
* propagate from branch 'com.redhat.elfutils.disasm' (head ↵Ulrich Drepper2008-01-0210-0/+386
| | | | | | d15b4eb794e81e477f9896fe82a74cb5ecf4514c) to branch 'com.redhat.elfutils' (head eaacbf01f8cc89d043ec6eca9b5e35cb5c4cde06)
* 2006-10-09 Roland McGrath <[email protected]>Roland McGrath2006-10-102-2/+6
| | | | | * ia64_symbol.c (ia64_reloc_simple_type): Treat SECREL types as simple.
* Fix FSF address. No exception for libdwarf.Ulrich Drepper2006-04-0431-31/+31
|