ARM-software / abi-aa

Application Binary Interface for the Arm® Architecture
Other
878 stars 173 forks source link

Clarify R_<CLS>_RELATIVE optimization wording #242

Closed smeenai closed 4 months ago

smeenai commented 5 months ago

The optimization is applied by the static linker, so we should reword the sentence from that perspective. Thanks to @smithp35 for suggesting the wording.

MaskRay commented 5 months ago

I think "resolves to the current dynamic shared object" conveys the same meaning: rtld binds the symbol reference to the current DSO.

smeenai commented 5 months ago

Hmm. I was thinking about this from the perspective of the static linker, since it'll be the one emitting RELATIVE vs. GLOB_DAT as an optimization (the context of the sentence). I guess a better wording for the entire sentence from that perspective would be:

This relocation represents an optimization; it can be used to replace R_<CLS>_GLOB_DAT when the symbol ~resolves to~ is defined in the current dynamic shared object and is not pre-emptable.

You're right from the rtld perspective, but I don't understand the optimization discussion from that perspective. The static linker is the one deciding what relocation type to emit, and rtld is just acting on it, right?

smeenai commented 5 months ago

Thanks, I updated the wording with your suggestion. I also updated the PR title and description to match the commit, because I wasn't sure which one would be ultimately used.

smeenai commented 5 months ago

Can we merge this now? :)

stuij commented 4 months ago

Yes :) As per @smithp35's previous comments.