[PATCH] D13566: [ELF2] PPC64 needs to delay local-call relocations until after the function-descriptor values are known

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 14:06:36 PDT 2015


On Thu, Oct 8, 2015 at 1:53 PM, hfinkel at anl.gov <hfinkel at anl.gov> wrote:

> hfinkel added a comment.
>
> In http://reviews.llvm.org/D13566#263240, @ruiu wrote:
>
> > If my understanding is correct, the problem is that when we apply
> relocations, relocations in .opd may not have been applied yes, so you have
> to backfill relocations that refer function descriptors in .opd.
> >
> > If so, it seems to me that you can solve the problem by applying all
> relocations in .opd first and then rest,. Doesn't this work?
>
>
> Yes, if we always applied relocations in .opd first, then we'd be able to
> save and use that information later for the relocations in the text
> sections.
>

By "save", what kind of information do you have to save? I thought that you
"save" information into .opd section. Do you have to save any out-of-bound
data besides that from .opd section relocation to .text (or similar)
section relocation?


>
> Should we add some kind of target hook that allows it to somehow adjust
> the order in which the relocations are applied? Does this require
> separating that process from the order in which the sections are written?
> In short, how would you like this to work?
>

If you want to apply .opd's relocation first, just hard-code that logic in
Writer<ELFT>::writeSections so that the section with name ".opd" is written
first. We don't even need PPC check; always do that.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151008/4728f4e0/attachment.html>


More information about the llvm-commits mailing list