llvm.org GIT mirror llvm / b99b8ff
Emit the build attribute Tag_conformance. Claim conformance to version 2.09 of the ARM ABI. This build attribute must be emitted first amongst the build attributes when written to an object file. This is to simplify conformance detection by consumers. Change-Id: If9eddcfc416bc9ad6e5cc8cdcb05d0031af7657e git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225166 91177308-0d34-0410-b5e6-96231b3b80d8 Charlie Turner 5 years ago
6 changed file(s) with 40 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
628628 MCTargetStreamer &TS = *OutStreamer.getTargetStreamer();
629629 ARMTargetStreamer &ATS = static_cast(TS);
630630
631 ATS.emitTextAttribute(ARMBuildAttrs::conformance, "2.09");
632
631633 ATS.switchVendor("aeabi");
632634
633635 std::string CPUString = Subtarget->getCPUString();
299299 StringRef StringValue;
300300
301301 static bool LessTag(const AttributeItem &LHS, const AttributeItem &RHS) {
302 return (LHS.Tag < RHS.Tag);
302 // The conformance tag must be emitted first when serialised
303 // into an object file. Specifically, the addenda to the ARM ABI
304 // states that (2.3.7.4):
305 //
306 // "To simplify recognition by consumers in the common case of
307 // claiming conformity for the whole file, this tag should be
308 // emitted first in a file-scope sub-subsection of the first
309 // public subsection of the attributes section."
310 //
311 // So it is special-cased in this comparison predicate when the
312 // attributes are sorted in finishAttributeSection().
313 return (RHS.Tag != ARMBuildAttrs::conformance) &&
314 ((LHS.Tag == ARMBuildAttrs::conformance) || (LHS.Tag < RHS.Tag));
303315 }
304316 };
305317
278278 ; V7-FAST: .eabi_attribute 23, 1
279279
280280 ; V8: .syntax unified
281 ; V8: .eabi_attribute 67, "2.09"
281282 ; V8: .eabi_attribute 6, 14
282283 ; V8-NOT: .eabi_attribute 19
283284 ; V8: .eabi_attribute 20, 1
44 .syntax unified
55 .thumb
66
7 .eabi_attribute Tag_conformance, "2.09"
8 @ CHECK: .eabi_attribute 67, "2.09"
9 @ Tag_conformance should be be emitted first in a file-scope
10 @ sub-subsection of the first public subsection of the attributes
11 @ section. 2.3.7.4 of ABI Addenda.
12 @ CHECK-OBJ: Tag: 67
13 @ CHECK-OBJ-NEXT: TagName: conformance
14 @ CHECK-OBJ-NEXT: Value: 2.09
715 .eabi_attribute Tag_CPU_raw_name, "Cortex-A9"
816 @ CHECK: .eabi_attribute 4, "Cortex-A9"
917 @ CHECK-OBJ: Tag: 4
219227 @ CHECK-OBJ-NEXT: Value: 0
220228 @ CHECK-OBJ-NEXT: TagName: T2EE_use
221229 @ CHECK-OBJ-NEXT: Description: Not Permitted
222 .eabi_attribute Tag_conformance, "2.09"
223 @ CHECK: .eabi_attribute 67, "2.09"
224 @ CHECK-OBJ: Tag: 67
225 @ CHECK-OBJ-NEXT: TagName: conformance
226 @ CHECK-OBJ-NEXT: Value: 2.09
227230 .eabi_attribute Tag_Virtualization_use, 0
228231 @ CHECK: .eabi_attribute 68, 0
229232 @ CHECK-OBJ: Tag: 68
0 @ RUN: llvm-mc -triple armv7-elf -filetype asm -o - %s | FileCheck %s
1 @ RUN: llvm-mc -triple armv7-eabi -filetype obj -o - %s \
2 @ RUN: | llvm-readobj -arm-attributes - | FileCheck %s --check-prefix=CHECK-OBJ
3 .eabi_attribute Tag_conformance, "0"
4 @CHECK: .eabi_attribute 67, "0"
5 @CHECK-OBJ: Tag: 67
6 @CHECK-OBJ-NEXT: TagName: conformance
7 @CHECK-OBJ-NEXT: Value: 0
0 @ RUN: llvm-mc -triple armv7-elf -filetype asm -o - %s | FileCheck %s
1 @ RUN: llvm-mc -triple armv7-eabi -filetype obj -o - %s \
2 @ RUN: | llvm-readobj -arm-attributes - | FileCheck %s --check-prefix=CHECK-OBJ
3 .eabi_attribute Tag_conformance, "A.long--non numeric oddity...!!"
4 @CHECK: .eabi_attribute 67, "A.long--non numeric oddity...!!"
5 @CHECK-OBJ: Tag: 67
6 @CHECK-OBJ-NEXT: TagName: conformance
7 @CHECK-OBJ-NEXT: Value: A.long--non numeric oddity...!!