[PATCH] D71819: [ELF] Support input section description .gnu.version* in /DISCARD/
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 25 23:20:22 PST 2019
grimar added inline comments.
================
Comment at: lld/ELF/SyntheticSections.cpp:1441
bool hasVerNeed = SharedFile::vernauxNum != 0;
- if (hasVerNeed || part.verDef)
+ if ((hasVerNeed || part.verDef) && part.verSym->isLive())
addInSec(DT_VERSYM, part.verSym);
----------------
Seems you can just use `if (part.verSym->isNeeded())` here and `if (part.verNeed->isNeeded())` below?
```
if (part.verSym->isNeeded())
addInSec(DT_VERSYM, part.verSym);
if (part.verDef) {
addInSec(DT_VERDEF, part.verDef);
addInt(DT_VERDEFNUM, getVerDefNum());
}
if (part.verNeed->isNeeded()) {
...
}
```
================
Comment at: lld/test/ELF/linkerscript/discard-gnu-version.s:24
+# RUN: ld.lld -shared --version-script %t.ver -T %t.script %t.o %t1.so -o %t.so
+# RUN: llvm-readelf -S %t.so | FileCheck /dev/null --implicit-check-not=.gnu.version --implicit-check-not='(VER'
+
----------------
You need to specify `-d` here and below I think to dump the dynamic table.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71819/new/
https://reviews.llvm.org/D71819
More information about the llvm-commits
mailing list