This is an archive of the discontinued LLVM Phabricator instance.

Fix linker-defined symbols possibly not being defined when -wrap is used
ClosedPublic

Authored by thomasanderson on Dec 27 2018, 12:45 PM.

Details

Summary

Fixes https://bugs.llvm.org/show_bug.cgi?id=40134

addWrappedSymbols() must be called before addReservedSymbols() because the
latter only defines reserved symbols when they are undefined in the symbol
table. If addWrappedSymbols() is called after, then addUndefined() is called
which may lazily pull in more object files that could reference reserved
symbols.

Diff Detail

Repository
rL LLVM

Event Timeline

thakis added a subscriber: thakis.Dec 27 2018, 3:58 PM

Can you add a test to lld/test/ELF?

ruiu added a reviewer: ruiu.Dec 27 2018, 4:09 PM

Can you add a test to lld/test/ELF?

Done. Added test fails without change; all tests pass with change

ruiu added a comment.Dec 28 2018, 1:40 PM

There's no test file named after a bug number in lld test suite, so you should avoid doing that for consistency.

There's no test file named after a bug number in lld test suite, so you should avoid doing that for consistency.

Done! (There are a few that managed to sneak in: ELF/pr34660.s ELF/pr34872.s ELF/pr36475.s ELF/pr37735.s)

Ping. Is this good to land now?

ruiu accepted this revision.Jan 2 2019, 11:21 AM

LGTM. Please submit.

This revision is now accepted and ready to land.Jan 2 2019, 11:21 AM
This revision was automatically updated to reflect the committed changes.