This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: Add R_386_SIZE32/R_X86_64_SIZE32/R_X86_64_SIZE64 support to bfd
On Wed, Jan 16, 2013 at 3:57 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Wed, Jan 16, 2013 at 3:50 PM, David Miller <davem@davemloft.net> wrote:
>>
>> H.J. I wonder about this syntax.
>>
>> Won't it conflict with symbol versioning?
>>
>> How could we refer in the assembler to a specific version of
>> a symbol, and that version happens to be "SIZE"?
>>
>> Maybe I'm concerned about a non-issue, but I thought I'd ask.
>
> The same applies to @PLT, @GOT, @GOTOFF, ....
> I don't think it is a real issue.
>
[hjl@gnu-6 sized-tls]$ cat v.S
.globl old_foo
.symver old_foo, foo@SIZE
old_foo:
movl $foo@SIZE,%eax
[hjl@gnu-6 sized-tls]$ ./as -o v.o v.S
[hjl@gnu-6 sized-tls]$ ./objdump -drw v.o
v.o: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <foo@SIZE>:
0: b8 00 00 00 00 mov $0x0,%eax 1: R_X86_64_SIZE32 foo
[hjl@gnu-6 sized-tls]$ ./readelf -sW v.o
Symbol table '.symtab' contains 7 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 SECTION LOCAL DEFAULT 1
2: 0000000000000000 0 SECTION LOCAL DEFAULT 3
3: 0000000000000000 0 SECTION LOCAL DEFAULT 4
4: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 old_foo
5: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND foo
6: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 foo@SIZE
[hjl@gnu-6 sized-tls]$
--
H.J.