summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2018-02-28 00:57:28 +0000
committerRui Ueyama <ruiu@google.com>2018-02-28 00:57:28 +0000
commit4764b5748aef50c51f6885ebdf0210105758ece4 (patch)
tree80a2e3365487c1bc82d6c6ad3510341913ed1b0f
parent35a9d1b17f7455acae7ac14e4ad38c954caf38e0 (diff)
downloadbcm5719-llvm-4764b5748aef50c51f6885ebdf0210105758ece4.tar.gz
bcm5719-llvm-4764b5748aef50c51f6885ebdf0210105758ece4.zip
[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 llvm-svn: 326289
-rw-r--r--lld/wasm/Writer.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp
index 5a347e458d8..b478ef3bdeb 100644
--- a/lld/wasm/Writer.cpp
+++ b/lld/wasm/Writer.cpp
@@ -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;
}
OpenPOWER on IntegriCloud