FS#48317 - [binutils] Cannot link to libbfd

Attached to Project: Arch Linux
Opened by Kenji Takahashi (Kenji_Takahashi) - Tuesday, 23 February 2016, 23:35 GMT
Last edited by Allan McRae (Allan) - Wednesday, 24 February 2016, 01:19 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Versions:

* binutils == 2.26-1
* gcc == 5.3.0-5

Steps to reproduce:

$ echo 'int main(){return 0;}' > test.c
$ gcc test.c -lbfd
/usr/bin/ld: cannot find _libdir
/usr/bin/ld: cannot find /libbfd.a
collect2: error: ld returned 1 exit status
%{}%

Additions:

* Attached output of gcc -lbfd -Wl,-verbose.
* Works fine with binutils == 2.25.1-3 (and appropriate gcc versions).
* The libbfd.a file exists in /usr/lib.
* What is `_libdir` anyway? Looks like some variable is not substituted correctly, maybe?
This task depends upon

Closed by  Allan McRae (Allan)
Wednesday, 24 February 2016, 01:19 GMT
Reason for closing:  Fixed
Additional comments about closing:  binutils-2.26-2 in [testing]
Comment by Doug Newgard (Scimmia) - Tuesday, 23 February 2016, 23:51 GMT
Pretty sure you're not supposed to link to this dynamically. _libdir comes from the text file that is libbfd.so.
Comment by Allan McRae (Allan) - Wednesday, 24 February 2016, 00:06 GMT
My bad... I added linker scripts to fake the dynamic linking by forgot to change the variable. New package on the way.
Comment by Kenji Takahashi (Kenji_Takahashi) - Wednesday, 24 February 2016, 00:21 GMT
Thanks for the quick response, Allan. I felt it was something like this going on.

Loading...