This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
.symver GAS directive and local symbols
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: binutils at sourceware dot org
- Cc: Jan Hubicka <hubicka at ucw dot cz>, mliska at suse dot cz
- Date: Fri, 15 Nov 2019 11:43:50 +0100
- Subject: .symver GAS directive and local symbols
Jan noticed that if you start out with a local alias of a global
symbol and apply symbol version to that, you get a local symbol:
.globl foo
.type foo, @function
.size foo, 4
foo:
.long 0
.set foo.symver.1, foo
.symver foo.symver.1, foo@VER
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 2
3: 0000000000000000 0 SECTION LOCAL DEFAULT 3
4: 0000000000000000 4 FUNC LOCAL DEFAULT 1 foo.symver.1
5: 0000000000000000 4 FUNC LOCAL DEFAULT 1 foo@VER
6: 0000000000000000 4 FUNC GLOBAL DEFAULT 1 foo
Is there a good reason for this behavior?
What we really want to do is to export the same symbol at multiple
versions, like this:
.symver foo, foo@VER1
.symver foo, foo@VER2
But GAS explicitly rejects that.