1
1
Fork
You've already forked libelf
0
Freestanding libelf extracted from elfutils
  • C 99.6%
  • Shell 0.2%
  • Makefile 0.2%
Find a file
Chris Webb af8cd1cae0 Don't leak crc32 and next_prime symbols
Upstream elfutils wraps crc32.c in libelf_crc32.c and next_prime.c in
libelf_next_prime.c, redirecting crc32 to hidden __libelf_crc32 and
next_prime to hidden __libelf_next_prime.
Bare crc32 and next_prime symbols aren't exported by elfutils libelf.
We shouldn't export them either, because they are likely to collide.
Unlike elfutils, we don't share crc32.c and next_prime.c with other
libraries, so we can drop the wrappers. Directly hide and prefix the
crc32() and next_prime() functions instead.
Co-authored-by: windowsair <dev@airkyi.com>
Reported-by: windowsair <dev@airkyi.com>
2026年07月06日 13:28:26 +00:00
include Update upstream files from elfutils 0.193 2025年04月26日 11:09:35 +01:00
src Don't leak crc32 and next_prime symbols 2026年07月06日 13:28:26 +00:00
COPYING-GPLV2 Import upstream files from elfutils 0.185 2021年09月02日 13:27:57 +01:00
COPYING-LGPLV3 Import upstream files from elfutils 0.185 2021年09月02日 13:27:57 +01:00
Makefile Merge from upstream libelf 0.195 2026年04月16日 20:56:05 +01:00
README Enable zstd support by default 2023年03月03日 18:21:18 +00:00
update Include missing eu-search.c from upstream 2024年10月20日 09:14:49 +01:00

Freestanding libelf
===================
This package contains an up-to-date and complete libelf extracted from
elfutils, along with a simple Makefile to build and install it.
Unlike the upstream package, this libelf builds cleanly on both musl and
glibc, using either clang or gcc. Users are spared the joy of autotools,
and on musl systems it does not require extra libraries for argp, fts or
obstack. The sole dependencies are zlib and (by default) zstd for handling
compressed ELF sections.
The elfutils tools, libdwarf and libasm are not included: you will need the
full upstream distribution to build those. However, they are a much more
unusual requirement than libelf itself. (For instance, this library alone
is sufficient for building an x86-64 Linux kernel with stack validation.)
Building and installing
-----------------------
Unpack the source tar.gz file and change to the unpacked directory.
Run 'make' then 'make install' to install the libelf headers in /include,
plus static and shared libraries in /lib. You can customise DESTDIR,
PREFIX, LIBDIR and/or INCDIR to install in different locations. An
install-static target is available to install only a static library, and
similarly the install-shared target installs only the shared library.
The build should work out of the box on reasonably recent musl/glibc and
clang/gcc. On very old or non-Linux systems, some manual adjustment of
src/config.h may be needed. For example, to build without zstd support,
remove the definitions of USE_ZSTD and USE_ZSTD_COMPRESS from config.h and
drop -lzstd from LDLIBS in the Makefile.
Please report any problems or bugs to Chris Webb <chris@arachsys.com> rather
than to the upstream elfutils maintainers, who are not to blame for issues
in this repackaging of libelf.
Copying
-------
This software is distributed under the terms of the GNU GPL version 2 or
later, as included in COPYING-GPLV2, or the GNU LGPL version 3 or later, as
included in COPYING-LGPLV3.