Skip to content

Commit 99ff3d0

Browse files
committed
[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
1 parent 74638f1 commit 99ff3d0

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

llvm/lib/MC/MCParser/ELFAsmParser.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,6 @@ class ELFAsmParser : public MCAsmParserExtension {
5757
addDirectiveHandler<&ELFAsmParser::parseSectionDirectiveRoData>(".rodata");
5858
addDirectiveHandler<&ELFAsmParser::parseSectionDirectiveTData>(".tdata");
5959
addDirectiveHandler<&ELFAsmParser::parseSectionDirectiveTBSS>(".tbss");
60-
addDirectiveHandler<
61-
&ELFAsmParser::parseSectionDirectiveDataRel>(".data.rel");
62-
addDirectiveHandler<
63-
&ELFAsmParser::parseSectionDirectiveDataRelRo>(".data.rel.ro");
64-
addDirectiveHandler<
65-
&ELFAsmParser::parseSectionDirectiveEhFrame>(".eh_frame");
6660
addDirectiveHandler<&ELFAsmParser::parseDirectiveSection>(".section");
6761
addDirectiveHandler<
6862
&ELFAsmParser::parseDirectivePushSection>(".pushsection");
@@ -120,22 +114,6 @@ class ELFAsmParser : public MCAsmParserExtension {
120114
ELF::SHF_TLS | ELF::SHF_WRITE,
121115
SectionKind::getThreadBSS());
122116
}
123-
bool parseSectionDirectiveDataRel(StringRef, SMLoc) {
124-
return parseSectionSwitch(".data.rel", ELF::SHT_PROGBITS,
125-
ELF::SHF_ALLOC | ELF::SHF_WRITE,
126-
SectionKind::getData());
127-
}
128-
bool parseSectionDirectiveDataRelRo(StringRef, SMLoc) {
129-
return parseSectionSwitch(".data.rel.ro", ELF::SHT_PROGBITS,
130-
ELF::SHF_ALLOC |
131-
ELF::SHF_WRITE,
132-
SectionKind::getReadOnlyWithRel());
133-
}
134-
bool parseSectionDirectiveEhFrame(StringRef, SMLoc) {
135-
return parseSectionSwitch(".eh_frame", ELF::SHT_PROGBITS,
136-
ELF::SHF_ALLOC | ELF::SHF_WRITE,
137-
SectionKind::getData());
138-
}
139117
bool parseDirectivePushSection(StringRef, SMLoc);
140118
bool parseDirectivePopSection(StringRef, SMLoc);
141119
bool parseDirectiveSection(StringRef, SMLoc);

llvm/test/MC/ELF/elf_directive_section.s

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@
33
.bss
44
# CHECK: .bss
55

6-
.data.rel.ro
7-
# CHECK: .data.rel.ro
8-
9-
.data.rel
10-
# CHECK: .data.rel
11-
12-
.eh_frame
13-
# CHECK: .eh_frame
14-
156
.rodata
167
# CHECK: .rodata
178

0 commit comments

Comments
 (0)