This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Add support for common bitcode symbols
AbandonedPublic

Authored by int3 on Jul 22 2021, 2:23 PM.

Details

Reviewers
gkm
Group Reviewers
Restricted Project
Summary

For some reason, ld64 gives common bitcode symbols a lower
priority than common non-bitcode symbols. As such, I've created a
BitcodeCommonSymbol in order to handle this.

Note that we still deviate from ld64's behavior in some cases,
particularly when bitcode and non-bitcode symbols of the same name are
mixed. I doubt such a situation occurs often in practice, so it should
be fine. I would like to avoid overly complicating our implementation
unless necessary. I've added comments in the test to highlight these
cases.

Diff Detail

Event Timeline

int3 created this revision.Jul 22 2021, 2:23 PM
Herald added a project: Restricted Project. · View Herald Transcript
int3 requested review of this revision.Jul 22 2021, 2:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2021, 2:23 PM
int3 planned changes to this revision.Jul 22 2021, 5:13 PM

Whoops, missed a test failure. But that aside, I'm a bit ambivalent about trying to follow ld64's weird symbol precedence rules here... it makes the implementation quite a bit uglier, for edge cases that may never be exercised.

int3 abandoned this revision.Jul 29 2021, 2:54 PM