[PATCH] D76328: [ELF] Allow uppercase section directives

Sid Manning via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 17 15:08:04 PDT 2020


sidneym created this revision.
sidneym added reviewers: MaskRay, grimar.
Herald added subscribers: hiraditya, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

It was noticed that llvm-mc doesn't allow uppercase section directives.  I don't see any obvious reason why they shouldn't be allowed.

Since this has never been the case for llvm I'm not sure how important this is but gnu-as isn't case sensative AFAIK.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76328

Files:
  llvm/lib/MC/MCParser/AsmParser.cpp
  llvm/test/MC/ELF/elf_directive_section.s


Index: llvm/test/MC/ELF/elf_directive_section.s
===================================================================
--- llvm/test/MC/ELF/elf_directive_section.s
+++ llvm/test/MC/ELF/elf_directive_section.s
@@ -21,3 +21,24 @@
 	.tdata
 # CHECK: .tdata
 
+	.BSS
+# CHECK: .bss
+
+	.DATA.REL.RO
+# CHECK: .data.rel.ro
+
+	.DATA.REL
+# CHECK: .data.rel
+
+	.EH_FRAME
+# CHECK: .eh_frame
+
+	.RODATA
+# CHECK: .rodata
+
+	.TBSS
+# CHECK: .tbss
+
+	.TDATA
+# CHECK: .tdata
+
Index: llvm/lib/MC/MCParser/AsmParser.cpp
===================================================================
--- llvm/lib/MC/MCParser/AsmParser.cpp
+++ llvm/lib/MC/MCParser/AsmParser.cpp
@@ -1920,7 +1920,7 @@
     // Next, check the extension directive map to see if any extension has
     // registered itself to parse this directive.
     std::pair<MCAsmParserExtension *, DirectiveHandler> Handler =
-        ExtensionDirectiveMap.lookup(IDVal);
+        ExtensionDirectiveMap.lookup(IDVal.lower());
     if (Handler.first)
       return (*Handler.second)(Handler.first, IDVal, IDLoc);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76328.250908.patch
Type: text/x-patch
Size: 1061 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200317/ce5c2c41/attachment.bin>


More information about the llvm-commits mailing list