[lld] r326289 - [WebAssembly] Remove ELF-ness.
Rafael Avila de Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 28 10:38:53 PST 2018
Rui Ueyama via llvm-commits <llvm-commits at lists.llvm.org> writes:
> 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";
Why do you need even that? Given that it is a new file format it could
always use the equivalent of -fno-unique-section-names, no?
Cheers,
Rafael
More information about the llvm-commits
mailing list