1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[llvm-readelf] - Do no print an empty symbol version as "<corrupt>"

It is discussed here https://reviews.llvm.org/D71118#inline-643172

Currently when a version is empty, llvm-readelf prints:
"000:   0 (*local*)       2 (<corrupt>)"

But GNU readelf does not treat empty section as corrupt.
There is no sense in having empty versions anyways it seems, but
this change is for consistency with GNU.

Differential revision: https://reviews.llvm.org/D71243
This commit is contained in:
Georgii Rymar 2019-12-10 12:44:05 +03:00
parent 907fdaa34b
commit 62b65d3bc1
2 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@
# GNU-VERNEED-NAME: Version symbols section '.gnu.version' contains 2 entries:
# GNU-VERNEED-NAME-NEXT: Addr: 0000000000200210 Offset: 0x000040 Link: 5 (.dynsym)
# GNU-VERNEED-NAME-NEXT: 000: 0 (*local*) 2 (<corrupt>)
# GNU-VERNEED-NAME-NEXT: 000: 0 (*local*) 2 ()
# GNU-VERNEED-NAME: Version needs section '.gnu.version_r' contains 1 entries:
# GNU-VERNEED-NAME-NEXT: Addr: 0000000000000000 Offset: 0x000044 Link: 6 (.dynstr)

View File

@ -4133,7 +4133,7 @@ void GNUStyle<ELFT>::printVersionSymbolSection(const ELFFile<ELFT> *Obj,
bool IsDefault;
Expected<StringRef> NameOrErr =
this->dumper()->getSymbolVersionByIndex(Ndx, IsDefault);
if (!NameOrErr || NameOrErr->empty()) {
if (!NameOrErr) {
if (!NameOrErr) {
unsigned SecNdx = Sec - &cantFail(Obj->sections()).front();
this->reportUniqueWarning(createError(