diff options
author | Alan Modra <amodra@gmail.com> | 2020-04-22 11:52:13 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-04-22 22:24:03 +0930 |
commit | 31c89d6038f2658f5e06a762aa9e20e78e74651f (patch) | |
tree | 1ae7e0154824b7aeaaa5b8e1a6a8c83228e779eb /gas | |
parent | 54ac3df1adbf7b4b3470a8df08caa0aea4c89616 (diff) | |
download | gdb-31c89d6038f2658f5e06a762aa9e20e78e74651f.zip gdb-31c89d6038f2658f5e06a762aa9e20e78e74651f.tar.gz gdb-31c89d6038f2658f5e06a762aa9e20e78e74651f.tar.bz2 |
.symver fixes
* 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.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 9 | ||||
-rw-r--r-- | gas/config/obj-elf.c | 4 | ||||
-rw-r--r-- | gas/doc/as.texi | 7 | ||||
-rw-r--r-- | gas/testsuite/gas/symver/symver11.d | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/symver/symver11.s | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/symver/symver7.d | 1 |
6 files changed, 16 insertions, 15 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 4e19dd9..3f59c81 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -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". diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index 409ea4d..4bdddc9 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -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); diff --git a/gas/doc/as.texi b/gas/doc/as.texi index 8669879..a65ddad 100644 --- a/gas/doc/as.texi +++ b/gas/doc/as.texi @@ -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 diff --git a/gas/testsuite/gas/symver/symver11.d b/gas/testsuite/gas/symver/symver11.d index 0e3e7f1..caa76e1 100644 --- a/gas/testsuite/gas/symver/symver11.d +++ b/gas/testsuite/gas/symver/symver11.d @@ -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 diff --git a/gas/testsuite/gas/symver/symver11.s b/gas/testsuite/gas/symver/symver11.s index 08416be..2c7c6e7 100644 --- a/gas/testsuite/gas/symver/symver11.s +++ b/gas/testsuite/gas/symver/symver11.s @@ -1,5 +1,5 @@ .data - .globl foo + .weak foo .type foo,%object foo: .byte 0 diff --git a/gas/testsuite/gas/symver/symver7.d b/gas/testsuite/gas/symver/symver7.d index 5152678..2e956a6 100644 --- a/gas/testsuite/gas/symver/symver7.d +++ b/gas/testsuite/gas/symver/symver7.d @@ -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 |