aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-02-24 15:13:35 -0800
committerH.J. Lu <hjl.tools@gmail.com>2016-02-24 15:13:48 -0800
commit0f550b3df1d4ae31d12505cf93981313c9c6dd25 (patch)
tree854ccf6e75c3ec01fe29f0594669c0c1d89b7d1e /bfd/elflink.c
parente7ad2f145c05bc60b1cd2796c8f3b72f02e3e730 (diff)
downloadfsf-binutils-gdb-0f550b3df1d4ae31d12505cf93981313c9c6dd25.zip
fsf-binutils-gdb-0f550b3df1d4ae31d12505cf93981313c9c6dd25.tar.gz
fsf-binutils-gdb-0f550b3df1d4ae31d12505cf93981313c9c6dd25.tar.bz2
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.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 7d565f5..993e9b9 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -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: