[PATCH] D89304: [llvm-readelf] - Implement --section-details option.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 25 23:00:16 PDT 2020
grimar added inline comments.
================
Comment at: llvm/test/tools/llvm-readobj/ELF/section-details.test:21
+# GNU64-NEXT: PROGBITS 1111111111111111 2222222222222222 3
+# GNU64-NEXT: 4444444444444444 0000000000000005 6 7
+# GNU64-NEXT: [0000000080000ff7]: WRITE, ALLOC, EXEC, MERGE, STRINGS, INFO LINK, LINK ORDER, OS NONCONF, GROUP, TLS, COMPRESSED, EXCLUDE
----------------
jhenderson wrote:
> Any reason not to have all 5s for the entsize? What about a high alignment (since the addralign field is much wider than one byte)?
Done.
================
Comment at: llvm/test/tools/llvm-readobj/ELF/section-details.test:75
+# GNU64-NEXT: [0000000080000000]: EXCLUDE
+# GNU64-NEXT: [15] known_and_unknown
+# GNU64-NEXT: PROGBITS 0000000000000000 0000000000000046 0
----------------
jhenderson wrote:
> Is UNKNOWN printed for "known" OS/Processor specific flags with GNU readelf?
GNU readelf prints the following for sh_flags = 0xffffffffffffffff:
```
[ffffffffffffffff]: WRITE, ALLOC, EXEC, MERGE, STRINGS, INFO LINK, LINK ORDER, OS NONCONF, GROUP, TLS, COMPRESSED, GNU_MBIND, EXCLUDE, OS (000000000ef00000), PROC (0000000070000000), UNKNOWN (ffffffff000ff008)
```
I.e. it prints "OS", "PROC" and "UNKNOWN" separatelly. I've updated implementation to follow.
================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:4213-4214
+
+ StringRef Name = unwrapOrError<StringRef>(
+ this->FileName, this->Obj.getSectionName(S, SecStrTable));
+ PrintFields({{Name, 7}});
----------------
jhenderson wrote:
> Shouldn't this use `reportUniqueWarning`? Also, test case?
I've added a single test case that covers both warnings.
(Sorry, I think I just forgot about these places initially).
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89304/new/
https://reviews.llvm.org/D89304
More information about the llvm-commits
mailing list