This is an archive of the discontinued LLVM Phabricator instance.

[PPC64] Add helper for calculating the offset from a functions global entry to its local entry. [NFC]
ClosedPublic

Authored by sfertile on Sep 18 2018, 6:58 AM.

Details

Summary

The PPC64 elf V2 abi defines 2 entry points for a function. There are a few places we need to calculate the offset from the global entry to the local entry and how this is done is not straight forward. This patch adds a helper function mostly for documentation purposes, explaining how the 2 entry points differ and why we choose one over the other, as well as documenting how the offsets are encoded into a functions st_other field.

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

sfertile created this revision.Sep 18 2018, 6:58 AM
sfertile retitled this revision from [PPC64] Add helper for calculating the offset from a functions global entry to its local entry. to [PPC64] Add helper for calculating the offset from a functions global entry to its local entry. [NFC].Sep 18 2018, 6:59 AM
MaskRay added inline comments.Sep 18 2018, 1:38 PM
ELF/Arch/PPC64.cpp
100

Remove the trailing space st_other "

ELF/Target.h
178

Typo. function's

ruiu accepted this revision.Sep 19 2018, 5:59 AM

LGTM

Thank you for doing this!

ELF/Arch/PPC64.cpp
99

Please use error() and returns a dummy value (e.g. 0) because this place is reachable.

ELF/Target.h
174

abi -> ABI

This revision is now accepted and ready to land.Sep 19 2018, 5:59 AM
This revision was automatically updated to reflect the committed changes.