diff options
| author | Fangrui Song <maskray@google.com> | 2019-08-05 14:31:39 +0000 |
|---|---|---|
| committer | Fangrui Song <maskray@google.com> | 2019-08-05 14:31:39 +0000 |
| commit | e28a70daf4e685ed4b50619fb30983b4464fae1c (patch) | |
| tree | 4a5bb115f6a58f96669f788bb0de95aac9861eea /lld/test/ELF/linkerscript/version-script.s | |
| parent | 0039f87fa5c9b621d2e3aee0e79f1bab297cd5ef (diff) | |
| download | bcm5719-llvm-e28a70daf4e685ed4b50619fb30983b4464fae1c.tar.gz bcm5719-llvm-e28a70daf4e685ed4b50619fb30983b4464fae1c.zip | |
[ELF] Consistently prioritize non-* wildcards overs "*" in version scripts
We prioritize non-* wildcards overs VER_NDX_LOCAL/VER_NDX_GLOBAL "*".
This patch generalizes the rule to "*" of other versions and thus fixes PR40176.
I don't feel strongly about this GNU linkers' behavior but the
generalization simplifies code.
Delete `config->defaultSymbolVersion` which was used to special case
VER_NDX_LOCAL/VER_NDX_GLOBAL "*".
In `SymbolTable::scanVersionScript`, custom versions are handled the same
way as VER_NDX_LOCAL/VER_NDX_GLOBAL. So merge
`config->versionScript{Locals,Globals}` into `config->versionDefinitions`.
Overall this seems to simplify the code.
In `SymbolTable::assign{Exact,Wildcard}Versions`,
`sym->verdefIndex == config->defaultSymbolVersion` is changed to
`verdefIndex == UINT32_C(-1)`.
This allows us to give duplicate assignment diagnostics for
`{ global: foo; };` `V1 { global: foo; };`
In test/linkerscript/version-script.s:
vs_index of an undefined symbol changes from 0 to 1. This doesn't matter (arguably 1 is better because the binding is STB_GLOBAL) because vs_index of an undefined symbol is ignored.
Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D65716
llvm-svn: 367869
Diffstat (limited to 'lld/test/ELF/linkerscript/version-script.s')
| -rw-r--r-- | lld/test/ELF/linkerscript/version-script.s | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/test/ELF/linkerscript/version-script.s b/lld/test/ELF/linkerscript/version-script.s index 67a0fd68ca7..d751fbf04ab 100644 --- a/lld/test/ELF/linkerscript/version-script.s +++ b/lld/test/ELF/linkerscript/version-script.s @@ -17,7 +17,7 @@ # CHECK-NEXT: Name: # CHECK-NEXT: } # CHECK-NEXT: Symbol { -# CHECK-NEXT: Version: 0 +# CHECK-NEXT: Version: 1 # CHECK-NEXT: Name: und # CHECK-NEXT: } # CHECK-NEXT: Symbol { |

