This is an archive of the discontinued LLVM Phabricator instance.

[lld] [ELF/AArch64] Fix local TLS relocations
ClosedPublic

Authored by zatrazz on May 26 2015, 5:19 AM.

Details

Summary

This patch fixes the R_AARCH64_TLSLE_ADD_TPREL_HI12 and R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
handling by using the correct offset by using the target layout along with
aarch64 alignments requirements.

It fixes the TLS test-suite SingleSource failures for aarch64:

  • SingleSource/UnitTests/Threads/2010-12-08-tls.execution_time
  • SingleSource/UnitTests/Threads/tls.execution_time

Diff Detail

Event Timeline

zatrazz updated this revision to Diff 26505.May 26 2015, 5:19 AM
zatrazz retitled this revision from to [lld] [ELF/AArch64] Fix local TLS relocations.
zatrazz updated this object.
zatrazz edited the test plan for this revision. (Show Details)
zatrazz added reviewers: ruiu, shankar.easwaran.
zatrazz added a project: lld.
zatrazz added subscribers: lld, Unknown Object (MLST).
shankarke added inline comments.
lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.cpp
476–479

can you move the case statement to a new line ?

477

Do relocations increase the size of the initial TLS image ? Confused.

ruiu accepted this revision.May 26 2015, 10:57 AM
ruiu edited edge metadata.

LGTM

lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.h
31

Let's use C++11 non-member initialization:

mutable uint64_t _tlsSize = 0;
This revision is now accepted and ready to land.May 26 2015, 10:57 AM
zatrazz closed this revision.May 28 2015, 7:10 AM