https://sourceware.org/bugzilla/show_bug.cgi?id=20800

            Bug ID: 20800
           Summary: BFD Linker failing (unresolvable R_X86_64_PLTOFF64)
                    with -mcmodel=large and --start-group
           Product: binutils
           Version: 2.27
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: keno at juliacomputing dot com
  Target Milestone: ---

Reduced from UML Linux Kernel build. ld.bfd fails with the following error,
ld.gold seems to work fine:

```
keno@anubis:~/linkerbug$ cat test.c
#include <stdio.h>
int main(void) {
    printf("Hello World");
}
keno@anubis:~/linkerbug$ gcc -shared -mcmodel=large -fno-builtin -c test.c
keno@anubis:~/linkerbug$ gcc -Wl,-rpath,/lib64 -m64 -Wl,--start-group test.o
-Wl,--end-group
/usr/bin/ld: test.o(.text+0x36): unresolvable R_X86_64_PLTOFF64 relocation
against symbol `printf@@GLIBC_2.2.5'
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
keno@anubis:~/linkerbug$ sudo cp -a /usr/bin/ld.gold /usr/bin/ld
keno@anubis:~/linkerbug$ gcc -Wl,-rpath,/lib64 -m64 -Wl,--start-group test.o
-Wl,--end-group
keno@anubis:~/linkerbug$ #worked
```

-- 
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

Reply via email to