This is an archive of the discontinued LLVM Phabricator instance.

Use lambdas to store lazy-evaluated .dynamic entries.
ClosedPublic

Authored by ruiu on Nov 22 2017, 2:55 AM.

Event Timeline

ruiu created this revision.Nov 22 2017, 2:55 AM
ruiu updated this revision to Diff 123894.Nov 22 2017, 2:56 AM
  • clang-format
jhenderson accepted this revision.Nov 22 2017, 4:50 AM

LGTM.

It's a lot bigger a change than I'd expected, but I like it!

lld/ELF/SyntheticSections.cpp
1176

Missing const maybe - what's the policy on const in LLD?

This revision is now accepted and ready to land.Nov 22 2017, 4:50 AM

It occurs to me that now that D39493 has landed, this change will need to include the intended change to using a lambda for the DT_MIPS_LOCAL_GOTNO entry. I used the following code to add it locally, in place of the current addInt():

Entries.push_back({DT_MIPS_LOCAL_GOTNO,
                   [=] { return InX::MipsGot->getLocalEntriesNum(); }});

I'm still happy for this to go in with that change, or a similar one.

This revision was automatically updated to reflect the committed changes.