bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/584] New: Invalid relocation to protected symbol


From: schwab at suse dot de
Subject: [Bug gas/584] New: Invalid relocation to protected symbol
Date: 26 Nov 2004 13:50:10 -0000

A call to a protected symbols is generating a R_X86_64_PC32 relocation
even though the linker cannot resolve that when generating a shared
library.

$ cat protected.c
void __attribute__ ((visibility ("protected"))) foo (void) {}
void bar (void) { return foo (); }
$ gcc -fPIC protected.c
$ objdump -r protected.o

protected.o:     file format elf64-x86-64

RELOCATION RECORDS FOR [.text]:
OFFSET           TYPE              VALUE 
000000000000000b R_X86_64_PC32     foo+0xfffffffffffffffc


RELOCATION RECORDS FOR [.eh_frame]:
OFFSET           TYPE              VALUE 
0000000000000020 R_X86_64_PC32     .text
0000000000000040 R_X86_64_PC32     .text+0x0000000000000006


$ gcc -shared protected.o
/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.4/../../../../x86_64-suse-linux/bin/ld:
 protected.o: relocation R_X86_64_PC32 against `foo' can not be used when 
making a shared object; recompile with -fPIC
/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.4/../../../../x86_64-suse-linux/bin/ld:
 final link failed: Bad value
collect2: ld returned 1 exit status

-- 
           Summary: Invalid relocation to protected symbol
           Product: binutils
           Version: 2.15
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: schwab at suse dot de
                CC: bug-binutils at gnu dot org
GCC target triplet: x86-64-*-*


http://sources.redhat.com/bugzilla/show_bug.cgi?id=584

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]