[lld] r326289 - [WebAssembly] Remove ELF-ness.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 27 16:57:28 PST 2018
Author: ruiu
Date: Tue Feb 27 16:57:28 2018
New Revision: 326289
URL: http://llvm.org/viewvc/llvm-project?rev=326289&view=rev
Log:
[WebAssembly] Remove ELF-ness.
These output section names are ELF-specific. We shouldn't have this rule
for WebAssembly.
Differential Revision: https://reviews.llvm.org/D43712
Modified:
lld/trunk/wasm/Writer.cpp
Modified: lld/trunk/wasm/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/Writer.cpp?rev=326289&r1=326288&r2=326289&view=diff
==============================================================================
--- lld/trunk/wasm/Writer.cpp (original)
+++ lld/trunk/wasm/Writer.cpp Tue Feb 27 16:57:28 2018
@@ -839,16 +839,12 @@ void Writer::assignIndexes() {
static StringRef getOutputDataSegmentName(StringRef Name) {
if (Config->Relocatable)
return Name;
-
- for (StringRef V :
- {".text.", ".rodata.", ".data.rel.ro.", ".data.", ".bss.rel.ro.",
- ".bss.", ".init_array.", ".fini_array.", ".ctors.", ".dtors.", ".tbss.",
- ".gcc_except_table.", ".tdata.", ".ARM.exidx.", ".ARM.extab."}) {
- StringRef Prefix = V.drop_back();
- if (Name.startswith(V) || Name == Prefix)
- return Prefix;
- }
-
+ if (Name.startswith(".text."))
+ return ".text";
+ if (Name.startswith(".data."))
+ return ".data";
+ if (Name.startswith(".bss."))
+ return ".bss";
return Name;
}
More information about the llvm-commits
mailing list