diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-09-19 19:59:21 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-09-19 19:59:21 +0000 |
commit | 7d38273636e590904ccc292c7034831bb9d26d8b (patch) | |
tree | c65034fd2c0309ada7c8ef716aaef710f7c56367 /lld/ELF/Writer.cpp | |
parent | 3d90318aff0eaf6ee95256667a152428600e0929 (diff) | |
download | bcm5719-llvm-7d38273636e590904ccc292c7034831bb9d26d8b.tar.gz bcm5719-llvm-7d38273636e590904ccc292c7034831bb9d26d8b.zip |
Map .data.rel.ro correctly.
An input section named .data.rel.ro now maps to an output section
named .data.rel.ro. Before we were mapping it to .data.
llvm-svn: 281931
Diffstat (limited to 'lld/ELF/Writer.cpp')
-rw-r--r-- | lld/ELF/Writer.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index f17f10694ef..f8b6323f50a 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -90,11 +90,14 @@ private: template <class ELFT> StringRef elf::getOutputSectionName(InputSectionBase<ELFT> *S) { StringRef Name = S->Name; - for (StringRef V : {".text.", ".rodata.", ".data.rel.ro.", ".data.", ".bss.", - ".init_array.", ".fini_array.", ".ctors.", ".dtors.", - ".tbss.", ".gcc_except_table.", ".tdata.", ".ARM.exidx."}) - if (Name.startswith(V)) - return V.drop_back(); + for (StringRef V : + {".text.", ".rodata.", ".data.rel.ro.", ".data.", ".bss.", + ".init_array.", ".fini_array.", ".ctors.", ".dtors.", ".tbss.", + ".gcc_except_table.", ".tdata.", ".ARM.exidx."}) { + StringRef Prefix = V.drop_back(); + if (Name.startswith(V) || Name == Prefix) + return Prefix; + } return Name; } |