Skip to content

Commit d293a35

Browse files
[AArch64][ELF][llvm-readobj] Support the GCS .note.gnu.property bit (#75065)
This bit was added to the AArch64 ABI by ARM-software/abi-aa#231.
1 parent effd47e commit d293a35

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

llvm/include/llvm/BinaryFormat/ELF.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,6 +1693,7 @@ enum : unsigned {
16931693
enum : unsigned {
16941694
GNU_PROPERTY_AARCH64_FEATURE_1_BTI = 1 << 0,
16951695
GNU_PROPERTY_AARCH64_FEATURE_1_PAC = 1 << 1,
1696+
GNU_PROPERTY_AARCH64_FEATURE_1_GCS = 1 << 2,
16961697
};
16971698

16981699
// x86 processor feature bits.

llvm/test/tools/llvm-readobj/ELF/AArch64/aarch64-note-gnu-property.s

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// GNU: Displaying notes found in: .note.gnu.property
66
// GNU-NEXT: Owner Data size Description
77
// GNU-NEXT: GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 (property note)
8-
// GNU-NEXT: Properties: aarch64 feature: BTI, PAC
8+
// GNU-NEXT: Properties: aarch64 feature: BTI, PAC, GCS
99

1010
// LLVM: Notes [
1111
// LLVM-NEXT: NoteSection {
@@ -17,7 +17,7 @@
1717
// LLVM-NEXT: Data size: 0x10
1818
// LLVM-NEXT: Type: NT_GNU_PROPERTY_TYPE_0 (property note)
1919
// LLVM-NEXT: Property [
20-
// LLVM-NEXT: aarch64 feature: BTI, PAC
20+
// LLVM-NEXT: aarch64 feature: BTI, PAC, GCS
2121
// LLVM-NEXT: ]
2222
// LLVM-NEXT: }
2323
// LLVM-NEXT: }
@@ -30,9 +30,9 @@
3030
.asciz "GNU" /* Name */
3131
.p2align 3
3232
begin:
33-
/* BTI and PAC property note */
33+
/* BTI, PAC, and GCS property note */
3434
.long 0xc0000000 /* Type: GNU_PROPERTY_AARCH64_FEATURE_1_AND */
3535
.long 4 /* Data size */
36-
.long 3 /* BTI and PAC */
36+
.long 7 /* BTI, PAC, GCS */
3737
.p2align 3 /* Align to 8 byte for 64 bit */
3838
end:

llvm/tools/llvm-readobj/ELFDumper.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5129,6 +5129,7 @@ static std::string getGNUProperty(uint32_t Type, uint32_t DataSize,
51295129
if (Type == GNU_PROPERTY_AARCH64_FEATURE_1_AND) {
51305130
DumpBit(GNU_PROPERTY_AARCH64_FEATURE_1_BTI, "BTI");
51315131
DumpBit(GNU_PROPERTY_AARCH64_FEATURE_1_PAC, "PAC");
5132+
DumpBit(GNU_PROPERTY_AARCH64_FEATURE_1_GCS, "GCS");
51325133
} else {
51335134
DumpBit(GNU_PROPERTY_X86_FEATURE_1_IBT, "IBT");
51345135
DumpBit(GNU_PROPERTY_X86_FEATURE_1_SHSTK, "SHSTK");

0 commit comments

Comments
 (0)