This is an archive of the discontinued LLVM Phabricator instance.

LinkerScript: Add parsing of the EXTERN command
ClosedPublic

Authored by meadori on Mar 11 2015, 3:12 PM.

Details

Reviewers
davide
shankarke
Group Reviewers
lld
Summary

This patch implements parsing of the GNU ld EXTERN command [1].
Evaluation will be added at a later point in time.

[1] https://sourceware.org/binutils/docs-2.25/ld/Miscellaneous-Commands.html#Miscellaneous-Commands

Diff Detail

Event Timeline

meadori updated this revision to Diff 21777.Mar 11 2015, 3:12 PM
meadori retitled this revision from to LinkerScript: Add parsing of the EXTERN command.
meadori updated this object.
meadori edited the test plan for this revision. (Show Details)
meadori added a reviewer: lld.
meadori added a project: lld.
meadori added a subscriber: Unknown Object (MLST).
davide added a subscriber: davide.Mar 11 2015, 3:27 PM

I see no problems with the patch as-is, but I'm more and more concerned about the direction LinkerScript is taking.
It seems like we keep adding support for parsing of different directives without implementing the corresponding semantic action, so this is almost-dead code.
In order to not have this gap growing I propose that at least for new directives we implement both semantic and parsing action at the same time, even in two different patches to facilitate review.

In order to not have this gap growing I propose that at least for new directives we implement both
semantic and parsing action at the same time, even in two different patches to facilitate review.

I did exactly that for this series. See D8272.

I did *not* do it with the MEMORY command because I believe that will take quite a bit of infrastructure to implement, but I plan to do it. For cases like MEMORY (where the eval piece is much more complicated) I think it is better to get the parsing bit out. For cases like EXTERN I think both sides should be submitted at the same time. I plan to always split the parse and eval portions into separate patches.

davide accepted this revision.Mar 11 2015, 5:02 PM
davide added a reviewer: davide.

Seems fine to me, but I would be happier if somebody else can take a look as well (also the semantic action).

This revision is now accepted and ready to land.Mar 11 2015, 5:02 PM
shankarke accepted this revision.Mar 12 2015, 12:51 PM
shankarke added a reviewer: shankarke.
shankarke added a subscriber: shankarke.

LGTM

meadori closed this revision.Apr 10 2015, 1:36 PM