SHT_GNU_verneed (.gnu.version_r) is a version dependency section.
It was the last symbol versioning relative section that was not dumped,
now it is.
Details
- Reviewers
davide • rafael - Commits
- rG2030cacc6711: [ELF] - Tweak verneed.s test to use new llvm-readobj functionality
rGcd36e182d2f4: [llvm-readobj] - Teach llvm-readobj to dump .gnu.version_r sections
rLLD272120: [ELF] - Tweak verneed.s test to use new llvm-readobj functionality
rL272120: [ELF] - Tweak verneed.s test to use new llvm-readobj functionality
rL271998: [llvm-readobj] - Teach llvm-readobj to dump .gnu.version_r sections
Diff Detail
- Repository
- rL LLVM
Event Timeline
LGTM with nits.
tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
583 ↗ | (On Diff #59734) | I don't think this should print Name/Address/Offset/Link. They are available from -s. |
603 ↗ | (On Diff #59734) | Not sure we need to print vn_cnt, since we print vn_cnt entries. |
604 ↗ | (On Diff #59734) | FileName maybe? |
613 ↗ | (On Diff #59734) | Don't we want to expand this into an enum? |
This looks fine after Rafael's comments are addressed.
I don't like "Version needs". Can we just use the original section name "SHT_GNU_verneed", which is more understandable and also maps 1:1 with the "spec"[1]? Rafael?
[1] When I say the spec I mean Drepper's document on versioning https://www.akkadia.org/drepper/symbol-versioning
Rafael, Davide, thanks for review !
tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
583 ↗ | (On Diff #59734) | Removed. |
603 ↗ | (On Diff #59734) | I would leave it. There can be lots of vn_aux and it can be reasonable to print the amount to know that value for possible testcases. Counting them all manually can be a problem. |
604 ↗ | (On Diff #59734) | Done. |
613 ↗ | (On Diff #59734) | Done. Btw according to gold sources I have, it is always 0 currently: for (p = this->need_versions_.begin(), i = 0; p != this->need_versions_.end(); ++p, ++i) { elfcpp::Vernaux_write<size, big_endian> vna(pb); vna.set_vna_hash(Dynobj::elf_hash((*p)->version())); // FIXME: We need to sometimes set VER_FLG_WEAK here. vna.set_vna_flags(0); vna.set_vna_other((*p)->index()); vna.set_vna_name(dynpool->get_offset((*p)->version())); vna.set_vna_next(i + 1 >= this->need_versions_.size() ? 0 : vernaux_size); pb += vernaux_size; } |
rafael wrote:
Don't we want to expand this into an enum?
Done. Btw according to gold sources I have, it is always 0 currently:
Yes, according to
https://lists.debian.org/lsb-spec/1999/12/msg00017.html only
VER_FLG_WEAK is defined and it is not clear why it is needed.
The entire area around symbol versioning seems over designed and under
documented :-(
Cheers,
Rafael
Yes, according to
https://lists.debian.org/lsb-spec/1999/12/msg00017.html only
VER_FLG_WEAK is defined and it is not clear why it is needed.The entire area around symbol versioning seems over designed and under
documented :-(
I have the same opinion here.
I suppose we just want to support minimal required subset in lld.
Cheers,
Rafael