[PATCH] D24827: [ARM][LLD] ARM TLS shouldn't use relaxations

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 22 06:58:35 PDT 2016


peter.smith created this revision.
peter.smith added reviewers: ruiu, rafael.
peter.smith added subscribers: atanasyan, ed, llvm-commits.
Herald added subscribers: samparker, rengolin, aemerson.

Disable all relaxations for ARM TLS

The ARM TLS relocations are placed on literal data and not the code-sequence, it is therefore not possible to implement the relaxTls* functions. The Mips Target also does not do TLS relaxation and has a separate handleMipsTlsRelocation() function to keep handleTlsRelocation() clean from target specific hooks. I've chosen to rename handleMipsTlsRelocation() to handleNoRelaxTlsRelocation() so that it can be used for both ARM and Mips.

Unfortunately there are some differences in ARM and Mips target handling as there are some cases where Mips can omit a dynamic relocation where ARM cannot. I tried some experiments to see if I could get away without these changes, but they caused segfaults at runtime. The Mips code should be logically identical to what it was before.

There is still some work to be done for ARM TLS and static linking, I'll address this separately as it is a smaller use case.  

The 4 test cases will fail assertions without these changes. 

This should address PR30218 (https://llvm.org/bugs/show_bug.cgi?id=30218)

https://reviews.llvm.org/D24827

Files:
  ELF/Relocations.cpp
  test/ELF/Inputs/arm-tls-get-addr.s
  test/ELF/arm-tls-norelax-gd-ie.s
  test/ELF/arm-tls-norelax-gd-le.s
  test/ELF/arm-tls-norelax-ie-le.s
  test/ELF/arm-tls-norelax-ld-le.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24827.72160.patch
Type: text/x-patch
Size: 8728 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160922/00090b0d/attachment.bin>


More information about the llvm-commits mailing list