[PATCH] D76765: [LLD][ELF] - Linkerscript: support the case when INPUT_SECTION_FLAGS is used without section patterns.

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 26 02:07:52 PDT 2020


psmith added a comment.

In D76765#1943051 <https://reviews.llvm.org/D76765#1943051>, @grimar wrote:

> In D76765#1941605 <https://reviews.llvm.org/D76765#1941605>, @MaskRay wrote:
>
> >   The raw wildcard syntax is questionable because it can potentially cause parsing ambiguity. 
> >
> > ...
> >  I also left a comment on https://bugs.llvm.org/show_bug.cgi?id=39885
>
>
> What about if we drop the following piece we have then?
>
>   } else {
>     // We have a file name and no input sections description. It is not a
>     // commonly used syntax, but still acceptable. In that case, all sections
>     // from the file will be included.
>     // FIXME: GNU ld permits INPUT_SECTION_FLAGS to be used here. We do not
>     // handle this case here as it will already have been matched by the
>     // case above.
>     auto *isd = make<InputSectionDescription>(tok);
>     isd->sectionPatterns.push_back({{}, StringMatcher("*")});
>     cmd->sectionCommands.push_back(isd);
>   }
>   
>   


Given that someone can always write the pattern with ("*") which will also work on binutils then I'm happy to say we don't support it. If we do drop support we should consider a "not supported" error message, and to document it as a known limitation.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76765/new/

https://reviews.llvm.org/D76765





More information about the llvm-commits mailing list