[llvm] [llvm-objdump] Remove leading whitespace for PT_GNU_PROPERTY. (PR #121591)

Ryan Mansfield via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 9 06:36:47 PST 2025


https://github.com/rjmansfield updated https://github.com/llvm/llvm-project/pull/121591

>From 9391923aa3c629e0cdab59950166ba6a19cf478c Mon Sep 17 00:00:00 2001
From: Ryan Mansfield <ryan_mansfield at apple.com>
Date: Fri, 3 Jan 2025 12:56:07 -0500
Subject: [PATCH] [llvm-objdump] Remove leading whitespace for PT_GNU_PROPERTY.

This fixes the misaligned display of addresses for this p_type.
---
 llvm/test/tools/llvm-objdump/ELF/pt-gnu-property.test | 2 +-
 llvm/tools/llvm-objdump/ELFDump.cpp                   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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..27f1252b3d5d19 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 ";



More information about the llvm-commits mailing list