[AArch64][Build Attributes] Improve Parsing and Formatting (#126530)
- Removed assertion for duplicate values as adding them is valid. - Fix parsing: reject strings for unknown tags, allow any value for Tag_PAuth_Platform and Tag_PAuth_Schema. - Print tags by using numbers with comments to reduce compiler-assembler dependencies. - Parsing error messages now only point to the symbol (^) instead of printing it.
This commit is contained in:
parent
a4656bbc59
commit
b36a18df96
@ -485,10 +485,10 @@ void AArch64AsmPrinter::emitAttributes(unsigned Flags,
|
||||
AArch64BuildAttrs::SubsectionType::ULEB128);
|
||||
TS->emitAttribute(
|
||||
AArch64BuildAttrs::getVendorName(AArch64BuildAttrs::AEABI_PAUTHABI),
|
||||
AArch64BuildAttrs::TAG_PAUTH_PLATFORM, PAuthABIPlatform, "", false);
|
||||
AArch64BuildAttrs::TAG_PAUTH_PLATFORM, PAuthABIPlatform, "");
|
||||
TS->emitAttribute(
|
||||
AArch64BuildAttrs::getVendorName(AArch64BuildAttrs::AEABI_PAUTHABI),
|
||||
AArch64BuildAttrs::TAG_PAUTH_SCHEMA, PAuthABIVersion, "", false);
|
||||
AArch64BuildAttrs::TAG_PAUTH_SCHEMA, PAuthABIVersion, "");
|
||||
}
|
||||
|
||||
unsigned BTIValue = (Flags & AArch64BuildAttrs::Feature_BTI_Flag) ? 1 : 0;
|
||||
@ -502,13 +502,13 @@ void AArch64AsmPrinter::emitAttributes(unsigned Flags,
|
||||
AArch64BuildAttrs::SubsectionType::ULEB128);
|
||||
TS->emitAttribute(AArch64BuildAttrs::getVendorName(
|
||||
AArch64BuildAttrs::AEABI_FEATURE_AND_BITS),
|
||||
AArch64BuildAttrs::TAG_FEATURE_BTI, BTIValue, "", false);
|
||||
AArch64BuildAttrs::TAG_FEATURE_BTI, BTIValue, "");
|
||||
TS->emitAttribute(AArch64BuildAttrs::getVendorName(
|
||||
AArch64BuildAttrs::AEABI_FEATURE_AND_BITS),
|
||||
AArch64BuildAttrs::TAG_FEATURE_PAC, PACValue, "", false);
|
||||
AArch64BuildAttrs::TAG_FEATURE_PAC, PACValue, "");
|
||||
TS->emitAttribute(AArch64BuildAttrs::getVendorName(
|
||||
AArch64BuildAttrs::AEABI_FEATURE_AND_BITS),
|
||||
AArch64BuildAttrs::TAG_FEATURE_GCS, GCSValue, "", false);
|
||||
AArch64BuildAttrs::TAG_FEATURE_GCS, GCSValue, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7874,8 +7874,7 @@ bool AArch64AsmParser::parseDirectiveAeabiSubSectionHeader(SMLoc L) {
|
||||
IsOptional = AArch64BuildAttrs::getOptionalID(Optionality);
|
||||
if (AArch64BuildAttrs::OPTIONAL_NOT_FOUND == IsOptional) {
|
||||
Error(Parser.getTok().getLoc(),
|
||||
AArch64BuildAttrs::getSubsectionOptionalUnknownError() + ": " +
|
||||
Optionality);
|
||||
AArch64BuildAttrs::getSubsectionOptionalUnknownError());
|
||||
return true;
|
||||
}
|
||||
if (SubsectionExists) {
|
||||
@ -7923,7 +7922,7 @@ bool AArch64AsmParser::parseDirectiveAeabiSubSectionHeader(SMLoc L) {
|
||||
Type = AArch64BuildAttrs::getTypeID(Name);
|
||||
if (AArch64BuildAttrs::TYPE_NOT_FOUND == Type) {
|
||||
Error(Parser.getTok().getLoc(),
|
||||
AArch64BuildAttrs::getSubsectionTypeUnknownError() + ": " + Name);
|
||||
AArch64BuildAttrs::getSubsectionTypeUnknownError());
|
||||
return true;
|
||||
}
|
||||
if (SubsectionExists) {
|
||||
@ -7952,6 +7951,7 @@ bool AArch64AsmParser::parseDirectiveAeabiSubSectionHeader(SMLoc L) {
|
||||
}
|
||||
}
|
||||
Parser.Lex();
|
||||
|
||||
// Parsing finished, check for trailing tokens.
|
||||
if (Parser.getTok().isNot(llvm::AsmToken::EndOfStatement)) {
|
||||
Error(Parser.getTok().getLoc(), "unexpected token for AArch64 build "
|
||||
@ -7990,14 +7990,18 @@ bool AArch64AsmParser::parseDirectiveAeabiAArch64Attr(SMLoc L) {
|
||||
|
||||
StringRef TagStr = "";
|
||||
unsigned Tag;
|
||||
if (Parser.getTok().is(AsmToken::Identifier)) {
|
||||
if (Parser.getTok().is(AsmToken::Integer)) {
|
||||
Tag = getTok().getIntVal();
|
||||
} else if (Parser.getTok().is(AsmToken::Identifier)) {
|
||||
TagStr = Parser.getTok().getIdentifier();
|
||||
switch (ActiveSubsectionID) {
|
||||
default:
|
||||
assert(0 && "Subsection name error");
|
||||
break;
|
||||
case AArch64BuildAttrs::VENDOR_UNKNOWN:
|
||||
// Private subsection, accept any tag.
|
||||
// Tag was provided as an unrecognized string instead of an unsigned
|
||||
// integer
|
||||
Error(Parser.getTok().getLoc(), "unrecognized Tag: '" + TagStr +
|
||||
"' \nExcept for public subsections, "
|
||||
"tags have to be an unsigned int.");
|
||||
return true;
|
||||
break;
|
||||
case AArch64BuildAttrs::AEABI_PAUTHABI:
|
||||
Tag = AArch64BuildAttrs::getPauthABITagsID(TagStr);
|
||||
@ -8018,8 +8022,6 @@ bool AArch64AsmParser::parseDirectiveAeabiAArch64Attr(SMLoc L) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else if (Parser.getTok().is(AsmToken::Integer)) {
|
||||
Tag = getTok().getIntVal();
|
||||
} else {
|
||||
Error(Parser.getTok().getLoc(), "AArch64 build attributes tag not found");
|
||||
return true;
|
||||
@ -8063,10 +8065,9 @@ bool AArch64AsmParser::parseDirectiveAeabiAArch64Attr(SMLoc L) {
|
||||
Error(Parser.getTok().getLoc(), "AArch64 build attributes value not found");
|
||||
return true;
|
||||
}
|
||||
// Check for possible unaccepted values for known tags (AEABI_PAUTHABI,
|
||||
// AEABI_FEATURE_AND_BITS)
|
||||
if (!(ActiveSubsectionID == AArch64BuildAttrs::VENDOR_UNKNOWN) &&
|
||||
TagStr != "") { // TagStr was a recognized string
|
||||
// Check for possible unaccepted values for known tags
|
||||
// (AEABI_FEATURE_AND_BITS)
|
||||
if (ActiveSubsectionID == AArch64BuildAttrs::AEABI_FEATURE_AND_BITS) {
|
||||
if (0 != ValueInt && 1 != ValueInt) {
|
||||
Error(Parser.getTok().getLoc(),
|
||||
"unknown AArch64 build attributes Value for Tag '" + TagStr +
|
||||
@ -8075,7 +8076,8 @@ bool AArch64AsmParser::parseDirectiveAeabiAArch64Attr(SMLoc L) {
|
||||
}
|
||||
}
|
||||
Parser.Lex();
|
||||
// Parsing finished, check for trailing tokens.
|
||||
|
||||
// Parsing finished. Check for trailing tokens.
|
||||
if (Parser.getTok().isNot(llvm::AsmToken::EndOfStatement)) {
|
||||
Error(Parser.getTok().getLoc(),
|
||||
"unexpected token for AArch64 build attributes tag and value "
|
||||
@ -8084,13 +8086,11 @@ bool AArch64AsmParser::parseDirectiveAeabiAArch64Attr(SMLoc L) {
|
||||
}
|
||||
|
||||
if (unsigned(-1) != ValueInt) {
|
||||
getTargetStreamer().emitAttribute(ActiveSubsectionName, Tag, ValueInt, "",
|
||||
false);
|
||||
getTargetStreamer().emitAttribute(ActiveSubsectionName, Tag, ValueInt, "");
|
||||
}
|
||||
|
||||
if ("" != ValueStr) {
|
||||
getTargetStreamer().emitAttribute(ActiveSubsectionName, Tag, unsigned(-1),
|
||||
ValueStr, false);
|
||||
ValueStr);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ class AArch64TargetAsmStreamer : public AArch64TargetStreamer {
|
||||
}
|
||||
|
||||
void emitAttribute(StringRef VendorName, unsigned Tag, unsigned Value,
|
||||
std::string String, bool Override) override {
|
||||
std::string String) override {
|
||||
|
||||
// AArch64 build attributes for assembly attribute form:
|
||||
// .aeabi_attribute tag, value
|
||||
@ -164,19 +164,15 @@ class AArch64TargetAsmStreamer : public AArch64TargetStreamer {
|
||||
unsigned VendorID = AArch64BuildAttrs::getVendorID(VendorName);
|
||||
|
||||
switch (VendorID) {
|
||||
default:
|
||||
assert(0 && "Subsection name error");
|
||||
break;
|
||||
case AArch64BuildAttrs::VENDOR_UNKNOWN:
|
||||
if (unsigned(-1) != Value) {
|
||||
OS << "\t.aeabi_attribute" << "\t" << Tag << ", " << Value;
|
||||
AArch64TargetStreamer::emitAttribute(VendorName, Tag, Value, "",
|
||||
Override);
|
||||
AArch64TargetStreamer::emitAttribute(VendorName, Tag, Value, "");
|
||||
}
|
||||
if ("" != String) {
|
||||
OS << "\t.aeabi_attribute" << "\t" << Tag << ", " << String;
|
||||
AArch64TargetStreamer::emitAttribute(VendorName, Tag, unsigned(-1),
|
||||
String, Override);
|
||||
String);
|
||||
}
|
||||
break;
|
||||
// Note: AEABI_FEATURE_AND_BITS takes only unsigned values
|
||||
@ -186,16 +182,14 @@ class AArch64TargetAsmStreamer : public AArch64TargetStreamer {
|
||||
OS << "\t.aeabi_attribute" << "\t" << Tag << ", " << Value;
|
||||
// Keep the data structure consistent with the case of ELF emission
|
||||
// (important for llvm-mc asm parsing)
|
||||
AArch64TargetStreamer::emitAttribute(VendorName, Tag, Value, "",
|
||||
Override);
|
||||
AArch64TargetStreamer::emitAttribute(VendorName, Tag, Value, "");
|
||||
break;
|
||||
case AArch64BuildAttrs::TAG_FEATURE_BTI:
|
||||
case AArch64BuildAttrs::TAG_FEATURE_GCS:
|
||||
case AArch64BuildAttrs::TAG_FEATURE_PAC:
|
||||
OS << "\t.aeabi_attribute" << "\t"
|
||||
<< AArch64BuildAttrs::getFeatureAndBitsTagsStr(Tag) << ", " << Value;
|
||||
AArch64TargetStreamer::emitAttribute(VendorName, Tag, Value, "",
|
||||
Override);
|
||||
OS << "\t.aeabi_attribute" << "\t" << Tag << ", " << Value << "\t// "
|
||||
<< AArch64BuildAttrs::getFeatureAndBitsTagsStr(Tag);
|
||||
AArch64TargetStreamer::emitAttribute(VendorName, Tag, Value, "");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@ -206,15 +200,13 @@ class AArch64TargetAsmStreamer : public AArch64TargetStreamer {
|
||||
OS << "\t.aeabi_attribute" << "\t" << Tag << ", " << Value;
|
||||
// Keep the data structure consistent with the case of ELF emission
|
||||
// (important for llvm-mc asm parsing)
|
||||
AArch64TargetStreamer::emitAttribute(VendorName, Tag, Value, "",
|
||||
Override);
|
||||
AArch64TargetStreamer::emitAttribute(VendorName, Tag, Value, "");
|
||||
break;
|
||||
case AArch64BuildAttrs::TAG_PAUTH_PLATFORM:
|
||||
case AArch64BuildAttrs::TAG_PAUTH_SCHEMA:
|
||||
OS << "\t.aeabi_attribute" << "\t"
|
||||
<< AArch64BuildAttrs::getPauthABITagsStr(Tag) << ", " << Value;
|
||||
AArch64TargetStreamer::emitAttribute(VendorName, Tag, Value, "",
|
||||
Override);
|
||||
OS << "\t.aeabi_attribute" << "\t" << Tag << ", " << Value << "\t// "
|
||||
<< AArch64BuildAttrs::getPauthABITagsStr(Tag);
|
||||
AArch64TargetStreamer::emitAttribute(VendorName, Tag, Value, "");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@ -241,8 +233,8 @@ class AArch64TargetAsmStreamer : public AArch64TargetStreamer {
|
||||
StringRef ParameterStr = getTypeStr(ParameterType);
|
||||
|
||||
switch (SubsectionID) {
|
||||
default: {
|
||||
// Treated as a private subsection
|
||||
case AArch64BuildAttrs::VENDOR_UNKNOWN: {
|
||||
// Private subsection
|
||||
break;
|
||||
}
|
||||
case AArch64BuildAttrs::AEABI_PAUTHABI: {
|
||||
@ -431,13 +423,12 @@ void AArch64TargetELFStreamer::emitAtributesSubsection(
|
||||
}
|
||||
|
||||
void AArch64TargetELFStreamer::emitAttribute(StringRef VendorName, unsigned Tag,
|
||||
unsigned Value, std::string String,
|
||||
bool Override) {
|
||||
unsigned Value,
|
||||
std::string String) {
|
||||
if (unsigned(-1) != Value)
|
||||
AArch64TargetStreamer::emitAttribute(VendorName, Tag, Value, "", Override);
|
||||
AArch64TargetStreamer::emitAttribute(VendorName, Tag, Value, "");
|
||||
if ("" != String)
|
||||
AArch64TargetStreamer::emitAttribute(VendorName, Tag, unsigned(-1), String,
|
||||
Override);
|
||||
AArch64TargetStreamer::emitAttribute(VendorName, Tag, unsigned(-1), String);
|
||||
}
|
||||
|
||||
void AArch64TargetELFStreamer::emitInst(uint32_t Inst) {
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "llvm/BinaryFormat/ELF.h"
|
||||
#include "llvm/MC/ConstantPools.h"
|
||||
#include "llvm/MC/MCContext.h"
|
||||
#include "llvm/MC/MCELFStreamer.h"
|
||||
#include "llvm/MC/MCSection.h"
|
||||
#include "llvm/MC/MCSectionELF.h"
|
||||
#include "llvm/MC/MCSubtargetInfo.h"
|
||||
@ -193,8 +194,7 @@ AArch64TargetStreamer::getAtributesSubsectionByName(StringRef Name) {
|
||||
}
|
||||
|
||||
void AArch64TargetStreamer::emitAttribute(StringRef VendorName, unsigned Tag,
|
||||
unsigned Value, std::string String,
|
||||
bool Override) {
|
||||
unsigned Value, std::string String) {
|
||||
|
||||
if (unsigned(-1) == Value && "" == String) {
|
||||
assert(0 && "Arguments error");
|
||||
@ -214,22 +214,14 @@ void AArch64TargetStreamer::emitAttribute(StringRef VendorName, unsigned Tag,
|
||||
return;
|
||||
}
|
||||
for (MCELFStreamer::AttributeItem &Item : SubSection.Content) {
|
||||
// Tag already exists
|
||||
if (Item.Tag == Tag) {
|
||||
if (!Override) {
|
||||
if ((unsigned(-1) != Value && Item.IntValue != Value) ||
|
||||
("" != String && Item.StringValue != String)) {
|
||||
assert(0 &&
|
||||
"Can not add AArch64 build attribute: An attribute with "
|
||||
"the same tag and a different value already exists");
|
||||
return;
|
||||
} else {
|
||||
// Case Item.IntValue == Value, no need to emit twice
|
||||
assert(0 &&
|
||||
"AArch64 build attribute: An attribute with the same tag "
|
||||
"and a same value already exists");
|
||||
return;
|
||||
}
|
||||
}
|
||||
Item.Type = unsigned(-1) != Value
|
||||
? MCELFStreamer::AttributeItem::NumericAttribute
|
||||
: MCELFStreamer::AttributeItem::TextAttribute;
|
||||
Item.IntValue = unsigned(-1) != Value ? Value : unsigned(-1);
|
||||
Item.StringValue = unsigned(-1) != Value ? "" : String;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (unsigned(-1) != Value)
|
||||
|
@ -100,7 +100,7 @@ public:
|
||||
AArch64BuildAttrs::SubsectionOptional IsOptional,
|
||||
AArch64BuildAttrs::SubsectionType ParameterType);
|
||||
virtual void emitAttribute(StringRef VendorName, unsigned Tag, unsigned Value,
|
||||
std::string String, bool Override);
|
||||
std::string String);
|
||||
void activateAtributesSubsection(StringRef VendorName);
|
||||
std::unique_ptr<MCELFStreamer::AttributeSubSection>
|
||||
getActiveAtributesSubsection();
|
||||
@ -127,7 +127,7 @@ private:
|
||||
StringRef VendorName, AArch64BuildAttrs::SubsectionOptional IsOptional,
|
||||
AArch64BuildAttrs::SubsectionType ParameterType) override;
|
||||
void emitAttribute(StringRef VendorName, unsigned Tag, unsigned Value,
|
||||
std::string String, bool Override = false) override;
|
||||
std::string String) override;
|
||||
void emitInst(uint32_t Inst) override;
|
||||
void emitDirectiveVariantPCS(MCSymbol *Symbol) override;
|
||||
void finish() override;
|
||||
|
@ -2,9 +2,9 @@
|
||||
; RUN: llc %s -filetype=obj -o - | llvm-readelf --hex-dump=.ARM.attributes - | FileCheck %s --check-prefix=ELF
|
||||
|
||||
; ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
; ASM-NEXT: .aeabi_attribute Tag_Feature_BTI, 1
|
||||
; ASM-NEXT: .aeabi_attribute Tag_Feature_PAC, 1
|
||||
; ASM-NEXT: .aeabi_attribute Tag_Feature_GCS, 1
|
||||
; ASM-NEXT: .aeabi_attribute 0, 1 // Tag_Feature_BTI
|
||||
; ASM-NEXT: .aeabi_attribute 1, 1 // Tag_Feature_PAC
|
||||
; ASM-NEXT: .aeabi_attribute 2, 1 // Tag_Feature_GCS
|
||||
|
||||
; ELF: Hex dump of section '.ARM.attributes':
|
||||
; ELF-NEXT: 0x00000000 41230000 00616561 62695f66 65617475 A#...aeabi_featu
|
@ -2,9 +2,9 @@
|
||||
; RUN: llc %s -filetype=obj -o - | llvm-readelf --hex-dump=.ARM.attributes - | FileCheck %s --check-prefix=ELF
|
||||
|
||||
; ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
; ASM-NEXT: .aeabi_attribute Tag_Feature_BTI, 1
|
||||
; ASM-NEXT: .aeabi_attribute Tag_Feature_PAC, 0
|
||||
; ASM-NEXT: .aeabi_attribute Tag_Feature_GCS, 0
|
||||
; ASM-NEXT: .aeabi_attribute 0, 1 // Tag_Feature_BTI
|
||||
; ASM-NEXT: .aeabi_attribute 1, 0 // Tag_Feature_PAC
|
||||
; ASM-NEXT: .aeabi_attribute 2, 0 // Tag_Feature_GCS
|
||||
|
||||
; ELF: Hex dump of section '.ARM.attributes':
|
||||
; ELF-NEXT: 0x00000000 41230000 00616561 62695f66 65617475 A#...aeabi_featu
|
@ -2,9 +2,9 @@
|
||||
; RUN: llc %s -filetype=obj -o - | llvm-readelf --hex-dump=.ARM.attributes - | FileCheck %s --check-prefix=ELF
|
||||
|
||||
; ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
; ASM-NEXT: .aeabi_attribute Tag_Feature_BTI, 0
|
||||
; ASM-NEXT: .aeabi_attribute Tag_Feature_PAC, 0
|
||||
; ASM-NEXT: .aeabi_attribute Tag_Feature_GCS, 1
|
||||
; ASM-NEXT: .aeabi_attribute 0, 0 // Tag_Feature_BTI
|
||||
; ASM-NEXT: .aeabi_attribute 1, 0 // Tag_Feature_PAC
|
||||
; ASM-NEXT: .aeabi_attribute 2, 1 // Tag_Feature_GCS
|
||||
|
||||
; ELF: Hex dump of section '.ARM.attributes':
|
||||
; ELF-NEXT: 0x00000000 41230000 00616561 62695f66 65617475 A#...aeabi_featu
|
@ -2,9 +2,9 @@
|
||||
; RUN: llc %s -filetype=obj -o - | llvm-readelf --hex-dump=.ARM.attributes - | FileCheck %s --check-prefix=ELF
|
||||
|
||||
; ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
; ASM-NEXT: .aeabi_attribute Tag_Feature_BTI, 0
|
||||
; ASM-NEXT: .aeabi_attribute Tag_Feature_PAC, 1
|
||||
; ASM-NEXT: .aeabi_attribute Tag_Feature_GCS, 0
|
||||
; ASM-NEXT: .aeabi_attribute 0, 0 // Tag_Feature_BTI
|
||||
; ASM-NEXT: .aeabi_attribute 1, 1 // Tag_Feature_PAC
|
||||
; ASM-NEXT: .aeabi_attribute 2, 0 // Tag_Feature_GCS
|
||||
|
||||
; ELF: Hex dump of section '.ARM.attributes':
|
||||
; ELF-NEXT: 0x00000000 41230000 00616561 62695f66 65617475 A#...aeabi_featu
|
@ -2,8 +2,8 @@
|
||||
; RUN: llc %s -filetype=obj -o - | llvm-readelf --hex-dump=.ARM.attributes - | FileCheck %s --check-prefix=ELF
|
||||
|
||||
; ASM: .aeabi_subsection aeabi_pauthabi, required, uleb128
|
||||
; ASM-NEXT: .aeabi_attribute Tag_PAuth_Platform, 2
|
||||
; ASM-NEXT: .aeabi_attribute Tag_PAuth_Schema, 31
|
||||
; ASM-NEXT: .aeabi_attribute 1, 2 // Tag_PAuth_Platform
|
||||
; ASM-NEXT: .aeabi_attribute 2, 31 // Tag_PAuth_Schema
|
||||
|
||||
; ELF: Hex dump of section '.ARM.attributes':
|
||||
; ELF-NEXT: 0x00000000 41190000 00616561 62695f70 61757468 A....aeabi_pauth
|
@ -1,25 +0,0 @@
|
||||
// RUN: llvm-mc -triple=aarch64 %s -o - | FileCheck %s --check-prefix=ASM
|
||||
// RUN: llvm-mc -triple=aarch64 -filetype=obj %s -o - | llvm-readelf --hex-dump=.ARM.attributes - | FileCheck %s --check-prefix=ELF
|
||||
|
||||
// ASM: .aeabi_subsection aeabi_pauthabi, required, uleb128
|
||||
// ASM: .aeabi_attribute Tag_PAuth_Platform, 1
|
||||
// ASM: .aeabi_attribute Tag_PAuth_Schema, 1
|
||||
// ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
// ASM: .aeabi_attribute Tag_Feature_BTI, 1
|
||||
// ASM: .aeabi_attribute Tag_Feature_PAC, 1
|
||||
// ASM: .aeabi_attribute Tag_Feature_GCS, 1
|
||||
|
||||
// ELF: Hex dump of section '.ARM.attributes':
|
||||
// ELF-NEXT: 0x00000000 41190000 00616561 62695f70 61757468 A....aeabi_pauth
|
||||
// ELF-NEXT: 0x00000010 61626900 00000101 02012300 00006165 abi.......#...ae
|
||||
// ELF-NEXT: 0x00000020 6162695f 66656174 7572655f 616e645f abi_feature_and_
|
||||
// ELF-NEXT: 0x00000030 62697473 00010000 01010102 01
|
||||
|
||||
|
||||
.aeabi_subsection aeabi_pauthabi, required, uleb128
|
||||
.aeabi_attribute Tag_PAuth_Platform, 1
|
||||
.aeabi_attribute Tag_PAuth_Schema, 1
|
||||
.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
.aeabi_attribute Tag_Feature_BTI, 1
|
||||
.aeabi_attribute Tag_Feature_PAC, 1
|
||||
.aeabi_attribute Tag_Feature_GCS, 1
|
@ -1,51 +0,0 @@
|
||||
// RUN: llvm-mc -triple=aarch64 %s -o - | FileCheck %s --check-prefix=ASM
|
||||
// RUN: llvm-mc -triple=aarch64 -filetype=obj %s -o - | llvm-readelf --hex-dump=.ARM.attributes - | FileCheck %s --check-prefix=ELF
|
||||
|
||||
// ASM: .aeabi_subsection private_subsection_1, optional, uleb128
|
||||
// ASM: .aeabi_attribute 12, 257
|
||||
// ASM: .aeabi_subsection private_subsection_2, required, uleb128
|
||||
// ASM: .aeabi_attribute 76, 257
|
||||
// ASM: .aeabi_subsection private_subsection_3, optional, ntbs
|
||||
// ASM: .aeabi_attribute 34, hello_llvm
|
||||
// ASM: .aeabi_subsection private_subsection_4, required, ntbs
|
||||
// ASM: .aeabi_attribute 777, "hello_llvm"
|
||||
// ASM: .aeabi_subsection private_subsection_1, optional, uleb128
|
||||
// ASM: .aeabi_attribute 876, 257
|
||||
// ASM: .aeabi_subsection private_subsection_2, required, uleb128
|
||||
// ASM: .aeabi_attribute 876, 257
|
||||
// ASM: .aeabi_subsection private_subsection_3, optional, ntbs
|
||||
// ASM: .aeabi_attribute 876, "hello_llvm"
|
||||
// ASM: .aeabi_subsection private_subsection_4, required, ntbs
|
||||
// ASM: .aeabi_attribute 876, hello_llvm
|
||||
|
||||
// ELF: Hex dump of section '.ARM.attributes':
|
||||
// ELF-NEXT: 0x00000000 41220000 00707269 76617465 5f737562 A"...private_sub
|
||||
// ELF-NEXT: 0x00000010 73656374 696f6e5f 31000100 0c8102ec section_1.......
|
||||
// ELF-NEXT: 0x00000020 06810222 00000070 72697661 74655f73 ..."...private_s
|
||||
// ELF-NEXT: 0x00000030 75627365 6374696f 6e5f3200 00004c81 ubsection_2...L.
|
||||
// ELF-NEXT: 0x00000040 02ec0681 02360000 00707269 76617465 .....6...private
|
||||
// ELF-NEXT: 0x00000050 5f737562 73656374 696f6e5f 33000101 _subsection_3...
|
||||
// ELF-NEXT: 0x00000060 2268656c 6c6f5f6c 6c766d00 ec062268 "hello_llvm..."h
|
||||
// ELF-NEXT: 0x00000070 656c6c6f 5f6c6c76 6d220037 00000070 ello_llvm".7...p
|
||||
// ELF-NEXT: 0x00000080 72697661 74655f73 75627365 6374696f rivate_subsectio
|
||||
// ELF-NEXT: 0x00000090 6e5f3400 00018906 2268656c 6c6f5f6c n_4....."hello_l
|
||||
// ELF-NEXT: 0x000000a0 6c766d22 00ec0668 656c6c6f 5f6c6c76 lvm"...hello_llv
|
||||
// ELF-NEXT: 0x000000b0 6d00 m.
|
||||
|
||||
|
||||
.aeabi_subsection private_subsection_1, optional, uleb128
|
||||
.aeabi_attribute 12, 257
|
||||
.aeabi_subsection private_subsection_2, required, uleb128
|
||||
.aeabi_attribute 76, 257
|
||||
.aeabi_subsection private_subsection_3, optional, ntbs
|
||||
.aeabi_attribute 34, hello_llvm
|
||||
.aeabi_subsection private_subsection_4, required, ntbs
|
||||
.aeabi_attribute 777, "hello_llvm"
|
||||
.aeabi_subsection private_subsection_1, optional, uleb128
|
||||
.aeabi_attribute 876, 257
|
||||
.aeabi_subsection private_subsection_2, required, uleb128
|
||||
.aeabi_attribute 876, 257
|
||||
.aeabi_subsection private_subsection_3, optional, ntbs
|
||||
.aeabi_attribute 876, "hello_llvm"
|
||||
.aeabi_subsection private_subsection_4, required, ntbs
|
||||
.aeabi_attribute 876, hello_llvm
|
@ -0,0 +1,43 @@
|
||||
// RUN: llvm-mc -triple=aarch64 %s | FileCheck %s --check-prefix=ASM
|
||||
// RUN: llvm-mc -triple=aarch64 -filetype=obj %s | llvm-readelf --hex-dump=.ARM.attributes - | FileCheck %s --check-prefix=ELF
|
||||
|
||||
// ASM: .aeabi_subsection aeabi_pauthabi, required, uleb128
|
||||
// ASM: .aeabi_attribute 1, 7 // Tag_PAuth_Platform
|
||||
// ASM: .aeabi_attribute 2, 777 // Tag_PAuth_Schema
|
||||
// ASM: .aeabi_attribute 2, 777 // Tag_PAuth_Schema
|
||||
// ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
// ASM: .aeabi_attribute 0, 1 // Tag_Feature_BTI
|
||||
// ASM: .aeabi_attribute 1, 1 // Tag_Feature_PAC
|
||||
// ASM: .aeabi_attribute 2, 1 // Tag_Feature_GCS
|
||||
// ASM: .aeabi_subsection aeabi_pauthabi, required, uleb128
|
||||
// ASM: .aeabi_attribute 1, 7 // Tag_PAuth_Platform
|
||||
// ASM: .aeabi_attribute 2, 777 // Tag_PAuth_Schema
|
||||
// ASM: .aeabi_attribute 2, 777 // Tag_PAuth_Schema
|
||||
// ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
// ASM: .aeabi_attribute 0, 1 // Tag_Feature_BTI
|
||||
// ASM: .aeabi_attribute 1, 1 // Tag_Feature_PAC
|
||||
// ASM: .aeabi_attribute 2, 1 // Tag_Feature_GCS
|
||||
|
||||
// ELF: Hex dump of section '.ARM.attributes':
|
||||
// ELF-NEXT: 0x00000000 411a0000 00616561 62695f70 61757468 A....aeabi_pauth
|
||||
// ELF-NEXT: 0x00000010 61626900 00000107 02890623 00000061 abi........#...a
|
||||
// ELF-NEXT: 0x00000020 65616269 5f666561 74757265 5f616e64 eabi_feature_and
|
||||
// ELF-NEXT: 0x00000030 5f626974 73000100 00010101 0201 _bits.........
|
||||
|
||||
|
||||
.aeabi_subsection aeabi_pauthabi, required, uleb128
|
||||
.aeabi_attribute Tag_PAuth_Platform, 7
|
||||
.aeabi_attribute Tag_PAuth_Schema, 777
|
||||
.aeabi_attribute Tag_PAuth_Schema, 777
|
||||
.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
.aeabi_attribute Tag_Feature_BTI, 1
|
||||
.aeabi_attribute Tag_Feature_PAC, 1
|
||||
.aeabi_attribute Tag_Feature_GCS, 1
|
||||
.aeabi_subsection aeabi_pauthabi, required, uleb128
|
||||
.aeabi_attribute 1, 7 // Tag_PAuth_Platform
|
||||
.aeabi_attribute 2, 777 // Tag_PAuth_Schema
|
||||
.aeabi_attribute 2, 777 // Tag_PAuth_Schema
|
||||
.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
.aeabi_attribute 0, 1 // Tag_Feature_BTI
|
||||
.aeabi_attribute 1, 1 // Tag_Feature_PAC
|
||||
.aeabi_attribute 2, 1 // Tag_Feature_GCS
|
@ -1,10 +1,10 @@
|
||||
// RUN: llvm-mc -triple=aarch64 %s -o - | FileCheck %s --check-prefix=ASM
|
||||
// RUN: llvm-mc -triple=aarch64 -filetype=obj %s -o - | llvm-readelf --hex-dump=.ARM.attributes - | FileCheck %s --check-prefix=ELF
|
||||
// RUN: llvm-mc -triple=aarch64 %s | FileCheck %s --check-prefix=ASM
|
||||
// RUN: llvm-mc -triple=aarch64 -filetype=obj %s | llvm-readelf --hex-dump=.ARM.attributes - | FileCheck %s --check-prefix=ELF
|
||||
|
||||
// ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
// ASM: .aeabi_attribute Tag_Feature_BTI, 1
|
||||
// ASM: .aeabi_attribute Tag_Feature_PAC, 0
|
||||
// ASM: .aeabi_attribute Tag_Feature_GCS, 0
|
||||
// ASM: .aeabi_attribute 0, 1 // Tag_Feature_BTI
|
||||
// ASM: .aeabi_attribute 1, 0 // Tag_Feature_PAC
|
||||
// ASM: .aeabi_attribute 2, 0 // Tag_Feature_GCS
|
||||
|
||||
// ELF: Hex dump of section '.ARM.attributes':
|
||||
// ELF-NEXT: 0x00000000 41230000 00616561 62695f66 65617475 A#...aeabi_featu
|
@ -1,5 +1,6 @@
|
||||
// RUN: not llvm-mc -triple=aarch64 %s 2>&1 | FileCheck --check-prefix=ERR %s
|
||||
|
||||
// Test logic and type mismatch
|
||||
.aeabi_attribute Tag_Feature_BTI, 1
|
||||
// ERR: error: no active subsection, build attribute can not be added
|
||||
// ERR-NEXT: .aeabi_attribute Tag_Feature_BTI, 1
|
||||
@ -9,10 +10,6 @@
|
||||
// ERR: error: unknown AArch64 build attribute 'Tag_Feature_BTI' for subsection 'aeabi_pauthabi'
|
||||
// ERR-NEXT: .aeabi_attribute Tag_Feature_BTI, 1
|
||||
|
||||
.aeabi_attribute Tag_PAuth_Platform, 4
|
||||
// ERR: error: unknown AArch64 build attributes Value for Tag 'Tag_PAuth_Platform' options are 0|1
|
||||
// ERR-NEXT: .aeabi_attribute Tag_PAuth_Platform, 4
|
||||
|
||||
.aeabi_attribute a, 1
|
||||
// ERR: error: unknown AArch64 build attribute 'a' for subsection 'aeabi_pauthabi'
|
||||
// ERR-NEXT: .aeabi_attribute a, 1
|
||||
@ -25,6 +22,8 @@
|
||||
// ERR: error: active subsection type is ULEB128 (unsigned), found NTBS (string)
|
||||
// ERR-NEXT: .aeabi_attribute Tag_PAuth_Platform, a
|
||||
|
||||
|
||||
// Test syntax errors
|
||||
.aeabi_attribute Tag_PAuth_Platform,
|
||||
// ERR: error: AArch64 build attributes value not found
|
||||
// ERR-NEXT: .aeabi_attribute Tag_PAuth_Platform,
|
@ -1,21 +1,6 @@
|
||||
// RUN: not llvm-mc -triple=aarch64 %s 2>&1 | FileCheck --check-prefix=ERR %s
|
||||
|
||||
.aeabi_subsection aeabi_pauthabi, optional, uleb128
|
||||
// ERR: error: aeabi_pauthabi must be marked as required
|
||||
// ERR-NEXT: .aeabi_subsection aeabi_pauthabi, optional, uleb128
|
||||
|
||||
.aeabi_subsection aeabi_pauthabi, required, ntbs
|
||||
// ERR: error: aeabi_pauthabi must be marked as ULEB128
|
||||
// ERR-NEXT: .aeabi_subsection aeabi_pauthabi, required, ntbs
|
||||
|
||||
.aeabi_subsection aeabi_feature_and_bits, required, uleb128
|
||||
// ERR: error: aeabi_feature_and_bits must be marked as optional
|
||||
// ERR-NEXT: .aeabi_subsection aeabi_feature_and_bits, required, uleb128
|
||||
|
||||
.aeabi_subsection aeabi_feature_and_bits, optional, ntbs
|
||||
// ERR: error: aeabi_feature_and_bits must be marked as ULEB128
|
||||
// ERR-NEXT: .aeabi_subsection aeabi_feature_and_bits, optional, ntbs
|
||||
|
||||
// Test syntax errors
|
||||
.aeabi_subsection 1, required, uleb128
|
||||
// ERR: error: subsection name not found
|
||||
// ERR-NEXT: .aeabi_subsection 1, required, uleb128
|
||||
@ -25,11 +10,7 @@
|
||||
// ERR-NEXT: .aeabi_subsection , required, uleb128
|
||||
|
||||
.aeabi_subsection aeabi_pauthabi, a, uleb128
|
||||
// ERR: error: unknown AArch64 build attributes optionality, expected required|optional: a
|
||||
// ERR-NEXT: .aeabi_subsection aeabi_pauthabi, a, uleb128
|
||||
|
||||
.aeabi_subsection aeabi_pauthabi, a, uleb128
|
||||
// ERR: error: unknown AArch64 build attributes optionality, expected required|optional: a
|
||||
// ERR: error: unknown AArch64 build attributes optionality, expected required|optional
|
||||
// ERR-NEXT: .aeabi_subsection aeabi_pauthabi, a, uleb128
|
||||
|
||||
.aeabi_subsection aeabi_pauthabi, 1, uleb128
|
||||
@ -41,7 +22,7 @@
|
||||
// ERR-NEXT: .aeabi_subsection aeabi_pauthabi, ,uleb128
|
||||
|
||||
.aeabi_subsection aeabi_pauthabi,uleb128
|
||||
// ERR: error: unknown AArch64 build attributes optionality, expected required|optional: uleb128
|
||||
// ERR: error: unknown AArch64 build attributes optionality, expected required|optional
|
||||
// ERR-NEXT: .aeabi_subsection aeabi_pauthabi,uleb128
|
||||
|
||||
.aeabi_subsection aeabi_pauthabi uleb128
|
||||
@ -57,5 +38,27 @@
|
||||
// ERR-NEXT: .aeabi_subsection aeabi_pauthabi, required,
|
||||
|
||||
.aeabi_subsection aeabi_pauthabi, required, a
|
||||
// ERR: error: unknown AArch64 build attributes type, expected uleb128|ntbs: a
|
||||
// ERR: error: unknown AArch64 build attributes type, expected uleb128|ntbs
|
||||
// ERR-NEXT: .aeabi_subsection aeabi_pauthabi, required, a
|
||||
|
||||
.aeabi_subsection aeabi_pauthabi, optional, uleb128
|
||||
// ERR: error: aeabi_pauthabi must be marked as required
|
||||
// ERR-NEXT: .aeabi_subsection aeabi_pauthabi, optional, uleb128
|
||||
|
||||
|
||||
// Test types mismatch
|
||||
.aeabi_subsection aeabi_pauthabi, optional, uleb128
|
||||
// ERR: error: aeabi_pauthabi must be marked as required
|
||||
// ERR-NEXT: .aeabi_subsection aeabi_pauthabi, optional, uleb128
|
||||
|
||||
.aeabi_subsection aeabi_pauthabi, required, ntbs
|
||||
// ERR: error: aeabi_pauthabi must be marked as ULEB128
|
||||
// ERR-NEXT: .aeabi_subsection aeabi_pauthabi, required, ntbs
|
||||
|
||||
.aeabi_subsection aeabi_feature_and_bits, required, uleb128
|
||||
// ERR: error: aeabi_feature_and_bits must be marked as optional
|
||||
// ERR-NEXT: .aeabi_subsection aeabi_feature_and_bits, required, uleb128
|
||||
|
||||
.aeabi_subsection aeabi_feature_and_bits, optional, ntbs
|
||||
// ERR: error: aeabi_feature_and_bits must be marked as ULEB128
|
||||
// ERR-NEXT: .aeabi_subsection aeabi_feature_and_bits, optional, ntbs
|
@ -1,10 +1,10 @@
|
||||
// RUN: llvm-mc -triple=aarch64 %s -o - | FileCheck %s --check-prefix=ASM
|
||||
// RUN: llvm-mc -triple=aarch64 -filetype=obj %s -o - | llvm-readelf --hex-dump=.ARM.attributes - | FileCheck %s --check-prefix=ELF
|
||||
// RUN: llvm-mc -triple=aarch64 %s | FileCheck %s --check-prefix=ASM
|
||||
// RUN: llvm-mc -triple=aarch64 -filetype=obj %s | llvm-readelf --hex-dump=.ARM.attributes - | FileCheck %s --check-prefix=ELF
|
||||
|
||||
// ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
// ASM: .aeabi_attribute Tag_Feature_BTI, 0
|
||||
// ASM: .aeabi_attribute Tag_Feature_PAC, 0
|
||||
// ASM: .aeabi_attribute Tag_Feature_GCS, 1
|
||||
// ASM: .aeabi_attribute 0, 0 // Tag_Feature_BTI
|
||||
// ASM: .aeabi_attribute 1, 0 // Tag_Feature_PAC
|
||||
// ASM: .aeabi_attribute 2, 1 // Tag_Feature_GCS
|
||||
|
||||
// ELF: Hex dump of section '.ARM.attributes':
|
||||
// ELF-NEXT: 0x00000000 41230000 00616561 62695f66 65617475 A#...aeabi_featu
|
50
llvm/test/MC/AArch64/build-attributes-asm-aeabi-mixed.s
Normal file
50
llvm/test/MC/AArch64/build-attributes-asm-aeabi-mixed.s
Normal file
@ -0,0 +1,50 @@
|
||||
// RUN: llvm-mc -triple=aarch64 %s | FileCheck %s --check-prefix=ASM
|
||||
// RUN: llvm-mc -triple=aarch64 -filetype=obj %s | llvm-readelf --hex-dump=.ARM.attributes - | FileCheck %s --check-prefix=ELF
|
||||
|
||||
// ASM: .aeabi_subsection subsection_a, optional, uleb128
|
||||
// ASM: .aeabi_subsection aeabi_subsection, optional, ntbs
|
||||
// ASM: .aeabi_subsection subsection_b, required, uleb128
|
||||
// ASM: .aeabi_subsection aeabi_pauthabi, required, uleb128
|
||||
// ASM: .aeabi_attribute 1, 7 // Tag_PAuth_Platform
|
||||
// ASM: .aeabi_attribute 2, 777 // Tag_PAuth_Schema
|
||||
// ASM: .aeabi_attribute 1, 9 // Tag_PAuth_Platform
|
||||
// ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
// ASM: .aeabi_attribute 0, 1 // Tag_Feature_BTI
|
||||
// ASM: .aeabi_attribute 1, 1 // Tag_Feature_PAC
|
||||
// ASM: .aeabi_attribute 2, 1 // Tag_Feature_GCS
|
||||
// ASM: .aeabi_subsection aeabi_subsection, optional, ntbs
|
||||
// ASM: .aeabi_attribute 5, "Value"
|
||||
// ASM: .aeabi_subsection subsection_b, required, uleb128
|
||||
// ASM: .aeabi_attribute 6, 536
|
||||
// ASM: .aeabi_subsection subsection_a, optional, uleb128
|
||||
// ASM: .aeabi_attribute 7, 11
|
||||
|
||||
// ELF: Hex dump of section '.ARM.attributes':
|
||||
// ELF-NEXT: 0x00000000 41150000 00737562 73656374 696f6e5f A....subsection_
|
||||
// ELF-NEXT: 0x00000010 61000100 070b2000 00006165 6162695f a..... ...aeabi_
|
||||
// ELF-NEXT: 0x00000020 73756273 65637469 6f6e0001 01052256 subsection...."V
|
||||
// ELF-NEXT: 0x00000030 616c7565 22001600 00007375 62736563 alue".....subsec
|
||||
// ELF-NEXT: 0x00000040 74696f6e 5f620000 00069804 1a000000 tion_b..........
|
||||
// ELF-NEXT: 0x00000050 61656162 695f7061 75746861 62690000 aeabi_pauthabi..
|
||||
// ELF-NEXT: 0x00000060 00010902 89062300 00006165 6162695f ......#...aeabi_
|
||||
// ELF-NEXT: 0x00000070 66656174 7572655f 616e645f 62697473 feature_and_bits
|
||||
// ELF-NEXT: 0x00000080 00010000 01010102 01 .........
|
||||
|
||||
|
||||
.aeabi_subsection subsection_a, optional, uleb128
|
||||
.aeabi_subsection aeabi_subsection, optional, ntbs
|
||||
.aeabi_subsection subsection_b, required, uleb128
|
||||
.aeabi_subsection aeabi_pauthabi, required, uleb128
|
||||
.aeabi_attribute Tag_PAuth_Platform, 7
|
||||
.aeabi_attribute Tag_PAuth_Schema, 777
|
||||
.aeabi_attribute Tag_PAuth_Platform, 9
|
||||
.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
.aeabi_attribute Tag_Feature_BTI, 1
|
||||
.aeabi_attribute Tag_Feature_PAC, 1
|
||||
.aeabi_attribute Tag_Feature_GCS, 1
|
||||
.aeabi_subsection aeabi_subsection, optional, ntbs
|
||||
.aeabi_attribute 5, "Value"
|
||||
.aeabi_subsection subsection_b, required, uleb128
|
||||
.aeabi_attribute 6, 536
|
||||
.aeabi_subsection subsection_a, optional, uleb128
|
||||
.aeabi_attribute 7, 11
|
@ -1,13 +1,13 @@
|
||||
// RUN: llvm-mc -triple=aarch64 %s -o - | FileCheck %s --check-prefix=ASM
|
||||
// RUN: llvm-mc -triple=aarch64 -filetype=obj %s -o - | llvm-readelf --hex-dump=.ARM.attributes - | FileCheck %s --check-prefix=ELF
|
||||
|
||||
// ASM: .aeabi_subsection aeabi_pauthabi, required, uleb128
|
||||
// ASM: .aeabi_attribute Tag_PAuth_Platform, 0
|
||||
// ASM: .aeabi_attribute Tag_PAuth_Schema, 0
|
||||
// ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
// ASM: .aeabi_attribute Tag_Feature_BTI, 0
|
||||
// ASM: .aeabi_attribute Tag_Feature_PAC, 0
|
||||
// ASM: .aeabi_attribute Tag_Feature_GCS, 0
|
||||
// ASM: .aeabi_subsection aeabi_pauthabi, required, uleb128
|
||||
// ASM: .aeabi_attribute 1, 0 // Tag_PAuth_Platform
|
||||
// ASM: .aeabi_attribute 2, 0 // Tag_PAuth_Schema
|
||||
// ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
// ASM: .aeabi_attribute 0, 0 // Tag_Feature_BTI
|
||||
// ASM: .aeabi_attribute 1, 0 // Tag_Feature_PAC
|
||||
// ASM: .aeabi_attribute 2, 0 // Tag_Feature_GCS
|
||||
|
||||
// ELF: Hex dump of section '.ARM.attributes':
|
||||
// ELF-NEXT: 0x00000000 41190000 00616561 62695f70 61757468 A....aeabi_pauth
|
@ -2,15 +2,15 @@
|
||||
|
||||
// ASM: .aeabi_subsection aeabi_pauthabi, required, uleb128
|
||||
// ASM: .aeabi_attribute 0, 1
|
||||
// ASM: .aeabi_attribute Tag_PAuth_Platform, 1
|
||||
// ASM: .aeabi_attribute Tag_PAuth_Schema, 1
|
||||
// ASM: .aeabi_attribute 1, 1 // Tag_PAuth_Platform
|
||||
// ASM: .aeabi_attribute 2, 1 // Tag_PAuth_Schema
|
||||
// ASM: .aeabi_attribute 3, 1
|
||||
// ASM: .aeabi_attribute 4, 1
|
||||
// ASM: .aeabi_attribute 5, 1
|
||||
// ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
// ASM: .aeabi_attribute Tag_Feature_BTI, 1
|
||||
// ASM: .aeabi_attribute Tag_Feature_PAC, 1
|
||||
// ASM: .aeabi_attribute Tag_Feature_GCS, 1
|
||||
// ASM: .aeabi_attribute 0, 1 // Tag_Feature_BTI
|
||||
// ASM: .aeabi_attribute 1, 1 // Tag_Feature_PAC
|
||||
// ASM: .aeabi_attribute 2, 1 // Tag_Feature_GCS
|
||||
// ASM: .aeabi_attribute 3, 1
|
||||
// ASM: .aeabi_attribute 4, 1
|
||||
// ASM: .aeabi_attribute 5, 1
|
@ -3,18 +3,18 @@
|
||||
|
||||
// ASM: .aeabi_subsection aeabi_pauthabi, required, uleb128
|
||||
// ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
// ASM: .aeabi_attribute Tag_Feature_BTI, 1
|
||||
// ASM: .aeabi_attribute 0, 1 // Tag_Feature_BTI
|
||||
// ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
// ASM: .aeabi_subsection aeabi_pauthabi, required, uleb128
|
||||
// ASM: .aeabi_attribute Tag_PAuth_Schema, 1
|
||||
// ASM: .aeabi_attribute 2, 1 // Tag_PAuth_Schema
|
||||
// ASM: .aeabi_subsection aeabi_pauthabi, required, uleb128
|
||||
// ASM: .aeabi_attribute Tag_PAuth_Platform, 1
|
||||
// ASM: .aeabi_attribute 1, 1 // Tag_PAuth_Platform
|
||||
// ASM: .aeabi_subsection aeabi_pauthabi, required, uleb128
|
||||
// ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
// ASM: .aeabi_attribute Tag_Feature_GCS, 1
|
||||
// ASM: .aeabi_attribute 2, 1 // Tag_Feature_GCS
|
||||
// ASM: .aeabi_subsection aeabi_pauthabi, required, uleb128
|
||||
// ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
// ASM: .aeabi_attribute Tag_Feature_PAC, 0
|
||||
// ASM: .aeabi_attribute 1, 0 // Tag_Feature_PAC
|
||||
// ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
// ASM: .aeabi_attribute 7, 1
|
||||
// ASM: .aeabi_subsection aeabi_pauthabi, required, uleb128
|
@ -2,9 +2,9 @@
|
||||
// RUN: llvm-mc -triple=aarch64 -filetype=obj %s -o - | llvm-readelf --hex-dump=.ARM.attributes - | FileCheck %s --check-prefix=ELF
|
||||
|
||||
// ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
// ASM: .aeabi_attribute Tag_Feature_BTI, 0
|
||||
// ASM: .aeabi_attribute Tag_Feature_PAC, 1
|
||||
// ASM: .aeabi_attribute Tag_Feature_GCS, 0
|
||||
// ASM: .aeabi_attribute 0, 0 // Tag_Feature_BTI
|
||||
// ASM: .aeabi_attribute 1, 1 // Tag_Feature_PAC
|
||||
// ASM: .aeabi_attribute 2, 0 // Tag_Feature_GCS
|
||||
|
||||
// ELF: Hex dump of section '.ARM.attributes':
|
||||
// ELF-NEXT: 0x00000000 41230000 00616561 62695f66 65617475 A#...aeabi_featu
|
||||
@ -13,6 +13,6 @@
|
||||
|
||||
|
||||
.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
|
||||
.aeabi_attribute Tag_Feature_BTI, 0
|
||||
.aeabi_attribute Tag_Feature_PAC, 1
|
||||
.aeabi_attribute Tag_Feature_GCS, 0
|
||||
.aeabi_attribute 0, 0 // Tag_Feature_BTI
|
||||
.aeabi_attribute 1, 1 // Tag_Feature_PAC
|
||||
.aeabi_attribute 2, 0 // Tag_Feature_GCS
|
@ -15,6 +15,11 @@
|
||||
// ERR: error: active subsection type is NTBS (string), found ULEB128 (unsigned)
|
||||
// ERR-NEXT: .aeabi_attribute 324, 1
|
||||
|
||||
.aeabi_attribute str_not_int, "1"
|
||||
// ERR: error: unrecognized Tag: 'str_not_int'
|
||||
// ERR-NEXT: Except for public subsections, tags have to be an unsigned int.
|
||||
// ERR-NEXT: .aeabi_attribute str_not_int, "1"
|
||||
|
||||
.aeabi_subsection foo, optional, uleb128
|
||||
.aeabi_subsection bar, optional, uleb128
|
||||
.aeabi_subsection foo, required, uleb128
|
49
llvm/test/MC/AArch64/build-attributes-asm-non_aeabi.s
Normal file
49
llvm/test/MC/AArch64/build-attributes-asm-non_aeabi.s
Normal file
@ -0,0 +1,49 @@
|
||||
// RUN: llvm-mc -triple=aarch64 %s -o - | FileCheck %s --check-prefix=ASM
|
||||
// RUN: llvm-mc -triple=aarch64 -filetype=obj %s -o - | llvm-readelf --hex-dump=.ARM.attributes - | FileCheck %s --check-prefix=ELF
|
||||
|
||||
// ASM: .aeabi_subsection private_subsection_1, optional, uleb128
|
||||
// ASM: .aeabi_attribute 12, 257
|
||||
// ASM: .aeabi_subsection aeabi_2, required, uleb128
|
||||
// ASM: .aeabi_attribute 76, 257
|
||||
// ASM: .aeabi_subsection aeabi_3, optional, ntbs
|
||||
// ASM: .aeabi_attribute 34, hello_llvm
|
||||
// ASM: .aeabi_subsection private_subsection_4, required, ntbs
|
||||
// ASM: .aeabi_attribute 777, "hello_llvm"
|
||||
// ASM: .aeabi_subsection private_subsection_1, optional, uleb128
|
||||
// ASM: .aeabi_attribute 876, 257
|
||||
// ASM: .aeabi_subsection aeabi_2, required, uleb128
|
||||
// ASM: .aeabi_attribute 876, 257
|
||||
// ASM: .aeabi_subsection aeabi_3, optional, ntbs
|
||||
// ASM: .aeabi_attribute 876, "hello_llvm"
|
||||
// ASM: .aeabi_subsection private_subsection_4, required, ntbs
|
||||
// ASM: .aeabi_attribute 876, hello_llvm
|
||||
|
||||
// ELF: Hex dump of section '.ARM.attributes':
|
||||
// ELF: 0x00000000 41220000 00707269 76617465 5f737562 A"...private_sub
|
||||
// ELF: 0x00000010 73656374 696f6e5f 31000100 0c8102ec section_1.......
|
||||
// ELF: 0x00000020 06810215 00000061 65616269 5f320000 .......aeabi_2..
|
||||
// ELF: 0x00000030 004c8102 ec068102 29000000 61656162 .L......)...aeab
|
||||
// ELF: 0x00000040 695f3300 01012268 656c6c6f 5f6c6c76 i_3..."hello_llv
|
||||
// ELF: 0x00000050 6d00ec06 2268656c 6c6f5f6c 6c766d22 m..."hello_llvm"
|
||||
// ELF: 0x00000060 00370000 00707269 76617465 5f737562 .7...private_sub
|
||||
// ELF: 0x00000070 73656374 696f6e5f 34000001 89062268 section_4....."h
|
||||
// ELF: 0x00000080 656c6c6f 5f6c6c76 6d2200ec 0668656c ello_llvm"...hel
|
||||
// ELF: 0x00000090 6c6f5f6c 6c766d00 lo_llvm.
|
||||
|
||||
|
||||
.aeabi_subsection private_subsection_1, optional, uleb128
|
||||
.aeabi_attribute 12, 257
|
||||
.aeabi_subsection aeabi_2, required, uleb128
|
||||
.aeabi_attribute 76, 257
|
||||
.aeabi_subsection aeabi_3, optional, ntbs
|
||||
.aeabi_attribute 34, hello_llvm
|
||||
.aeabi_subsection private_subsection_4, required, ntbs
|
||||
.aeabi_attribute 777, "hello_llvm"
|
||||
.aeabi_subsection private_subsection_1, optional, uleb128
|
||||
.aeabi_attribute 876, 257
|
||||
.aeabi_subsection aeabi_2, required, uleb128
|
||||
.aeabi_attribute 876, 257
|
||||
.aeabi_subsection aeabi_3, optional, ntbs
|
||||
.aeabi_attribute 876, "hello_llvm"
|
||||
.aeabi_subsection private_subsection_4, required, ntbs
|
||||
.aeabi_attribute 876, hello_llvm
|
Loading…
x
Reference in New Issue
Block a user