This is useful when trying to read notes from stripped files and matches
the behavior of GNU readelf and eu-readelf.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
I can't reproduce the test case -- it seems llvm-readelf already prints the NT_GNU_BUILD_ID when I follow the test steps.
llvm/test/tools/llvm-readobj/gnu-notes.test | ||
---|---|---|
6 | Copy this to %t2.so so the original %t1.so is unaffected - e.g. if someone reruns one of these commands to debug a test failure, they should get the unstripped one with %t1.so even if the rest of the test case runs. | |
7 | Can you add the corresponding FileCheck for llvm-readelf? | |
llvm/tools/llvm-readobj/ELFDumper.cpp | ||
4505 | Can you add this to LLVMStyle<ELFT>::printNotes too? |
Thanks for doing this. This was something on my radar too as an odd inconsistency.
llvm/trunk/test/tools/llvm-readobj/gnu-notes.test | ||
---|---|---|
7 ↗ | (On Diff #215707) | Not that it matters that much, but I don't think you needed the --strict-whitespace and --match-full-lines, since the format would be the same as the unstripped case. |
72–75 ↗ | (On Diff #215707) | Could you make a follow-up commit to share this with the above GNU case, please? This could be achieved with something like: # RUN: ... | FileCheck %s --check-prefixes=GNU,UNSTRIPPED -DOFFSET=0x00000238 # RUN: ... | FileCheck %s --check-prefix=GNU --implicit-check-not={{.}} -DOFFSET=0x00000040 # GNU:Displaying notes found at file offset [[OFFSET]] with length 0x00000020: # GNU-NEXT: Owner Data size Description # GNU-NEXT: GNU 0x00000010 NT_GNU_ABI_TAG (ABI version tag) # GNU-NEXT: OS: Linux, ABI: 2.6.32 # UNSTRIPPED:Displaying notes found at file offset 0x00000258 with length 0x00000020: # UNSTRIPPED-NEXT: Owner Data size Description ... The same sort of thing should work with the LLVM output. By doing this, you avoid the duplicate contents, and illustrate that the part covered by the program header should be identical. |
Copy this to %t2.so so the original %t1.so is unaffected - e.g. if someone reruns one of these commands to debug a test failure, they should get the unstripped one with %t1.so even if the rest of the test case runs.