45 Commits

Author SHA1 Message Date
lizhenlin efba194008 update version to 0.193
Signed-off-by: lizhenlin <lizhenlin2@h-partners.com>
2025-11-12 14:48:40 +08:00
unknown 705c22626b update to v0.190
Signed-off-by: unknown <zhangchun39@huawei.com>
2024-12-06 15:48:16 +08:00
Dmitry V. Levin ff38afe74a Remove unused Makefile variable GCC_INCLUDE
It appears to be unused since the first commit in the revision history.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2020-12-11 12:25:29 +01:00
Dmitry V. Levin 4f587a12b4 Fix automake warnings
Apparently, commit 2f02e81510 that removed
$(EXEEXT) suffix from shared libraries was incomplete: it missed the
fact that some libraries were included into noinst_PROGRAMS, resulting
to the following automake warnings:

libasm/Makefile.am:66: warning: deprecated feature: target 'libasm.so' overrides 'libasm.so$(EXEEXT)'
libdw/Makefile.am:114: warning: deprecated feature: target 'libdw.so' overrides 'libdw.so$(EXEEXT)'
libelf/Makefile.am:116: warning: deprecated feature: target 'libelf.so' overrides 'libelf.so$(EXEEXT)'

Fix this by renaming noinst_PROGRAMS to noinst_DATA and removing no
longer needed lib{asm,dw,elf}_so_SOURCES variables and add lib{asm,dw,elf).so
to CLEANFILES.

Fixes: 2f02e81510 ("Drop $(EXEEXT) suffix from shared libraries")
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Mark Wielaard <mark@klomp.org>
2020-12-10 12:56:01 +01:00
Dmitry V. Levin 2f02e81510 Drop $(EXEEXT) suffix from shared libraries
According to GNU Automake documentation [1], $(EXEEXT) is the suffix
that should be used for executables, it is not applicable for shared libraries.

[1] https://www.gnu.org/software/automake/manual/html_node/EXEEXT.html

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2020-12-06 12:47:24 +01:00
Mark Wielaard b63007ed58 configure: Add new --enable-install-elfh option.
We explicitly test (with system-elf-libelf) that our include headers
work with the system elf.h header. But it might be helpful to install
the elf.h file for a private install. Our elf.h header really is just
a copy of the latest glibc elf.h. But it might be newer and include
more constants than the system installed elf.h.

Add a new configure option --enable-install-elfh to install elf.h.
But warn when it is enabled for the default /usr or /usr/local prefix
because it might clash with the glibc/system elf.h header in that case.

