This is an archive of the discontinued LLVM Phabricator instance.

[LLD][ARM] Do not create interworking thunks for undefined weak references.
ClosedPublic

Authored by peter.smith on Nov 2 2016, 4:57 AM.

Details

Summary

An undefined weak reference is given an address of 0 this will incorrectly trigger the creation of a Thumb to ARM interworking Thunk
if there is a Thumb branch instruction to the symbol. This results in a linker error as Thunks only make sense to defined or shared symbols.

We prevent this by detecting an undefined symbol and not creating a thunk for it.

Diff Detail

Repository
rL LLVM

Event Timeline

peter.smith updated this revision to Diff 76691.Nov 2 2016, 4:57 AM
peter.smith retitled this revision from to [LLD][ARM] Do not create interworking thunks for undefined weak references..
peter.smith updated this object.
peter.smith added reviewers: ruiu, rafael.
peter.smith added a subscriber: llvm-commits.
ruiu accepted this revision.Nov 2 2016, 12:07 PM
ruiu edited edge metadata.

LGTM

This revision is now accepted and ready to land.Nov 2 2016, 12:07 PM
This revision was automatically updated to reflect the committed changes.