FS#53367 - [binutils] compile libbfd with PIC support
Attached to Project:
Arch Linux
Opened by Ferran Pallarès (poinu) - Sunday, 19 March 2017, 11:41 GMT
Last edited by Anatol Pomozov (anatolik) - Friday, 24 March 2017, 03:03 GMT
Opened by Ferran Pallarès (poinu) - Sunday, 19 March 2017, 11:41 GMT
Last edited by Anatol Pomozov (anatolik) - Friday, 24 March 2017, 03:03 GMT
|
Details
Description:
I am trying to compile a library that requires binutils (libbfd and libiberty to be precise) and fails when linking with the error: /usr/bin/ld: /usr/lib/libbfd.a(bfd.o): relocation R_X86_64_32S against symbol `bfd_errmsgs' can not be used when making a shared object; recompile with -fPIC It seems that this should be solved by compiling libbfd with PIC, letting it be linked into shared libraries. Additional info: * package version(s): 2.28-1 Steps to reproduce: 1. Create a file with the following code: #define PACKAGE 1 #define PACKAGE_VERSION 1 #include <bfd.h> void foo(bfd *file) { bfd_init(); file = bfd_openr("a.out", 0); bfd_close(file); } 2. Try to compile it with: gcc --shared -fPIC -o libtest.so <file>.c -lbfd -liberty |
This task depends upon
Closed by Anatol Pomozov (anatolik)
Friday, 24 March 2017, 03:03 GMT
Reason for closing: Fixed
Additional comments about closing: 2.8.0-2
Friday, 24 March 2017, 03:03 GMT
Reason for closing: Fixed
Additional comments about closing: 2.8.0-2
Allan, feel free to move it to [stable] when you are ready.