-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[llvm-objdump] Remove leading whitespace for PT_GNU_PROPERTY. #121591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-llvm-binary-utilities Author: Ryan Mansfield (rjmansfield) ChangesThis fixes the misaligned display of addresses for this p_type. Previous:
After:
Full diff: https://github.com/llvm/llvm-project/pull/121591.diff 2 Files Affected:
diff --git a/llvm/test/tools/llvm-objdump/ELF/pt-gnu-property.test b/llvm/test/tools/llvm-objdump/ELF/pt-gnu-property.test
index 246337866a7774..3083ba5eb896d7 100644
--- a/llvm/test/tools/llvm-objdump/ELF/pt-gnu-property.test
+++ b/llvm/test/tools/llvm-objdump/ELF/pt-gnu-property.test
@@ -2,7 +2,7 @@
# RUN: llvm-objdump -p %t | FileCheck %s
# CHECK: Program Header:
-# CHECK-NEXT: {{ }}PROPERTY{{ }}
+# CHECK-NEXT: PROPERTY{{ }}
--- !ELF
FileHeader:
diff --git a/llvm/tools/llvm-objdump/ELFDump.cpp b/llvm/tools/llvm-objdump/ELFDump.cpp
index d78cf485587e1e..e9e5b059f1786e 100644
--- a/llvm/tools/llvm-objdump/ELFDump.cpp
+++ b/llvm/tools/llvm-objdump/ELFDump.cpp
@@ -269,7 +269,7 @@ template <class ELFT> void ELFDumper<ELFT>::printProgramHeaders() {
outs() << " RELRO ";
break;
case ELF::PT_GNU_PROPERTY:
- outs() << " PROPERTY ";
+ outs() << "PROPERTY ";
break;
case ELF::PT_GNU_STACK:
outs() << " STACK ";
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code change looks good to me (I note that EH_FRAME
is the same length and also includes no leading spaces in the string). I've got one test suggestion.
This fixes the misaligned display of addresses for this p_type.
1f7ad2e
to
9391923
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
If this is OK, can someone with commit access merge it on my behalf? Thanks. |
Done. Please keep an eye out for relevant build-bot failures. |
…21591) This fixes the misaligned display of addresses for this p_type. Previous: ``` STACK off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**64 filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw- PROPERTY off 0x0000000000000358 vaddr 0x0000000000000358 paddr 0x0000000000000358 align 2**3 filesz 0x0000000000000020 memsz 0x0000000000000020 flags r-- NOTE off 0x0000000000000334 vaddr 0x0000000000000334 paddr 0x0000000000000334 align 2**2 filesz 0x0000000000000020 memsz 0x0000000000000020 flags r-- ``` After: ``` STACK off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**64 filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw- PROPERTY off 0x0000000000000358 vaddr 0x0000000000000358 paddr 0x0000000000000358 align 2**3 filesz 0x0000000000000020 memsz 0x0000000000000020 flags r-- NOTE off 0x0000000000000334 vaddr 0x0000000000000334 paddr 0x0000000000000334 align 2**2 filesz 0x0000000000000020 memsz 0x0000000000000020 flags r-- ```
This fixes the misaligned display of addresses for this p_type.
Previous:
After: