[llvm-commits] [PATCH] PPC32: Add mapping for darwin/gas modifier in elf object writer

Adhemerval Zanella azanella at linux.vnet.ibm.com
Thu Jan 3 11:18:16 PST 2013


Hi Kai,

The PPC32 backend it not being worked right now, so I believe he is broken. But if you
want to chase it down, I suggest you to look on how the PPC64 implements the relocation
model for mcmodel=small and mcmodel=medium. I implemented the mcmodel=small
(r166677<http://permalink.gmane.org/gmane.comp.compilers.llvm.cvs/124395>) and Bill Schmidt the mcmodel=small ( r168708).

On 01/03/2013 09:15 AM, Kai wrote:
> Hi Hal!
>
> Thanks for the hint to the test case. That was the information I needed. :-)
>
> I attach the patch again, this time with a test.
> A problem still remains: the PPC32 ELF write is really broken. The last line of the test checks for a wrong value (the right value is noted as a comment).
> Root cause is that 64bit relocation types are created even in 32bit mode. I am unsure about the right strategy to fix this. E.g. we could map the MCSymbolRefExp inside PPCELFObjectWriter::getRelocTypeInner() to different relocation types depending on 32/64 bit mode.
>
> Regards
> Kai
>
> On 02.01.2013 21:31, Hal Finkel wrote:
>> ----- Original Message -----
>>> From: "Hal Finkel" <hfinkel at anl.gov>
>>> To: "Kai" <kai at redstar.de>
>>> Cc: llvm-commits at cs.uiuc.edu
>>> Sent: Wednesday, January 2, 2013 2:12:01 PM
>>> Subject: Re: [llvm-commits] [PATCH] PPC32: Add mapping for darwin/gas modifier in elf object writer
>>>
>>> ----- Original Message -----
>>>> From: "Kai" <kai at redstar.de>
>>>> To: llvm-commits at cs.uiuc.edu
>>>> Sent: Sunday, December 30, 2012 5:49:04 PM
>>>> Subject: [llvm-commits] [PATCH] PPC32: Add mapping for darwin/gas
>>>> modifier in elf object writer
>>>>
>>>> Hi!
>>>>
>>>> The VK_PPC_DARWIN_HA16/LO16 and :VK_PPC_GAS_HA16/LO16 modifier are
>>>> not
>>>> mapped in PPCELFObjectWriter.cpp. They should be mapped to
>>>> R_PPC_ADDR16_HA and R_PPC_ADDR16_LO. The attached patch adds these
>>>> mappings.
>>>
>>> Kai,
>>>
>>> The patch looks fine; I'd prefer that we have a test case. I think
>>> that you can make use of the elf-dump utility to generate one; see,
>>> for example, test/MC/PowerPC/ppc64-initial-cfa.ll
>>
>> Actually, test/MC/PowerPC/ppc64-relocs-01.ll may be a better example.
>>
>>   -Hal
>>
>>>
>>> Thanks again,
>>> Hal
>>>
>>>>
>>>> Regards
>>>>
>>>> Kai
>>>>
>>>> _______________________________________________
>>>> llvm-commits mailing list
>>>> llvm-commits at cs.uiuc.edu
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>>>
>>>
>>> -- 
>>> Hal Finkel
>>> Postdoctoral Appointee
>>> Leadership Computing Facility
>>> Argonne National Laboratory
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>>
>>
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list