8.47. Libelf from Elfutils-0.185

Libelf is a library for handling ELF (Executable and Linkable Format) files.

Approximate build time: 0.9 SBU
Required disk space: 115 MB

8.47.1. Installation of Libelf

Libelf is part of elfutils-0.185 package. Use the elfutils-0.185.tar.bz2 as the source tarball.

Update helper scripts to allow compilation on loongarch:

tar xf ../config-20210826.tar.xz --strip-components=1 -C config

Prepare Libelf for compilation:

./configure --prefix=/usr                \
            --disable-debuginfod         \
            --enable-libdebuginfod=dummy

Compile the package:

make

To test the results, issue:

make check

Install only Libelf:

make -C libelf install
install -vm644 config/libelf.pc /usr/lib/pkgconfig
rm /usr/lib/libelf.a

8.47.2. Contents of Libelf

Installed Library: libelf.so (symlink) and libelf-0.185.so
Installed Directory: /usr/include/elfutils

Short Descriptions

libelf

Contains API functions to handle ELF object files