This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug dynamic-link/17711] New: copy relocations against protected symbols don't work
- From: "hjl.tools at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Sun, 14 Dec 2014 12:43:50 +0000
- Subject: [Bug dynamic-link/17711] New: copy relocations against protected symbols don't work
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=17711
Bug ID: 17711
Summary: copy relocations against protected symbols don't work
Product: glibc
Version: 2.21
Status: NEW
Severity: normal
Priority: P2
Component: dynamic-link
Assignee: unassigned at sourceware dot org
Reporter: hjl.tools at gmail dot com
On Linux/x86-64, I got
[hjl@gnu-tools-1 pr15228]$ cat x.c
extern int a;
extern void bar (void);
int main()
{
bar ();
if (a != 30)
__builtin_abort();
return 0;
}
[hjl@gnu-tools-1 pr15228]$ cat bar.c
int a;
__attribute__((visibility("protected"))) int a;
void
bar ()
{
a = 30;
}
[hjl@gnu-tools-1 pr15228]$ make all
gcc -B/bin/ -c -o x.o x.c
gcc -B/bin/ -fPIC -c -o bar.o bar.c
./ld -shared -o libbar.so bar.o
gcc -B/bin/ -o x x.o libbar.so -Wl,-rpath,.
./x
make: *** [all] Aborted (core dumped)
[hjl@gnu-tools-1 pr15228]$
Should it be disallowed by linker?
--
You are receiving this mail because:
You are on the CC list for the bug.