[PATCH] D148358: [MC] Add section flag 'l' for SHF_X86_64_LARGE
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 14 17:20:25 PDT 2023
aeubanks updated this revision to Diff 513820.
aeubanks added a comment.
Herald added subscribers: pcwang-thead, s.egerton, simoncook, asb.
rebase, don't allow for for non-x86_64
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148358/new/
https://reviews.llvm.org/D148358
Files:
llvm/lib/MC/MCParser/ELFAsmParser.cpp
llvm/test/MC/ELF/section-flags-unknown.s
llvm/test/MC/ELF/section.s
Index: llvm/test/MC/ELF/section.s
===================================================================
--- llvm/test/MC/ELF/section.s
+++ llvm/test/MC/ELF/section.s
@@ -268,6 +268,14 @@
// CHECK-NEXT: SHF_WRITE
// CHECK-NEXT: ]
+.section .large,"l"
+// CHECK: Section {
+// CHECK: Name: .large
+// CHECK-NEXT: Type: SHT_PROGBITS
+// CHECK-NEXT: Flags [
+// CHECK-NEXT: SHF_X86_64_LARGE
+// CHECK-NEXT: ]
+
// Test SHT_LLVM_ODRTAB
.section .odrtab,"e", at llvm_odrtab
Index: llvm/test/MC/ELF/section-flags-unknown.s
===================================================================
--- llvm/test/MC/ELF/section-flags-unknown.s
+++ llvm/test/MC/ELF/section-flags-unknown.s
@@ -1,5 +1,5 @@
## Some section flags are processor-specific. Reject them for other targets.
-# RUN: not llvm-mc -triple=x86_64 %s -o /dev/null 2>&1 | FileCheck %s --implicit-check-not=error:
+# RUN: not llvm-mc -triple=riscv32 %s -o /dev/null 2>&1 | FileCheck %s --implicit-check-not=error:
# CHECK: {{.*}}.s:[[# @LINE+1]]:34: error: unknown flag
.section XCORE_SHF_CP_SECTION,"c", at progbits
@@ -12,3 +12,6 @@
# CHECK: {{.*}}.s:[[# @LINE+1]]:30: error: unknown flag
.section SHF_ARM_PURECODE,"y", at progbits
+
+# CHECK: {{.*}}.s:[[# @LINE+1]]:30: error: unknown flag
+.section SHF_X86_64_LARGE,"l", at progbits
Index: llvm/lib/MC/MCParser/ELFAsmParser.cpp
===================================================================
--- llvm/lib/MC/MCParser/ELFAsmParser.cpp
+++ llvm/lib/MC/MCParser/ELFAsmParser.cpp
@@ -339,6 +339,11 @@
case 'G':
flags |= ELF::SHF_GROUP;
break;
+ case 'l':
+ if (TT.getArch() != Triple::x86_64)
+ return -1U;
+ flags |= ELF::SHF_X86_64_LARGE;
+ break;
case 'R':
if (TT.isOSSolaris())
flags |= ELF::SHF_SUNW_NODISCARD;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148358.513820.patch
Type: text/x-patch
Size: 1834 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230415/1332e8a2/attachment.bin>
More information about the llvm-commits
mailing list