https://sourceware.org/bugzilla/show_bug.cgi?id=21518
Bug ID: 21518 Summary: ld.gold should igmore -pie flag for --oformat=binary mode (ld.bfd does) Product: binutils Version: 2.27 Status: UNCONFIRMED Severity: normal Priority: P2 Component: gold Assignee: ccoutant at gmail dot com Reporter: slyfox at inbox dot ru CC: ian at airs dot com Target Milestone: --- It came up as a build failure of dosemu on gcc-7 with --enable-default-pie: https://bugs.gentoo.org/show_bug.cgi?id=618366 Simple reproducer (imagine '-pie' is a default): $ cat a.S .text .code16 .globl _start16 _start16: # this works $ gcc -pie -fuse-ld=gold -Wl,-Ttext,100,-e,_start16,--oformat,binary -nostdlib -s -o foo.com a.S /usr/lib/gcc/x86_64-pc-linux-gnu/7.1.0/../../../../x86_64-pc-linux-gnu/bin/ld.gold: fatal error: binary output format not compatible with -shared or -pie or -r collect2: error: ld returned 1 exit status # this fails $ gcc -pie -fuse-ld=bfd -Wl,-Ttext,100,-e,_start16,--oformat,binary -nostdlib -s -o foo.com a.S Arguably '-pie' has no role here as the output format is not really an ELF. $ x86_64-pc-linux-gnu-ld.gold --version GNU gold (Gentoo 2.27 p1.0 2.27) 1.12 -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils