This patch changes single method of llvm-readobj.
It teaches SHT_GNU_verdef dumper to print version dependencies,
also it removes few fields from output that can be dumped with other keys
and slightly refactors code.
Testcase was also modified to match the changes.
Change is required for testcases of upcoming lld patches.
Details
Diff Detail
Event Timeline
tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
571 | How many dependencies can you have? |
tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
570 | The "spec" used the name "predecessor versions". Maybe this should be "Predecessors". I assume that if you have foo { bar { it will chain them? If that is the case, maybe it would be better to print just the first predecessor? In any case, I agree with Davide, we need a test :-) |
test/tools/llvm-readobj/elf-versioninfo.test | ||
---|---|---|
57 | Is it a common practice for llvm-dump* tools to print out an empty set {} if an element is missing? An alternative way is to not print out Dependencies {} if a version definition has no dependencies. |
test/tools/llvm-readobj/elf-versioninfo.test | ||
---|---|---|
57 | I think it is common, for example we often have relocations empty in testcases: Relocations [ ] I am going to change this in according to my answers to Rafael and Davide. | |
tools/llvm-readobj/ELFDumper.cpp | ||
570 | No, it will not chain. Foo will have [foo, bar], where bar is dependency. Bar will have [bar, zed]. And like I wrote in my answer to Davide, I was unable to get more than one "dependency", so looks "predecessor" word is more correct here. | |
571 | I did not found how to get more that one dependency here. I also think that it can be only one now. But spec says: "At least one version dependency must exist. Additional version dependencies can be present, the number being indicated by the vn_cnt value.". |
tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
570 | Ah, I was mean: "yes, it will chain" zed<-bar<-foo, but will not add zed as a "dependency" for bar. |
tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
570 | *for foo |
tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
572 | I do that above :) |
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
569 ↗ | (On Diff #61543) | Hi, I am curious about why the Parents/Predecessor more than one. According to https://akkadia.org/drepper/symbol-versioning
Feel free to ignore me :) just out of curiosity |
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
569 ↗ | (On Diff #61543) | Besides, gnu-readelf could print multiple parents |
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
569 ↗ | (On Diff #61543) | Sorry, I am curious about why the Parents/Predecessor *cannot be* more than one. You could use my patch to make a simple test, if needed https://reviews.llvm.org/D54867 feel free to ignore me :) |
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
569 ↗ | (On Diff #61543) | Hi! You can find some answers in the comments for this patch, starting from this one: In short - I was unable to produce the output that has more than one predecessor, |
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
569 ↗ | (On Diff #61543) | Oh, sorry for bothering, thank you very much! |
Is it a common practice for llvm-dump* tools to print out an empty set {} if an element is missing? An alternative way is to not print out Dependencies {} if a version definition has no dependencies.