This is an archive of the discontinued LLVM Phabricator instance.

Added R_PPC_ADDR16_HI relocation support to lld
ClosedPublic

Authored by vit9696 on Oct 3 2017, 11:29 AM.

Details

Reviewers
davide
ruiu
Summary

The support of R_PPC_ADDR16_HI improves ld compatibility and makes things on par with RuntimeDyldELF that already implements this relocation.

Diff Detail

Event Timeline

vit9696 created this revision.Oct 3 2017, 11:29 AM
davide added inline comments.Oct 3 2017, 11:32 AM
test/ELF/ppc-relocs.s
27–32

I assume you checked that bfd or gold produce the same results?

78

why this changed?

vit9696 added inline comments.Oct 3 2017, 11:44 AM
test/ELF/ppc-relocs.s
27–32

Well, initially I did not, since it was simple. Yet I have just checked bfd, and ensured that it is the same.
(The only difference between hi and ha is the higher bit, and I simply followed applyPPChi/applyPPCha).

78

I wanted the HA/HI tests be closer to each other for readability reasons.

ruiu edited reviewers, added: ruiu; removed: rui314.Oct 3 2017, 12:30 PM
ruiu accepted this revision.Oct 3 2017, 12:36 PM

LGTM

For the record, R_PPC64_ADDR_HI is defined as

R_PPC64_ADDR16_HI         5        half16        #hi(S + A)

where

#hi(x) = ((x >> 16) & 0xffff).

in this document: http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi.html#RELOC-TYPE

This revision is now accepted and ready to land.Oct 3 2017, 12:36 PM
davide edited edge metadata.Oct 11 2017, 6:03 PM

Was this ever committed?

Was this ever committed?

Not yet. I don't have commit rights, could you commit it please?

Ping, would anybody commit this please?

ruiu closed this revision.Oct 22 2017, 6:13 PM

Committed as r316306.