https://sourceware.org/bugzilla/show_bug.cgi?id=17827
Bug ID: 17827 Summary: PIE copy relocations are broken with pointers Product: binutils Version: 2.25 Status: NEW Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: hjl.tools at gmail dot com On Linux/x86-64 with GCC 5: [hjl@gnu-tools-1 pr17689-2]$ cat x.c #if 0 #include <stdio.h> extern char *program_invocation_name; int main () { printf ("%s\n", program_invocation_name); return 0; } #else extern char *bar_alias; extern void foo (char *); char **ptr = &bar_alias; int main () { foo (bar_alias); foo (*ptr); return 0; } #endif [hjl@gnu-tools-1 pr17689-2]$ cat bar.c #include <stdio.h> char *bar = "PASS"; extern char *bar_alias __attribute__ ((weak, alias ("bar"))); void foo (char *x) { printf ("%s\n", x); } [hjl@gnu-tools-1 pr17689-2]$ make gcc -pie -o x x.o libbar.so -Wl,-rpath,. /usr/local/bin/ld: x.o(.data.rel+0x0): reloc against `bar_alias': error 4 /usr/local/bin/ld: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status make: *** [x] Error 1 [hjl@gnu-tools-1 pr17689-2]$ -- 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