[lld] r326289 - [WebAssembly] Remove ELF-ness.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 10:42:41 PST 2018


Yes, I think I agree with you. Since wasm doesn't allow multiple text or
data sections in an executable, the notion of section name might useless
for text/data sections in the first place. Sam, why do we need that?

On Wed, Feb 28, 2018 at 10:38 AM Rafael Avila de Espindola <
rafael.espindola at gmail.com> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180228/34164ef8/attachment.html>


More information about the llvm-commits mailing list