This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Fix handling of weak symbols from static library when using version script.
ClosedPublic

Authored by grimar on Jul 11 2017, 9:03 AM.

Details

Summary

This is PR33738.

In short issue is next. Imagine code and script.
Version script:

{ local: *; };

DSO code:

.text
 callq foo@PLT
.weak foo

foo here is a weak undefined symbol that can be found in archive.
Undefined weak will not fetch archive members

During scan of relocations we call isPreemptible() which calls includeInDynsym() inside,
the latter one calls computeBinding() which computed binding as STB_LOCAL for such symbols,
making it non-preemptible what broke output.

Diff Detail

Event Timeline

grimar created this revision.Jul 11 2017, 9:03 AM
grimar edited the summary of this revision. (Show Details)Jul 11 2017, 9:06 AM
grimar edited the summary of this revision. (Show Details)
ruiu added inline comments.Jul 11 2017, 9:38 AM
ELF/Symbols.h
69

Is this the same as isDefined()?

ruiu accepted this revision.Jul 11 2017, 10:59 AM

Ah, that's right. LGTM.

This revision is now accepted and ready to land.Jul 11 2017, 10:59 AM
This revision was automatically updated to reflect the committed changes.