[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/17827] New: PIE copy relocations are broken with pointers
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug ld/17827] New: PIE copy relocations are broken with pointers |
Date: |
Sun, 11 Jan 2015 15:39:39 +0000 |
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:
address@hidden 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
address@hidden 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);
}
address@hidden 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
address@hidden pr17689-2]$
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/17827] New: PIE copy relocations are broken with pointers,
hjl.tools at gmail dot com <=