Page MenuHomePhabricator

[LLD][ELF][AArch64] Fix ADRP relocations to undefined weak reference.

Authored by peter.smith on Dec 12 2018, 6:13 AM.



In the ABI for the 64-bit Arm architecture the section on weak references states:

During linking, the symbol value of an undefined weak reference is:
    - Zero if the relocation type is absolute
    - The address of the place if the relocation type is pc-relative.

The relocations associated with an ADRP are relative so we should resolve the undefined weak reference to the place instead of 0. This matches GNU ld.bfd behaviour.

fixes pr34928 (

Diff Detail


Event Timeline

peter.smith created this revision.Dec 12 2018, 6:13 AM
grimar accepted this revision.Dec 12 2018, 6:39 AM

LGTM, thanks!

This revision is now accepted and ready to land.Dec 12 2018, 6:39 AM
This revision was automatically updated to reflect the committed changes.