[lld] r249340 - Create R_X86_64_RELATIVE when needed.

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 16 14:13:08 PDT 2015


----- Original Message -----
> From: "Rafael EspĂ­ndola" <rafael.espindola at gmail.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "llvm-commits" <llvm-commits at lists.llvm.org>
> Sent: Friday, October 16, 2015 3:57:19 PM
> Subject: Re: [lld] r249340 - Create R_X86_64_RELATIVE when needed.
> 
> On 15 October 2015 at 10:13, Hal Finkel <hfinkel at anl.gov> wrote:
> > Hi Rafael,
> >
> > Could you please better comment the semantics of isRelRelative?
> 
> In the way people normally write psabis, it should return true for
> any
> relocation that has a " - P" in the calculation. Would that be a
> reasonable comment to add?

I am wondering, for example, whether the .TOC.-relative relocations should be in this list? They're relative, in the sense that they don't require a getRelativeReloc() to be generated.

> 
> > Is it true that, for -shared and any relocation for which
> > isRelRelative returns false, getRelativeReloc() is generated? If
> > not, what other conditions affect when getRelativeReloc() is
> > generated?
> 
> I don't think the mapping is that direct.

Maybe the thing that needs to be commented is this mapping. It clearly seems to have something to do with the return from isRelRelative, but it is more complicated? getRelativeReloc() needs a size_t-sized relocation target. How do we know when we have one?

Thanks again,
Hal

> 
> Cheers,
> Rafael
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory


More information about the llvm-commits mailing list