This is an archive of the discontinued LLVM Phabricator instance.

[lld/mac] Handle symbols from -U in treatUndefinedSymbol()
ClosedPublic

Authored by thakis on Jul 22 2021, 8:42 AM.

Details

Reviewers
gkm
int3
Group Reviewers
Restricted Project
Commits
rG2d6fb62ef2d9: [lld/mac] Handle symbols from -U in treatUndefinedSymbol()
Summary

In ld64, -U section$start$FOO$bar handles section$start$FOO$bar
as a regular section$start symbol, that is section$start processing
happens before -U processing.

Likely, nobody uses that in practice so it doesn't seem very important
to be compatible with this, but it also moves the -U handling code next
to the -undefined dynamic_lookup handling code, which is nice because
they do the same thing. And, in fact, this did identify a bug in a corner
case in the intersection of -undefined dynamic_lookup and dead-stripping
(fix for that in D106565).

Vaguely related to PR50760.

No interesting behavior change.

Diff Detail

Event Timeline

thakis created this revision.Jul 22 2021, 8:42 AM
Herald added a project: Restricted Project. · View Herald Transcript
int3 added a subscriber: int3.Jul 22 2021, 4:09 PM

hmm, looks like there are behavioral changes based on the test failures...

int3 accepted this revision.Jul 22 2021, 4:10 PM

ah I see, it's a diff dependency issue. lgtm

This revision is now accepted and ready to land.Jul 22 2021, 4:10 PM
This revision was landed with ongoing or failed builds.Jul 22 2021, 4:44 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2021, 4:44 PM