mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-27 10:23:55 +08:00
Update symbol version for symbol from linker script
We need to update symbol version for symbols from linker script. bfd/ PR ld/19698 * elflink.c (bfd_elf_record_link_assignment): Set versioned if symbol version is unknown. ld/ PR ld/19698 * testsuite/ld-elf/pr19698.d: New file. * testsuite/ld-elf/pr19698.s: Likewise. * testsuite/ld-elf/pr19698.t: Likewise.
This commit is contained in:
parent
e7ad2f145c
commit
0f550b3df1
@ -1,3 +1,9 @@
|
||||
2016-02-24 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR ld/19698
|
||||
* elflink.c (bfd_elf_record_link_assignment): Set versioned if
|
||||
symbol version is unknown.
|
||||
|
||||
2016-02-24 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* elf32-i386.c (elf_i386_allocate_dynrelocs): Set plt_got.offset
|
||||
|
@ -555,6 +555,19 @@ bfd_elf_record_link_assignment (bfd *output_bfd,
|
||||
if (h == NULL)
|
||||
return provide;
|
||||
|
||||
if (h->versioned == unknown)
|
||||
{
|
||||
/* Set versioned if symbol version is unknown. */
|
||||
char *version = strrchr (name, ELF_VER_CHR);
|
||||
if (version)
|
||||
{
|
||||
if (version > name && version[-1] != ELF_VER_CHR)
|
||||
h->versioned = versioned_hidden;
|
||||
else
|
||||
h->versioned = versioned;
|
||||
}
|
||||
}
|
||||
|
||||
switch (h->root.type)
|
||||
{
|
||||
case bfd_link_hash_defined:
|
||||
|
@ -1,3 +1,10 @@
|
||||
2016-02-24 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR ld/19698
|
||||
* testsuite/ld-elf/pr19698.d: New file.
|
||||
* testsuite/ld-elf/pr19698.s: Likewise.
|
||||
* testsuite/ld-elf/pr19698.t: Likewise.
|
||||
|
||||
2016-02-23 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* Makefile.am (ELF_X86_DEPS): New.
|
||||
|
10
ld/testsuite/ld-elf/pr19698.d
Normal file
10
ld/testsuite/ld-elf/pr19698.d
Normal file
@ -0,0 +1,10 @@
|
||||
#ld: -shared $srcdir/$subdir/pr19698.t
|
||||
#readelf : --dyn-syms --wide
|
||||
#target: *-*-linux* *-*-gnu* *-*-solaris*
|
||||
|
||||
Symbol table '\.dynsym' contains [0-9]+ entries:
|
||||
#...
|
||||
+[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ +foo@VERS.1
|
||||
#...
|
||||
+[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ +foo@@VERS.2
|
||||
#pass
|
5
ld/testsuite/ld-elf/pr19698.s
Normal file
5
ld/testsuite/ld-elf/pr19698.s
Normal file
@ -0,0 +1,5 @@
|
||||
.text
|
||||
.globl foo
|
||||
.type foo, %function
|
||||
foo:
|
||||
.byte 0
|
11
ld/testsuite/ld-elf/pr19698.t
Normal file
11
ld/testsuite/ld-elf/pr19698.t
Normal file
@ -0,0 +1,11 @@
|
||||
"foo@VERS.1" = foo;
|
||||
|
||||
VERSION {
|
||||
VERS.2 {
|
||||
global:
|
||||
foo;
|
||||
};
|
||||
|
||||
VERS.1 {
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user