Signed-off-by: Mark Wielaard <mark@klomp.org>
2019-01-31 23:51:17 +01:00
Ulf Hermann 07737584e7 Check for -z,defs, -z,relro, -fPIC, -fPIE before using them
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>
2017-08-18 22:29:46 +02:00
Ulf Hermann 8abf0b5b58 Unify linking of libasm, libelf, libdw, backends
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>
2017-07-24 11:01:09 +02:00
Mark Wielaard 272018bba1 libelf: Add elf_compress and elf_compress_gnu.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
2016-01-06 14:27:10 +01:00
Mark Wielaard 5ddb50af4a libelf: Add elf32_getchdr, elf64_getchdr and gelf_getchdr.
Elf_Data of a compressed section has type ELF_T_CHDR. This type can be
xlated to the file or memory representation. This will make sure the Chdr
is in the correct endianess. The compressed data following the Chdr isn't
translated.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
2016-01-06 14:27:10 +01:00
Mark Wielaard 528cb45fc9 Make zlib mandatory.
Explicitly link libelf and libdw with -lz.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
2015-10-26 13:52:31 +01:00
Josh Stone daee4714ee Improve AM_SILENT_RULES coverage
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 <jistone@redhat.com>
2015-10-06 17:50:10 -07:00
Jose E. Marchesi 6a20e20ea9 Use -fPIC instead of -fpic when generating PIC code.
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>
2015-10-06 23:54:34 +02:00
Ulrich Drepper 898ed26144 avoid scary command output
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.
2014-12-18 23:47:22 +01:00
Mark Wielaard 805ec833c1 Add configure --disable-textrelcheck option to enable CC=afl-fuzz on 32bit.
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 <mjw@redhat.com>
2014-12-04 14:38:18 +01:00
Mark Wielaard 3232479483 Remove mudflap build option.
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 <mjw@redhat.com>
2014-04-18 11:46:51 +02:00
Michael Forney a45c804335 Check for prefixed ar, readelf, and nm
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 <mforney@mforney.org>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
2013-11-05 17:07:10 +01:00
Mark Wielaard de2ed97f33 Update name, license and contributor policy.
* 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 <rfontana@redhat.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
2012-06-05 23:12:05 +02:00
Roland McGrath 22359e2653 Clean up and consolidate automake magic to reduce duplication and to work with --disable-dependency-tracking. 2010-02-15 15:57:03 -08:00
Roland McGrath 6fd3cd104a Add elf_getphdrnum, support >65536 phdrs. 2010-01-07 19:43:42 -08:00
Mark Wielaard e2fedf4ad5 Makefile.am (libelf.so): Use -Wl,-z,defs not -defs. 2009-08-12 12:00:17 +02:00
Ulrich Drepper f189493154 Add aliases for elf_getshnum and elf_getshstrndx.
Sun in their implementation messed up the semantics of these functions.
To get back to source code compatibility they asked for a solution.
We simply add aliases for the two affected functions, named
elf_getshdrnum and elf_getshdrstrndx.  The semantics remains the
same.  Users of the old interfaces receive a warning for now.  In
future we might make it impossible to link programs which request
the old interfaces (binary compatibility will of course be maintained).
2009-06-13 15:55:42 -07:00
Ulrich Drepper 7e678fa3f6 Require __thread support in compiler.
Rename --enable-tls to more appropriate --enable-thread-safety.
2009-01-10 18:02:05 -08:00
Ulrich Drepper d56e232fb8 propagate from branch 'com.redhat.elfutils.pmachata.threads' (head 8bd3bc10eb015c96f7bafcc6a22c973620b57dd8)
to branch 'com.redhat.elfutils' (head c5a11b6b3329382f1b5ffd0020f0d93c64176f20)
2008-08-16 03:09:13 +00:00
Ulrich Drepper e219f1c1b2 propagate from branch 'com.redhat.elfutils.roland.pending' (head 26cc2ce45739af072e7ff4fdab5e8eb7cd756d50)
to branch 'com.redhat.elfutils' (head bb519012dee7013b2cab5c2f5ed465cb3821b063)
2008-01-09 05:49:49 +00:00
Ulrich Drepper 3cbdd387c7 propagate from branch 'com.redhat.elfutils.disasm' (head d15b4eb794e81e477f9896fe82a74cb5ecf4514c)
to branch 'com.redhat.elfutils' (head eaacbf01f8cc89d043ec6eca9b5e35cb5c4cde06)
2008-01-02 17:44:39 +00:00
Roland McGrath 59ea7f33f7 src/
2007-10-04  Roland McGrath  <roland@redhat.com>

	* readelf.c (print_archive_index): New variable.
	(options, parse_opt): Accept -c/--archive-index to set it.
	(dump_archive_index): New function.
	(process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
	Call dump_archive_index on archives if set.
	(main): Update caller.
	(any_control_option): Give it file scope, moved out of ...
	(parse_opt): ... here.

tests/
2007-10-04  Roland McGrath  <roland@redhat.com>

	* run-readelf-test4.sh: New file.
	* Makefile.am (TESTS, EXTRA_DIST): Add it.
2007-10-04 08:50:09 +00:00
Roland McGrath c76f0b0567 2007-09-27 Roland McGrath <roland@redhat.com>
* alpha_retval.c: Use dwarf_attr_integrate and dwarf_hasattr_integrate.
	* i386_retval.c: Likewise.
	* ia64_retval.c: Likewise.
	* ppc64_retval.c: Likewise.
	* ppc_retval.c: Likewise.
	* s390_retval.c: Likewise.
	* sparc_retval.c: Likewise.
	* x86_64_retval.c: Likewise.
2007-09-27 07:31:33 +00:00
Roland McGrath cb6d865011 readelf register printing sort order tweak 2007-08-23 08:10:54 +00:00
Ulrich Drepper ce0bdb6ee5 Implement ar program.
Relax elflint in GNU ld mode for latest idiosyncracies.
2007-02-05 07:13:52 +00:00
Roland McGrath c373d850ec 2006-10-09 Roland McGrath <roland@redhat.com>
* ia64_symbol.c (ia64_reloc_simple_type): Treat SECREL types as simple.
2006-10-10 00:25:21 +00:00
Ulrich Drepper d315bb2d1c Make sure gnuhash_xlate.h is distributed. 2006-07-12 05:26:13 +00:00
Ulrich Drepper 28ed895fdc merge of 2d5572f10b65f0ac7fdf54361b4dae41ebbd51d0
and fda3a25581b7bfac581504e9e887e9b97f234f86
2006-07-07 03:43:47 +00:00
Ulrich Drepper ee4b927bae New spec file. 2006-06-15 03:21:46 +00:00
Ulrich Drepper 1b0714c81d Updated support for new hash table format.
Fix handling of discarded COMDAT symbols in ld.
2006-07-06 23:58:40 +00:00
Ulrich Drepper 1e9ef50681 Fix FSF address. No exception for libdwarf. 2006-04-04 22:29:06 +00:00
Ulrich Drepper 361df7da6d propagate from branch 'com.redhat.elfutils.roland.pending' (head 4f8fc821345feef58624f0aa5b470d4827577d8c)
to branch 'com.redhat.elfutils' (head 76e26cb54695fd3b21ee8fb5be3036bd68200633)
2006-04-04 21:38:57 +00:00
Ulrich Drepper fbe998a0b1 merge of 333c187506c852455e9f7be44fa9adc360416217
and 79955b942e3f0ddc71117feea5754df61edcc42a
2005-08-29 16:27:10 +00:00
Roland McGrath 4c305da9de 2005-08-24 Roland McGrath <roland@redhat.com>
* line2addr.c (print_address): Omit () for DSOs.
2005-08-25 01:49:35 +00:00
Ulrich Drepper c2c3b1ecbe Since we link statically when using gcov don't compile the .os files
with the options.
2005-08-28 17:59:03 +00:00
Ulrich Drepper 3d413d4b05 Implement --enable-gconv option for configure. 2005-08-28 16:18:57 +00:00
Ulrich Drepper 5d83229c85 Implement ranlib. This required one little extension to libelf. 2005-08-15 21:36:27 +00:00
Ulrich Drepper 47be795df3 Implement --enable-gprof option in configure script. 2005-08-07 04:41:39 +00:00
Ulrich Drepper 41de488a0a Add several more elflint tests:
- check whether dynamic section matches PT_DYNAMIC program header entry
- make sure text relocation flag is used correctly

libelf needed one extension for this.
2005-08-03 00:02:56 +00:00
Ulrich Drepper b08d5a8fb4 Adjust for monotone. 2005-07-26 05:00:05 +00:00