[MCParser] Remove some section directive not supported by gas
and not emitted by AsmPrinter.
The intention was to remove `.eh_frame`, which had the wrong
section flags. Let's also remove .data.rel and .data.rel.ro
but keep other extensions like .rodata
diff --git a/llvm/lib/MC/MCParser/ELFAsmParser.cpp b/llvm/lib/MC/MCParser/ELFAsmParser.cpp
index 99b13c6..11e122b 100644
--- a/llvm/lib/MC/MCParser/ELFAsmParser.cpp
+++ b/llvm/lib/MC/MCParser/ELFAsmParser.cpp
@@ -57,12 +57,6 @@
addDirectiveHandler<&ELFAsmParser::parseSectionDirectiveRoData>(".rodata");
addDirectiveHandler<&ELFAsmParser::parseSectionDirectiveTData>(".tdata");
addDirectiveHandler<&ELFAsmParser::parseSectionDirectiveTBSS>(".tbss");
- addDirectiveHandler<
- &ELFAsmParser::parseSectionDirectiveDataRel>(".data.rel");
- addDirectiveHandler<
- &ELFAsmParser::parseSectionDirectiveDataRelRo>(".data.rel.ro");
- addDirectiveHandler<
- &ELFAsmParser::parseSectionDirectiveEhFrame>(".eh_frame");
addDirectiveHandler<&ELFAsmParser::parseDirectiveSection>(".section");
addDirectiveHandler<
&ELFAsmParser::parseDirectivePushSection>(".pushsection");
@@ -120,22 +114,6 @@
ELF::SHF_TLS | ELF::SHF_WRITE,
SectionKind::getThreadBSS());
}
- bool parseSectionDirectiveDataRel(StringRef, SMLoc) {
- return parseSectionSwitch(".data.rel", ELF::SHT_PROGBITS,
- ELF::SHF_ALLOC | ELF::SHF_WRITE,
- SectionKind::getData());
- }
- bool parseSectionDirectiveDataRelRo(StringRef, SMLoc) {
- return parseSectionSwitch(".data.rel.ro", ELF::SHT_PROGBITS,
- ELF::SHF_ALLOC |
- ELF::SHF_WRITE,
- SectionKind::getReadOnlyWithRel());
- }
- bool parseSectionDirectiveEhFrame(StringRef, SMLoc) {
- return parseSectionSwitch(".eh_frame", ELF::SHT_PROGBITS,
- ELF::SHF_ALLOC | ELF::SHF_WRITE,
- SectionKind::getData());
- }
bool parseDirectivePushSection(StringRef, SMLoc);
bool parseDirectivePopSection(StringRef, SMLoc);
bool parseDirectiveSection(StringRef, SMLoc);
diff --git a/llvm/test/MC/ELF/elf_directive_section.s b/llvm/test/MC/ELF/elf_directive_section.s
index 9531c02..310a780 100644
--- a/llvm/test/MC/ELF/elf_directive_section.s
+++ b/llvm/test/MC/ELF/elf_directive_section.s
@@ -3,15 +3,6 @@
.bss
# CHECK: .bss
- .data.rel.ro
-# CHECK: .data.rel.ro
-
- .data.rel
-# CHECK: .data.rel
-
- .eh_frame
-# CHECK: .eh_frame
-
.rodata
# CHECK: .rodata