Skip to content

Commit 810e38d

Browse files
committed
Bugfix in llvm-readelf Key to Flags output
1 parent 835a800 commit 810e38d

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

llvm/test/tools/llvm-readobj/ELF/gnu-sections.test

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -99,26 +99,16 @@ Symbols:
9999
# ELF64-NEXT: C (compressed), x (unknown), o (OS specific), E (exclude),
100100
# ELF64-NEXT: R (retain), l (large), p (processor specific)
101101

102-
## For an EM_ARM target we print "y" for the SHF_ARM_PURECODE section flag.
102+
## For an EM_ARM or EM_AARCH64 target we print "y" for the PURECODE section flag.
103103
## Check we mention it in the flag key.
104104

105105
# RUN: yaml2obj -DMACHINE=EM_ARM %s -o %t-arm.o
106-
# RUN: llvm-readelf -S %t-arm.o | FileCheck %s --check-prefix=ARM --strict-whitespace --match-full-lines
107-
108-
# ARM:Key to Flags:
109-
# ARM-NEXT: W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
110-
# ARM-NEXT: L (link order), O (extra OS processing required), G (group), T (TLS),
111-
# ARM-NEXT: C (compressed), x (unknown), o (OS specific), E (exclude),
112-
# ARM-NEXT: R (retain), y (purecode), p (processor specific)
113-
114-
## For an EM_AARCH64 target we print "y" for the SHF_AARCH64_PURECODE section flag.
115-
## Check we mention it in the flag key.
116-
106+
# RUN: llvm-readelf -S %t-arm.o | FileCheck %s --check-prefix=PURECODE --strict-whitespace --match-full-lines
117107
# RUN: yaml2obj -DMACHINE=EM_AARCH64 %s -o %t-aarch64.o
118-
# RUN: llvm-readelf -S %t-arm.o | FileCheck %s --check-prefix=AARCH64 --strict-whitespace --match-full-lines
108+
# RUN: llvm-readelf -S %t-aarch64.o | FileCheck %s --check-prefix=PURECODE --strict-whitespace --match-full-lines
119109

120-
# AARCH64:Key to Flags:
121-
# AARCH64-NEXT: W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
122-
# AARCH64-NEXT: L (link order), O (extra OS processing required), G (group), T (TLS),
123-
# AARCH64-NEXT: C (compressed), x (unknown), o (OS specific), E (exclude),
124-
# AARCH64-NEXT: R (retain), y (purecode), p (processor specific)
110+
# PURECODE:Key to Flags:
111+
# PURECODE-NEXT: W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
112+
# PURECODE-NEXT: L (link order), O (extra OS processing required), G (group), T (TLS),
113+
# PURECODE-NEXT: C (compressed), x (unknown), o (OS specific), E (exclude),
114+
# PURECODE-NEXT: R (retain), y (purecode), p (processor specific)

llvm/tools/llvm-readobj/ELFDumper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4112,7 +4112,7 @@ static void printSectionDescription(formatted_raw_ostream &OS,
41124112

41134113
if (EMachine == EM_X86_64)
41144114
OS << ", l (large)";
4115-
else if (EMachine == EM_ARM)
4115+
else if (EMachine == EM_ARM || EMachine == EM_AARCH64)
41164116
OS << ", y (purecode)";
41174117

41184118
OS << ", p (processor specific)\n";

0 commit comments

Comments
 (0)