diff options
author | Fangrui Song <i@maskray.me> | 2024-01-22 10:09:35 -0800 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2024-01-22 10:09:35 -0800 |
commit | e390bda9782b461f10433aa6728acf87521e22a5 (patch) | |
tree | 3cac863480dbe9cf82d305811144e8b8fe8b54fb /llvm/lib/CodeGen/SelectOptimize.cpp | |
parent | 806f43e3cb9ca2bff7c2ae6f1324a062ddb83cac (diff) | |
download | llvm-e390bda9782b461f10433aa6728acf87521e22a5.zip llvm-e390bda9782b461f10433aa6728acf87521e22a5.tar.gz llvm-e390bda9782b461f10433aa6728acf87521e22a5.tar.bz2 |
[ELF] Suppress --no-allow-shlib-undefined diagnostic when a SharedSymbol is overridden by a hidden visibility Defined which is later discarded
Commit 1981b1b6b92f7579a30c9ed32dbdf3bc749c1b40 unexpectedly strengthened
--no-allow-shlib-undefined to catch a kind of ODR violation.
More precisely, when all three conditions are met, the new
`--no-allow-shlib-undefined` code reports an error.
* There is a DSO undef that has been satisfied by a definition from
another DSO.
* The `SharedSymbol` is overridden by a non-exported (usually of hidden
visibility) definition in a relocatable object file (`Defined`).
* The section containing the `Defined` is garbage-collected (it is not
part of `.dynsym` and is not marked as live).
Technically, the hidden Defined in the executable can be intentional: it
can be meant to remain non-exported and not interact with any dynamic
symbols of the same name that might exist in other DSOs. To allow for
such use cases, allocate a new bit in
Symbol and relax the --no-allow-shlib-undefined check to before
commit 1981b1b6b92f7579a30c9ed32dbdf3bc749c1b40.
Diffstat (limited to 'llvm/lib/CodeGen/SelectOptimize.cpp')
0 files changed, 0 insertions, 0 deletions