Skip to content

Commit 24f8bc5

Browse files
authored
Revert "[llvm-readobj][AArch64][ELF][PAC] Support ELF AUTH constants" (#74816)
Reverts #72713 Buildbot tests fail on clang-armv7-global-isel builder https://lab.llvm.org/buildbot/#/builders/186/builds/13604
1 parent c340cf0 commit 24f8bc5

File tree

11 files changed

+26
-302
lines changed

11 files changed

+26
-302
lines changed

Diff for: llvm/include/llvm/BinaryFormat/DynamicTags.def

-6
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,6 @@ AARCH64_DYNAMIC_TAG(AARCH64_MEMTAG_STACK, 0x7000000c)
132132
AARCH64_DYNAMIC_TAG(AARCH64_MEMTAG_GLOBALS, 0x7000000d)
133133
AARCH64_DYNAMIC_TAG(AARCH64_MEMTAG_GLOBALSSZ, 0x7000000f)
134134

135-
// AArch64 specific dynamic table entries for RELR auth relocations as described here:
136-
// https://github.com/ARM-software/abi-aa/blob/main/pauthabielf64/pauthabielf64.rst#dynamic-section
137-
AARCH64_DYNAMIC_TAG(AARCH64_AUTH_RELRSZ, 0x70000011)
138-
AARCH64_DYNAMIC_TAG(AARCH64_AUTH_RELR, 0x70000012)
139-
AARCH64_DYNAMIC_TAG(AARCH64_AUTH_RELRENT, 0x70000013)
140-
141135
// Hexagon specific dynamic table entries
142136
HEXAGON_DYNAMIC_TAG(HEXAGON_SYMSZ, 0x70000000)
143137
HEXAGON_DYNAMIC_TAG(HEXAGON_VER, 0x70000001)

Diff for: llvm/include/llvm/BinaryFormat/ELF.h

-8
Original file line numberDiff line numberDiff line change
@@ -1060,9 +1060,6 @@ enum : unsigned {
10601060
SHT_ARM_ATTRIBUTES = 0x70000003U,
10611061
SHT_ARM_DEBUGOVERLAY = 0x70000004U,
10621062
SHT_ARM_OVERLAYSECTION = 0x70000005U,
1063-
// Special aarch64-specific section for MTE support, as described in:
1064-
// https://github.com/ARM-software/abi-aa/blob/main/pauthabielf64/pauthabielf64.rst#section-types
1065-
SHT_AARCH64_AUTH_RELR = 0x70000004U,
10661063
// Special aarch64-specific sections for MTE support, as described in:
10671064
// https://github.com/ARM-software/abi-aa/blob/main/memtagabielf64/memtagabielf64.rst#7section-types
10681065
SHT_AARCH64_MEMTAG_GLOBALS_STATIC = 0x70000007U,
@@ -1650,11 +1647,6 @@ enum {
16501647
NT_ANDROID_TYPE_MEMTAG = 4,
16511648
};
16521649

1653-
// ARM note types.
1654-
enum {
1655-
NT_ARM_TYPE_PAUTH_ABI_TAG = 1,
1656-
};
1657-
16581650
// Memory tagging values used in NT_ANDROID_TYPE_MEMTAG notes.
16591651
enum {
16601652
// Enumeration to determine the tagging mode. In Android-land, 'SYNC' means

Diff for: llvm/include/llvm/BinaryFormat/ELFRelocs/AArch64.def

-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ ELF_RELOC(R_AARCH64_TLS_TPREL64, 0x406)
135135
ELF_RELOC(R_AARCH64_TLSDESC, 0x407)
136136
ELF_RELOC(R_AARCH64_IRELATIVE, 0x408)
137137
ELF_RELOC(R_AARCH64_AUTH_ABS64, 0xe100)
138-
ELF_RELOC(R_AARCH64_AUTH_RELATIVE, 0xe200)
139138

140139
// ELF_RELOC(R_AARCH64_P32_NONE, 0)
141140
ELF_RELOC(R_AARCH64_P32_ABS32, 0x001)

Diff for: llvm/lib/Object/ELF.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ StringRef llvm::object::getELFSectionTypeName(uint32_t Machine, unsigned Type) {
273273
break;
274274
case ELF::EM_AARCH64:
275275
switch (Type) {
276-
STRINGIFY_ENUM_CASE(ELF, SHT_AARCH64_AUTH_RELR);
277276
STRINGIFY_ENUM_CASE(ELF, SHT_AARCH64_MEMTAG_GLOBALS_DYNAMIC);
278277
STRINGIFY_ENUM_CASE(ELF, SHT_AARCH64_MEMTAG_GLOBALS_STATIC);
279278
}

Diff for: llvm/lib/ObjectYAML/ELFYAML.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,6 @@ void ScalarEnumerationTraits<ELFYAML::ELF_SHT>::enumeration(
719719
ECase(SHT_MSP430_ATTRIBUTES);
720720
break;
721721
case ELF::EM_AARCH64:
722-
ECase(SHT_AARCH64_AUTH_RELR);
723722
ECase(SHT_AARCH64_MEMTAG_GLOBALS_STATIC);
724723
ECase(SHT_AARCH64_MEMTAG_GLOBALS_DYNAMIC);
725724
break;

Diff for: llvm/test/tools/llvm-readobj/ELF/AArch64/aarch64-feature-pauth.s

-98
This file was deleted.

Diff for: llvm/test/tools/llvm-readobj/ELF/broken-dynamic-reloc.test

-40
Original file line numberDiff line numberDiff line change
@@ -459,43 +459,3 @@ ProgramHeaders:
459459
- Type: PT_DYNAMIC
460460
FirstSec: .dynamic
461461
LastSec: .dynamic
462-
463-
## Show we print a warning for an invalid relocation table size stored in a DT_AARCH64_AUTH_RELRSZ entry.
464-
# RUN: yaml2obj --docnum=8 -DRELTYPE=RELR -DTAG1=DT_AARCH64_AUTH_RELRSZ -DTAG1VAL=0xFF -DTAG2=DT_AARCH64_AUTH_RELRENT %s -o %t14
465-
# RUN: llvm-readobj --dyn-relocations %t14 2>&1 | FileCheck %s -DFILE=%t14 --check-prefix=INVALID-DT-AARCH64-AUTH-RELRSZ
466-
# RUN: llvm-readelf --dyn-relocations %t14 2>&1 | FileCheck %s -DFILE=%t14 --check-prefix=INVALID-DT-AARCH64-AUTH-RELRSZ
467-
468-
# INVALID-DT-AARCH64-AUTH-RELRSZ: warning: '[[FILE]]': invalid DT_AARCH64_AUTH_RELRSZ value (0xff) or DT_AARCH64_AUTH_RELRENT value (0x18)
469-
470-
## Show we print a warning for an invalid relocation table entry size stored in a DT_AARCH64_AUTH_RELRENT entry.
471-
# RUN: yaml2obj --docnum=8 -DRELTYPE=RELR -DTAG1=DT_AARCH64_AUTH_RELRSZ -DTAG2=DT_AARCH64_AUTH_RELRENT -DTAG2VAL=0xFF %s -o %t15
472-
# RUN: llvm-readobj --dyn-relocations %t15 2>&1 | FileCheck %s -DFILE=%t15 --check-prefix=INVALID-DT-AARCH64-AUTH-RELRENT
473-
# RUN: llvm-readelf --dyn-relocations %t15 2>&1 | FileCheck %s -DFILE=%t15 --check-prefix=INVALID-DT-AARCH64-AUTH-RELRENT
474-
475-
# INVALID-DT-AARCH64-AUTH-RELRENT: invalid DT_AARCH64_AUTH_RELRSZ value (0x18) or DT_AARCH64_AUTH_RELRENT value (0xff)
476-
477-
--- !ELF
478-
FileHeader:
479-
Class: ELFCLASS64
480-
Data: ELFDATA2LSB
481-
Type: ET_DYN
482-
Machine: EM_AARCH64
483-
Sections:
484-
- Name: .relx.dyn
485-
Type: SHT_[[RELTYPE]]
486-
- Name: .dynamic
487-
Type: SHT_DYNAMIC
488-
Entries:
489-
- Tag: DT_[[RELTYPE]]
490-
Value: 0x0
491-
- Tag: [[TAG1]]
492-
Value: [[TAG1VAL=0x18]]
493-
- Tag: [[TAG2]]
494-
Value: [[TAG2VAL=0x18]]
495-
- Tag: DT_NULL
496-
Value: 0x0
497-
DynamicSymbols: []
498-
ProgramHeaders:
499-
- Type: PT_LOAD
500-
FirstSec: .relx.dyn
501-
LastSec: .dynamic

Diff for: llvm/test/tools/llvm-readobj/ELF/dynamic-tags-machine-specific.test

+10-22
Original file line numberDiff line numberDiff line change
@@ -355,26 +355,20 @@ ProgramHeaders:
355355
# RUN: llvm-readobj --dynamic-table %t.aarch64 | FileCheck %s --check-prefix=LLVM-AARCH64
356356
# RUN: llvm-readelf --dynamic-table %t.aarch64 | FileCheck %s --check-prefix=GNU-AARCH64
357357

358-
# LLVM-AARCH64: DynamicSection [ (7 entries)
358+
# LLVM-AARCH64: DynamicSection [ (4 entries)
359359
# LLVM-AARCH64-NEXT: Tag Type Name/Value
360-
# LLVM-AARCH64-NEXT: 0x0000000070000001 AARCH64_BTI_PLT 1
361-
# LLVM-AARCH64-NEXT: 0x0000000070000003 AARCH64_PAC_PLT 2
362-
# LLVM-AARCH64-NEXT: 0x0000000070000005 AARCH64_VARIANT_PCS 3
363-
# LLVM-AARCH64-NEXT: 0x0000000070000012 AARCH64_AUTH_RELR 0x4
364-
# LLVM-AARCH64-NEXT: 0x0000000070000011 AARCH64_AUTH_RELRSZ 5
365-
# LLVM-AARCH64-NEXT: 0x0000000070000013 AARCH64_AUTH_RELRENT 6
366-
# LLVM-AARCH64-NEXT: 0x0000000000000000 NULL 0x0
360+
# LLVM-AARCH64-NEXT: 0x0000000070000001 AARCH64_BTI_PLT 1
361+
# LLVM-AARCH64-NEXT: 0x0000000070000003 AARCH64_PAC_PLT 2
362+
# LLVM-AARCH64-NEXT: 0x0000000070000005 AARCH64_VARIANT_PCS 3
363+
# LLVM-AARCH64-NEXT: 0x0000000000000000 NULL 0x0
367364
# LLVM-AARCH64-NEXT:]
368365

369-
# GNU-AARCH64: Dynamic section at offset {{.*}} contains 7 entries:
366+
# GNU-AARCH64: Dynamic section at offset {{.*}} contains 4 entries:
370367
# GNU-AARCH64-NEXT: Tag Type Name/Value
371-
# GNU-AARCH64-NEXT: 0x0000000070000001 (AARCH64_BTI_PLT) 1
372-
# GNU-AARCH64-NEXT: 0x0000000070000003 (AARCH64_PAC_PLT) 2
373-
# GNU-AARCH64-NEXT: 0x0000000070000005 (AARCH64_VARIANT_PCS) 3
374-
# GNU-AARCH64-NEXT: 0x0000000070000012 (AARCH64_AUTH_RELR) 0x4
375-
# GNU-AARCH64-NEXT: 0x0000000070000011 (AARCH64_AUTH_RELRSZ) 5
376-
# GNU-AARCH64-NEXT: 0x0000000070000013 (AARCH64_AUTH_RELRENT) 6
377-
# GNU-AARCH64-NEXT: 0x0000000000000000 (NULL) 0x0
368+
# GNU-AARCH64-NEXT: 0x0000000070000001 (AARCH64_BTI_PLT) 1
369+
# GNU-AARCH64-NEXT: 0x0000000070000003 (AARCH64_PAC_PLT) 2
370+
# GNU-AARCH64-NEXT: 0x0000000070000005 (AARCH64_VARIANT_PCS) 3
371+
# GNU-AARCH64-NEXT: 0x0000000000000000 (NULL) 0x0
378372

379373
--- !ELF
380374
FileHeader:
@@ -392,12 +386,6 @@ Sections:
392386
Value: 2
393387
- Tag: DT_AARCH64_VARIANT_PCS
394388
Value: 3
395-
- Tag: DT_AARCH64_AUTH_RELR
396-
Value: 4
397-
- Tag: DT_AARCH64_AUTH_RELRSZ
398-
Value: 5
399-
- Tag: DT_AARCH64_AUTH_RELRENT
400-
Value: 6
401389
- Tag: DT_NULL
402390
Value: 0
403391
ProgramHeaders:

Diff for: llvm/test/tools/llvm-readobj/ELF/machine-specific-section-types.test

-5
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,11 @@
5353
# MIPS-GNU: abiflags MIPS_ABIFLAGS
5454
# MIPS-GNU: dwarf MIPS_DWARF
5555

56-
# AARCH64-LLVM: Name: aarch64_auth_relr
57-
# AARCH64-LLVM: Type: SHT_AARCH64_AUTH_RELR
5856
# AARCH64-LLVM: Name: .memtag.globals.dynamic
5957
# AARCH64-LLVM: Type: SHT_AARCH64_MEMTAG_GLOBALS_DYNAMIC
6058
# AARCH64-LLVM: Name: .memtag.globals.static
6159
# AARCH64-LLVM: Type: SHT_AARCH64_MEMTAG_GLOBALS_STATIC
6260

63-
# AARCH64-GNU: aarch64_auth_relr AARCH64_AUTH_RELR
6461
# AARCH64-GNU: .memtag.globals.dynamic AARCH64_MEMTAG_GLOBALS_DYNAMIC
6562
# AARCH64-GNU: .memtag.globals.static AARCH64_MEMTAG_GLOBALS_STATIC
6663

@@ -116,8 +113,6 @@ FileHeader:
116113
Type: ET_REL
117114
Machine: EM_AARCH64
118115
Sections:
119-
- Name: aarch64_auth_relr
120-
Type: SHT_AARCH64_AUTH_RELR
121116
- Name: .memtag.globals.dynamic
122117
Type: SHT_AARCH64_MEMTAG_GLOBALS_DYNAMIC
123118
- Name: .memtag.globals.static

Diff for: llvm/test/tools/llvm-readobj/ELF/relr-relocs.test

+2-15
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Sections:
158158
Link: [[LINK=<none>]]
159159

160160
## Check we report a warning when we are unable to dump relocations
161-
## for a SHT_RELR/SHT_ANDROID_RELR/SHT_AARCH64_AUTH_RELR section.
161+
## for a SHT_RELR/SHT_ANDROID_RELR section.
162162

163163
## Case A: check the case when relocations can't be read from an SHT_RELR section.
164164
# RUN: yaml2obj --docnum=2 -DENTSIZE=1 %s -o %t2.broken
@@ -186,20 +186,7 @@ Sections:
186186
# RUN: llvm-readelf --relocations %t2.broken.android 2>&1 | \
187187
# RUN: FileCheck -DFILE=%t2.broken.android --check-prefix=BROKEN-GNU %s -DSECNAME=SHT_ANDROID_RELR
188188

189-
## Case C: check the case when we have an SHT_AARCH64_AUTH_RELR section in non-AArch64 ELF.
190-
## SHT_AARCH64_AUTH_RELR = 0x70000004.
191-
# RUN: yaml2obj --docnum=2 -DENTSIZE=1 -DSHTYPE=0x70000004 %s -o %t2.broken.aarch64auth
192-
# RUN: llvm-readobj --relocations %t2.broken.aarch64auth 2>&1 | \
193-
# RUN: FileCheck -DFILE=%t2.broken.aarch64auth --check-prefix=WRONGARCH-LLVM-AARCH64-AUTH %s -DSECNAME=SHT_AARCH64_AUTH_RELR
194-
# RUN: llvm-readelf --relocations %t2.broken.aarch64auth 2>&1 | \
195-
# RUN: FileCheck -DFILE=%t2.broken.aarch64auth --check-prefix=WRONGARCH-GNU-AARCH64-AUTH %s -DSECNAME=SHT_AARCH64_AUTH_RELR
196-
197-
# WRONGARCH-LLVM-AARCH64-AUTH: Relocations [
198-
# WRONGARCH-LLVM-AARCH64-AUTH-NEXT: ]
199-
200-
# WRONGARCH-GNU-AARCH64-AUTH-NOT: Relocation section
201-
202-
## Check the behavior when the sh_link field of the SHT_RELR/SHT_ANDROID_RELR/SHT_AARCH64_AUTH_RELR section
189+
## Check the behavior when the sh_link field of the SHT_RELR/SHT_ANDROID_RELR section
203190
## is set to an arbitrary value. Normally, it is set to 0, because such sections contains
204191
## only relative relocations and do not have an associated symbol table, like other
205192
## relocation sections.

0 commit comments

Comments
 (0)