Visibility=hidden for x86_64 Xen builds -- problems?

Keir Fraser Keir.Fraser@cl.cam.ac.uk
Thu Sep 28 14:31:00 GMT 2006


On 28/9/06 14:24, "H. J. Lu" <hjl@lucon.org> wrote:

> On Thu, Sep 28, 2006 at 10:45:38AM +0100, Jan Beulich wrote:
>> 
>> 2) Why does the linker silently resolve the (32-bit PC-relative)
>> relocation targeting an undefined weak symbol, yielding at
>> run-time a non-zero address? While I can see the point of
> 
> Do you have a testcase? I can't reproduce it. If it is true, I consider
> it a linker bug.

Compile and link the attached C program as follows. I used gcc-4.1.1 and
binutils-2.17, but gcc >= 4.0.0 and binutils >= 2.16 probably suffice.

 # gcc -fpic -o test.o -c test.c
 # ld -Ttext 100000000 -o test test.o

Disassembly of the result trivially shows that the address of weak symbol
'x' is 0x100000000.

 -- Keir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: application/octet-stream
Size: 107 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20060928/e4255720/attachment.obj>


More information about the Gcc mailing list