Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7947,7 +7947,12 @@ bool AArch64AsmParser::parseDirectiveAeabiSubSectionHeader(SMLoc L) {
}
}
Parser.Lex();
// Parsing finished, check for trailing tokens.

// Parsing finished, hereafter only accept comments; otherwise no trailing
// tokens.
if (Parser.getTok().is(llvm::AsmToken::At)) {
Parser.parseStringToEndOfStatement();
}
if (Parser.getTok().isNot(llvm::AsmToken::EndOfStatement)) {
Error(Parser.getTok().getLoc(), "unexpected token for AArch64 build "
"attributes subsection header directive");
Expand Down Expand Up @@ -8070,7 +8075,12 @@ bool AArch64AsmParser::parseDirectiveAeabiAArch64Attr(SMLoc L) {
}
}
Parser.Lex();
// Parsing finished, check for trailing tokens.

// Parsing finished, hereafter only accept comments; otherwise no trailing
// tokens.
if (Parser.getTok().is(llvm::AsmToken::At)) {
Parser.parseStringToEndOfStatement();
}
if (Parser.getTok().isNot(llvm::AsmToken::EndOfStatement)) {
Error(Parser.getTok().getLoc(),
"unexpected token for AArch64 build attributes tag and value "
Expand All @@ -8082,7 +8092,6 @@ bool AArch64AsmParser::parseDirectiveAeabiAArch64Attr(SMLoc L) {
getTargetStreamer().emitAttribute(ActiveSubsectionName, Tag, ValueInt, "",
false);
}

if ("" != ValueStr) {
getTargetStreamer().emitAttribute(ActiveSubsectionName, Tag, unsigned(-1),
ValueStr, false);
Expand Down
8 changes: 4 additions & 4 deletions llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ class AArch64TargetAsmStreamer : public AArch64TargetStreamer {
case AArch64BuildAttrs::TAG_FEATURE_BTI:
case AArch64BuildAttrs::TAG_FEATURE_GCS:
case AArch64BuildAttrs::TAG_FEATURE_PAC:
OS << "\t.aeabi_attribute" << "\t"
<< AArch64BuildAttrs::getFeatureAndBitsTagsStr(Tag) << ", " << Value;
OS << "\t.aeabi_attribute" << "\t" << Tag << ", " << Value << "\t@ "
<< AArch64BuildAttrs::getFeatureAndBitsTagsStr(Tag);
AArch64TargetStreamer::emitAttribute(VendorName, Tag, Value, "",
Override);
break;
Expand All @@ -210,8 +210,8 @@ class AArch64TargetAsmStreamer : public AArch64TargetStreamer {
break;
case AArch64BuildAttrs::TAG_PAUTH_PLATFORM:
case AArch64BuildAttrs::TAG_PAUTH_SCHEMA:
OS << "\t.aeabi_attribute" << "\t"
<< AArch64BuildAttrs::getPauthABITagsStr(Tag) << ", " << Value;
OS << "\t.aeabi_attribute" << "\t" << Tag << ", " << Value << "\t@ "
<< AArch64BuildAttrs::getPauthABITagsStr(Tag);
AArch64TargetStreamer::emitAttribute(VendorName, Tag, Value, "",
Override);
break;
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/CodeGen/AArch64/aarch64-build-attributes-all.ll
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/CodeGen/AArch64/aarch64-build-attributes-bti.ll
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/CodeGen/AArch64/aarch64-build-attributes-gcs.ll
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/CodeGen/AArch64/aarch64-build-attributes-pac.ll
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down