This is an archive of the discontinued LLVM Phabricator instance.

[ELF/AArch64] Fix correct TCB aligment calculation
AbandonedPublic

Authored by zatrazz on May 28 2015, 7:12 AM.

Details

Summary

This patch fixes the TLS local relocations alignment done by @238258.
As pointed out, the TLS size should not be considered, but rather the
TCB size based on maximum output segment alignment. Although it has
not shown in the TLS simple cases for test-suite, more comprehensible
tests with more local TLS variable showed wrong relocations values
being generated.

The local TLS testcase is expanded to add more tls variable (both
exported and static) initialized or not.

Diff Detail

Event Timeline

zatrazz updated this revision to Diff 26682.May 28 2015, 7:12 AM
zatrazz retitled this revision from to [ELF/AArch64] Fix correct TCB aligment calculation.
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).
ruiu accepted this revision.May 28 2015, 10:22 AM
ruiu edited edge metadata.

LGTM

lib/ReaderWriter/ELF/AArch64/AArch64TargetHandler.h
29

I'd invert the condition to return early.

30

Could you use the actual type instead of auto because the type is not obvious?

This revision is now accepted and ready to land.May 28 2015, 10:22 AM
shankarke added inline comments.
lib/ReaderWriter/ELF/AArch64/AArch64TargetHandler.h
31–35

This is wrong. You shouldnt be using maximum alignment of all sections in the output.

Address review comments:

  • Changed 'auto' for the explicit type name
  • Consider just TLS segments for maximum alignment.

zatrazz abandoned this revision.May 29 2015, 6:15 AM