diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-11-18 06:02:15 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-11-18 06:02:15 +0000 |
commit | 449711cb366962c841e7c6b9c1271484d2965c54 (patch) | |
tree | 431bb6aa43feca0657676cb7f1aceb0521050d0f /llvm/lib/MC/MCParser/COFFAsmParser.cpp | |
parent | e113b5e9afeda18d249aca75d473350b94fcda5f (diff) | |
download | bcm5719-llvm-449711cb366962c841e7c6b9c1271484d2965c54.tar.gz bcm5719-llvm-449711cb366962c841e7c6b9c1271484d2965c54.zip |
Stop producing .data.rel sections.
If a section is rw, it is irrelevant if the dynamic linker will write to
it or not.
It looks like llvm implemented this because gcc was doing it. It looks
like gcc implemented this in the hope that it would put all the
relocated items close together and speed up the dynamic linker.
There are two problem with this:
* It doesn't work. Both bfd and gold will map .data.rel to .data and
concatenate the input sections in the order they are seen.
* If we want a feature like that, it can be implemented directly in the
linker since it knowns where the dynamic relocations are.
llvm-svn: 253436
Diffstat (limited to 'llvm/lib/MC/MCParser/COFFAsmParser.cpp')
-rw-r--r-- | llvm/lib/MC/MCParser/COFFAsmParser.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/MC/MCParser/COFFAsmParser.cpp b/llvm/lib/MC/MCParser/COFFAsmParser.cpp index f09bce005d6..a4b2b195f71 100644 --- a/llvm/lib/MC/MCParser/COFFAsmParser.cpp +++ b/llvm/lib/MC/MCParser/COFFAsmParser.cpp @@ -98,11 +98,10 @@ class COFFAsmParser : public MCAsmParserExtension { SectionKind::getText()); } bool ParseSectionDirectiveData(StringRef, SMLoc) { - return ParseSectionSwitch(".data", - COFF::IMAGE_SCN_CNT_INITIALIZED_DATA - | COFF::IMAGE_SCN_MEM_READ - | COFF::IMAGE_SCN_MEM_WRITE, - SectionKind::getDataRel()); + return ParseSectionSwitch(".data", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | + COFF::IMAGE_SCN_MEM_READ | + COFF::IMAGE_SCN_MEM_WRITE, + SectionKind::getData()); } bool ParseSectionDirectiveBSS(StringRef, SMLoc) { return ParseSectionSwitch(".bss", @@ -153,7 +152,7 @@ static SectionKind computeSectionKind(unsigned Flags) { if (Flags & COFF::IMAGE_SCN_MEM_READ && (Flags & COFF::IMAGE_SCN_MEM_WRITE) == 0) return SectionKind::getReadOnly(); - return SectionKind::getDataRel(); + return SectionKind::getData(); } bool COFFAsmParser::ParseSectionFlags(StringRef FlagsString, unsigned* Flags) { |