]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
.symver fixes
authorAlan Modra <amodra@gmail.com>
Wed, 22 Apr 2020 02:22:13 +0000 (11:52 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 22 Apr 2020 12:54:03 +0000 (22:24 +0930)
* config/obj-elf.c (elf_frob_symbol): Unconditionally remove
symbol for ".symver .. remove".
* doc/as.texi (.symver): Update.
* testsuite/gas/symver/symver11.s: Make foo weak.
* testsuite/gas/symver/symver11.d: Expect an error.
* testsuite/gas/symver/symver7.d: Allow other random symbols.

gas/ChangeLog
gas/config/obj-elf.c
gas/doc/as.texi
gas/testsuite/gas/symver/symver11.d
gas/testsuite/gas/symver/symver11.s
gas/testsuite/gas/symver/symver7.d

index 4e19dd9bbcbeb278c0e3710c84d66bf827923651..3f59c81614545cc7952c55de8dabcf0b3cdb19bb 100644 (file)
@@ -1,3 +1,12 @@
+2020-04-22  Alan Modra  <amodra@gmail.com>
+
+       * config/obj-elf.c (elf_frob_symbol): Unconditionally remove
+       symbol for ".symver .. remove".
+       * doc/as.texi (.symver): Update.
+       * testsuite/gas/symver/symver11.s: Make foo weak.
+       * testsuite/gas/symver/symver11.d: Expect an error.
+       * testsuite/gas/symver/symver7.d: Allow other random symbols.
+
 2020-04-21  H.J. Lu  <hongjiu.lu@intel.com>
 
        * testsuite/gas/symver/symver11.s: Add ".balign 8".
index 409ea4d6bed5ef4542bc772e9b7b372f9026bc1c..4bdddc9056dc3aa65b980c1a6de620bfade0d6ef 100644 (file)
@@ -2569,9 +2569,7 @@ elf_frob_symbol (symbolS *symp, int *puntp)
              elfsym->internal_elf_sym.st_other |= STV_HIDDEN;
              break;
            case visibility_remove:
-             /* Remove the symbol if it isn't used in relocation.  */
-             if (!symbol_used_in_reloc_p (symp))
-               symbol_remove (symp, &symbol_rootP, &symbol_lastP);
+             symbol_remove (symp, &symbol_rootP, &symbol_lastP);
              break;
            case visibility_local:
              S_CLEAR_EXTERNAL (symp);
index 8669879c87f165b9491b40c7d166a466fef3a5cd..a65ddad5f507862d3e7b08870b97e62a2a47ee9f 100644 (file)
@@ -7129,13 +7129,12 @@ building a shared library.  If you are attempting to override a versioned
 symbol from a shared library, then @var{nodename} should correspond to the
 nodename of the symbol you are trying to override.  The optional argument
 @var{visibility} updates the visibility of the original symbol.  The valid
-visibilities are @code{local}, @code {hidden}, and @code {remove}.  The
+visibilities are @code{local}, @code{hidden}, and @code{remove}.  The
 @code{local} visibility makes the original symbol a local symbol
 (@pxref{Local}).  The @code{hidden} visibility sets the visibility of the
 original symbol to @code{hidden} (@pxref{Hidden}).  The @code{remove}
-visibility removes the original symbol from the symbol table if it isn't
-used in relocation.  If visibility isn't specified, the original symbol
-is unchanged.
+visibility removes the original symbol from the symbol table.  If visibility
+isn't specified, the original symbol is unchanged.
 
 If the symbol @var{name} is not defined within the file being assembled, all
 references to @var{name} will be changed to @var{name2@@nodename}.  If no
index 0e3e7f14b7dc2853d9ccd56d741a9397fb7e0f6d..caa76e167da58735b8941e509374164be285b36e 100644 (file)
@@ -1,8 +1,2 @@
-#readelf: -rsW
 #name: symver symver11
-
-#...
-[0-9a-f]+ +[0-9a-f]+ +R_.* +[0-9a-f]+ +foo *.*
-#...
- +[0-9]+: +0+ +1 +OBJECT +GLOBAL +DEFAULT +[0-9]+ +foo
-#pass
+#error: .*symbol cannot be used on reloc
index 08416be0f0562e94a318d1da8f018d1dd0d985cf..2c7c6e7f6bdaf5fa5398b00e2168a6bfc3273b1b 100644 (file)
@@ -1,5 +1,5 @@
        .data
-       .globl foo
+       .weak foo
        .type foo,%object
 foo:
        .byte 0
index 5152678a485dcc856eace9f353b38931a8438cf0..2e956a6a1b6c12f35c7af684e799ac89d9dec06c 100644 (file)
@@ -3,6 +3,7 @@
 
 #...
  +[0-9]+: +0+ +1 +OBJECT +GLOBAL +HIDDEN +[0-9]+ +foo
+#...
  +[0-9]+: +0+ +1 +OBJECT +GLOBAL +DEFAULT +[0-9]+ +foo@version1
  +[0-9]+: +0+ +1 +OBJECT +GLOBAL +DEFAULT +[0-9]+ +foo@@version2
 #pass