[llvm] r226503 - Add r224985 back with fixes.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Feb 12 10:13:22 PST 2015


> The section contains just pointers (to classes) (like a GOT). The linker coalesces duplicate pointers across translation units.  The linker knows to break up the section into pointer sized atoms, regardless of labels.
>
> The problem is that the assembler is adding a ltmpNNN label at the start of the section, then using extern relocations to reference any pointer.  For instance an ADRP to the third pointer in the section looks to the linker like:
>      ADRP x8, ltmp123 + 16
>
> The symbol ltmp123 gets associated with the first pointer, after coalescing  ltmp123 + 16 can wind up pointing to the wrong pointer.
>
> It might work to have zero labels in that section (although that has not been tested), or to have labels on each pointer (for use by the ADRP references).

Makes sense. Would using internal relocations work?

The attached patch goes the way of using the original symbol.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: text/x-patch
Size: 2139 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150212/ce3cc424/attachment.bin>


More information about the llvm-commits mailing list