New user self-registration is disabled due to spam. For an account please email bugs-admin@lists.llvm.org with your e-mail address and full name.

Bug 36727 - Add support for R_AARCH64_TLSLE_LDST8_TPREL_LO12 relocation.
Summary: Add support for R_AARCH64_TLSLE_LDST8_TPREL_LO12 relocation.
Status: RESOLVED FIXED
Alias: None
Product: lld
Classification: Unclassified
Component: ELF (show other bugs)
Version: unspecified
Hardware: PC Linux
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-14 07:04 PDT by Peter Smith
Modified: 2018-08-09 01:51 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Smith 2018-03-14 07:04:26 PDT
In https://reviews.llvm.org/D44355 an attempt was made to fold the sequence:

mrs x1, TPIDR_EL0
add x2, x1, :tprel_hi12:local_exec_var
add x3, x2, :tprel_lo12_nc:local_exec_var
ldr w0, [x3]

to:

mrs x1, TPIDR_EL0
add x2, x1, :tprel_hi12:local_exec_var
ldr w0, [x2, :tprel_lo12_nc:local_exec_var]

Which unfortunately had to be reverted for ELF because no ELF linker supported the R_AARCH64_TLSLE_LDST8_TPREL_LO12 relocation that is needed for:
ldr w0, [x2, :tprel_lo12_nc:local_exec_var].

Existing ELF linkers only implement R_AARCH64_TLSLE_ADD_TPREL_LO12_NC to support
add x3, x2, :tprel_lo12_nc:local_exec_var

It would be nice to implement this relocation to eventually enable this relaxation to be done for ELF targets. This will take some time as support will need to be added to the binutils linkers as well.
Comment 1 Ryan Prichard 2018-08-08 21:36:13 PDT
Support for the relocations was added in https://reviews.llvm.org/D46255.

Can this issue be closed now?
Comment 2 Peter Smith 2018-08-09 01:51:48 PDT
Yes, my apologies I should have resolved this when committing the fix.