This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Visibility=hidden for x86_64 Xen builds -- problems?
- From: Keir Fraser <Keir dot Fraser at cl dot cam dot ac dot uk>
- To: "H. J. Lu" <hjl at lucon dot org>, Jan Beulich <jbeulich at novell dot com>
- Cc: <gcc at gcc dot gnu dot org>, <binutils at sourceware dot org>, <discuss at x86-64 dot org>
- Date: Thu, 28 Sep 2006 15:33:05 +0100
- Subject: Re: Visibility=hidden for x86_64 Xen builds -- problems?
> 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.
By the way, experimentation with the address of the text section shows that
the weak symbol's address is resolved to the nearest 4GB-aligned address
(nearest to what I'm not sure -- RIP? Section start?). It may get rounded up
or down, whichever is nearest.
-- Keir