This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Emit binding opcodes for defined symbols that override weak dysyms
ClosedPublic

Authored by int3 on Aug 25 2020, 1:22 PM.

Details

Summary

These opcodes tell dyld to coalesce the overridden weak dysyms to this
particular symbol definition.

Diff Detail

Event Timeline

int3 created this revision.Aug 25 2020, 1:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2020, 1:22 PM
int3 requested review of this revision.Aug 25 2020, 1:22 PM
smeenai added inline comments.
lld/MachO/SymbolTable.cpp
85

Doesn't this need to check isWeakDef as well?

lld/test/MachO/weak-header-flags.s
24

Similar comment as the last one, although this time it's not hypothetical ... this is only checking that there's no MH_BINDS_TO_WEAK after MH_WEAK_DEFINES, and won't catch an MH_BINDS_TO_WEAK that appears before the MH_WEAK_DEFINES.

int3 updated this revision to Diff 288214.Aug 27 2020, 12:29 AM
int3 marked 2 inline comments as done.

fix

lld/MachO/SymbolTable.cpp
85

oops. added a test...

smeenai accepted this revision.Aug 27 2020, 2:24 PM

LGTM

This revision is now accepted and ready to land.Aug 27 2020, 2:24 PM