Re: bpftool binary size
(Cc. iovisor-dev list)
On Wed, 18 Apr 2018 21:32:45 +0200 Jesper Dangaard Brouer <brouer@...> wrote: On Wed, 18 Apr 2018 20:13:39 +0100So, I figured out why this happens. What does bpftool use BFD for? I need the BFD lib and include file: /usr/include/bfd.h. Thus, on fedora I need to install package binutils-devel. The file /usr/lib64/libopcodes.so contains a ld-script that enforce static linking: $ cat /usr/lib64/libopcodes.so /* GNU ld script */ /* Ensure this .so library will not be used by a link for a different format on a multi-architecture system. */ OUTPUT_FORMAT(elf64-x86-64) INPUT ( /usr/lib64/libopcodes.a -lbfd ) The info/description on the RPM file is interesting, it explicitly explain why this static linking is enforced... and "strongly encouraged" developers to use libelf instead of BFD. Is using libelf instead an option? $ rpm -qi binutils-devel Name : binutils-devel Version : 2.27 Release : 28.fc26 Architecture: x86_64 Install Date: Wed 18 Apr 2018 09:34:52 PM CEST Group : System Environment/Libraries Size : 4651893 License : GPLv3+ Signature : RSA/SHA256, Thu 02 Nov 2017 10:37:53 AM CET, Key ID 812a6b4b64dab85d Source RPM : binutils-2.27-28.fc26.src.rpm Build Date : Fri 13 Oct 2017 03:48:11 PM CEST Build Host : buildvm-16.phx2.fedoraproject.org Relocations : (not relocatable) Packager : Fedora Project Vendor : Fedora Project URL : http://sources.redhat.com/binutils Summary : BFD and opcodes static and dynamic libraries and header files Description : This package contains BFD and opcodes static and dynamic libraries. The dynamic libraries are in this package, rather than a seperate base package because they are actually linker scripts that force the use of the static libraries. This is because the API of the BFD library is too unstable to be used dynamically. The static libraries are here because they are now needed by the dynamic libraries. Developers starting new projects are strongly encouraged to consider using libelf instead of BFD. -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer
|
|