[LLVMdev] [ARM] [PIC] optimizing the loading of hidden global variable

weimingz at codeaurora.org
Fri, 14 Mar 2014 04:45:57 -0000

Hi Tim,

The global merge pass puts the GVs into a sturcture to guarantee their
address are contiguous.
It works for static GVs but for global hidden GVs, this will cause name
resoltion fail during linking .o into .so

Any thoughs?

Thanks,
Weiming


> Hi Weiming,
>
> On 12 March 2014 17:43, Weiming Zhao <weimingz at codeaurora.org>
wrote:
>> Clang will emit 1 GOT entry for each GV and 2 instructions to get the
>> address:
>>
>> GCC  does this only for the first GV. The rest GV address are computed
>> directly:
>
> This looks like it would be the job of lib/Transforms/GlobalMerge.cpp.
> It looks like ARM runs it in all cases, perhaps it doesn't understand
> some ELF linkage subtleties?
>
> Cheers.
>
> Tim.
>