FS#55741 - [binutils] ld segfault with -static and -Map

Attached to Project: Arch Linux
Opened by Valère Monseur (valr) - Monday, 25 September 2017, 08:31 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Monday, 09 October 2017, 08:41 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Bartłomiej Piotrowski (Barthalion)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: ld segfault when compiling with both -static and -Map options.
The reported error is:

collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
compilation terminated.

Package version(s):

binutils 2.29, and the problem occurs as well with binutils 2.29.1
(for info, gcc 7.2.0 & glibc 2.26)

I've reported the bug upstream, this bug report is for info.
https://sourceware.org/bugzilla/show_bug.cgi?id=22199

Steps to reproduce:

1) create source file: hello.c

#include <stdio.h>

int main (int argc, char **argv)
{
printf("hello world!");
}

2) compile with these options:

gcc -Wl,-Map,hello.map hello.c => works ok
gcc -static hello.c => works ok
gcc -static -Wl,-Map,hello.map hello.c => segfault
This task depends upon

Closed by  Bartłomiej Piotrowski (Barthalion)
Monday, 09 October 2017, 08:41 GMT
Reason for closing:  Fixed
Additional comments about closing:  backported in 2.29.1-1
Comment by Valère Monseur (valr) - Tuesday, 26 September 2017, 22:37 GMT
The bug has been fixed upstream.
It's planned to be delivered in binutils 2.30 and has been backported to the 2.29 branch, so I guess it will be in a 2.29.2 version (when it will be released).

Btw, I forgot to mention that I originally reported the bug because busybox didn't compile anymore.
Should you need to statically compile busybox before the release of the new binutils version, you can apply this workaround (in the prepare function of the PKGBUILD):

sed -i 's/-Wl,-Map,$EXE.map//' scripts/trylink

Loading...