[llvm-commits] [llvm] r131205 - in /llvm/trunk/lib/MC: ELFObjectWriter.cpp ELFObjectWriter.h

Jason Kim jasonwkim at google.com
Thu May 12 09:50:57 PDT 2011


On Thu, May 12, 2011 at 9:38 AM, Renato Golin <rengolin at systemcall.org> wrote:
> On 11 May 2011 23:53, Jason W Kim <jason.w.kim.2009 at gmail.com> wrote:
>>  const MCSymbol *ELFObjectWriter::SymbolToReloc(const MCAssembler &Asm,
>>                                                const MCValue &Target,
>> -                                               const MCFragment &F) const {
>> +                                               const MCFragment &F,
>> +                                               const MCFixup &Fixup,
>> +                                               bool IsPCRel) const {
>
> Hi Jason,
>
> As a side note... since you're passing the relocation already,
> shouldn't isPcRel be a method on Fixup to define if that specific
> relocation is PC relative or not?
>
> Something like:

Yah, we've gone back and forth on that.

Currently it calls out to AsmBackend.getFixupKind() which is pretty
much the same thing (i.e. arch specific and virtual).
AsmBackend has a arch specific table with a flag that tells whether a
relflag is pcrel or not.

Thanks for review!
-jason

>
> virtual MCFixup::isPCRel() { return false; }
>
> and each architecture implement its own PC relative relocations as needed:
>
> virtual ARMMCFixup::isPCRel() { return Type == FOO_PC || Type == BAR_PC; }
>
> If that makes sense...
>
> cheers,
> --renato
>




More information about the llvm-commits mailing list