Bug 12879 - gold doesn't like .symver name,name@VERS
Summary: gold doesn't like .symver name,name@VERS
Status: RESOLVED DUPLICATE of bug 12893
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.22
: P2 normal
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-11 09:43 UTC by Roland McGrath
Modified: 2011-06-17 14:08 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roland McGrath 2011-06-11 09:43:52 UTC
gold gives a multiple definition error when the same object file defines both foo and foo@... symbols, even with same value.  BFD ld accepts this usage.
It would perhaps be reasonable to complain if foo and foo@... did not match.

magilla 100 % head ver.s ver.v
==> ver.s <==
	.globl foo
foo:
	.symver foo,foo@VERS1

==> ver.v <==
VERS1 {
 global:
   foo;
};
magilla 101 % gcc -c ver.s
magilla 102 % ./gold/ld-new -shared -o ver.so ver.o --version-script=ver.v
./gold/ld-new: error: ver.o: multiple definition of 'foo'
./gold/ld-new: ver.o: previous definition here
[Exit 1]
magilla 103 % ./ld/ld-new -shared -o ver.so ver.o --version-script=ver.v
magilla 104 % eu-readelf -s ver.o ver.so

ver.o:


Symbol table [ 5] '.symtab' contains 6 entries:
 4 local symbols  String table: [ 6] '.strtab'
  Num:            Value   Size Type    Bind   Vis          Ndx Name
    0: 0000000000000000      0 NOTYPE  LOCAL  DEFAULT    UNDEF 
    1: 0000000000000000      0 SECTION LOCAL  DEFAULT        1 
    2: 0000000000000000      0 SECTION LOCAL  DEFAULT        2 
    3: 0000000000000000      0 SECTION LOCAL  DEFAULT        3 
    4: 0000000000000000      0 NOTYPE  GLOBAL DEFAULT        1 foo
    5: 0000000000000000      0 NOTYPE  GLOBAL DEFAULT        1 foo@VERS1

ver.so:


Symbol table [ 2] '.dynsym' contains 6 entries:
 1 local symbol  String table: [ 3] '.dynstr'
  Num:            Value   Size Type    Bind   Vis          Ndx Name
    0: 0000000000000000      0 NOTYPE  LOCAL  DEFAULT    UNDEF 
    1: 0000000000000000      0 OBJECT  GLOBAL DEFAULT      ABS VERS1@@VERS1
    2: 00000000002002f8      0 NOTYPE  GLOBAL DEFAULT      ABS __bss_start
    3: 0000000000000218      0 NOTYPE  GLOBAL DEFAULT        5 foo@VERS1
    4: 00000000002002f8      0 NOTYPE  GLOBAL DEFAULT      ABS _edata
    5: 00000000002002f8      0 NOTYPE  GLOBAL DEFAULT      ABS _end

Symbol table [ 8] '.symtab' contains 14 entries:
 9 local symbols  String table: [ 9] '.strtab'
  Num:            Value   Size Type    Bind   Vis          Ndx Name
    0: 0000000000000000      0 NOTYPE  LOCAL  DEFAULT    UNDEF 
    1: 00000000000000e8      0 SECTION LOCAL  DEFAULT        1 
    2: 0000000000000118      0 SECTION LOCAL  DEFAULT        2 
    3: 00000000000001a8      0 SECTION LOCAL  DEFAULT        3 
    4: 00000000000001d2      0 SECTION LOCAL  DEFAULT        4 
    5: 00000000000001e0      0 SECTION LOCAL  DEFAULT        5 
    6: 0000000000200218      0 SECTION LOCAL  DEFAULT        6 
    7: 0000000000200218      0 OBJECT  LOCAL  DEFAULT      ABS _DYNAMIC
    8: 0000000000000000      0 OBJECT  LOCAL  DEFAULT      ABS _GLOBAL_OFFSET_TABLE_
    9: 0000000000000000      0 OBJECT  GLOBAL DEFAULT      ABS VERS1
   10: 00000000002002f8      0 NOTYPE  GLOBAL DEFAULT      ABS __bss_start
   11: 0000000000000218      0 NOTYPE  GLOBAL DEFAULT        5 foo@VERS1
   12: 00000000002002f8      0 NOTYPE  GLOBAL DEFAULT      ABS _edata
   13: 00000000002002f8      0 NOTYPE  GLOBAL DEFAULT      ABS _end
magilla 105 %
Comment 1 Ian Lance Taylor 2011-06-17 14:08:36 UTC
Same as PR 12893, which is now fixed.

*** This bug has been marked as a duplicate of bug 12893 ***