Page MenuHomePhabricator

[lld] [ELF/AArch64] Fix TLS IE to LE relax for local symbols
AbandonedPublic

Authored by zatrazz on Mar 9 2016, 8:19 PM.

Details

Reviewers
ruiu
rafael
Summary

This patch fix the TLS relax optimization when transforming Initial-Exec
to Local-Exec for local symbols (which can not be preempted).

Diff Detail

Event Timeline

zatrazz updated this revision to Diff 50229.Mar 9 2016, 8:19 PM
zatrazz retitled this revision from to [lld] [ELF/AArch64] Fix TLS IE to LE relax for local symbols.
zatrazz updated this object.
zatrazz added reviewers: ruiu, rafael.
zatrazz set the repository for this revision to rL LLVM.
zatrazz added a project: lld.
zatrazz added subscribers: llvm-commits, grimar, rengolin, emaste.
ruiu added inline comments.Mar 9 2016, 10:10 PM
ELF/Target.cpp
1474

What is this change for?

grimar added inline comments.Mar 10 2016, 1:09 AM
test/ELF/aarch64-tls-iele.s
15

Please align accordinly, remove space after ':'

11000: 00 00 a0 d2     movz    x0, #0, lsl #16
11004: 80 02 80 f2     movk    x0, #0x14
11008: 00 00 a0 d2     movz    x0, #0, lsl #16

Second is that you probably want to use "CHECK-NEXT":

# CHECK:            11000:  00 00 a0 d2     movz    x0, #0, lsl #16
# CHECK-NEXT:  11004:  80 02 80 f2      movk    x0, #0x14
# CHECK-NEXT:  11008:  00 00 a0 d2     movz    x0, #0, lsl #16

And the last is that this testcase contains different spacing style:
"# RUN" vs "#CHECK" for example. Please choose one style to follow in a single test. That probably should be fixed separatelly.

zatrazz added inline comments.Mar 10 2016, 1:37 AM
ELF/Target.cpp
1474

The logic is wrong for local symbols, where S is nullptr. At ELF/InputSection.cpp:219, if the Body is nullptr then it uses getLocalRelTarget. Also the change on 'AArch64TargetInfo::needsGot' is to make the same code uses getVA instead of getGotVA.

test/ELF/aarch64-tls-iele.s
15

Yes, the spacing is weird, I will fix it.

zatrazz updated this revision to Diff 50389.Mar 10 2016, 6:55 PM
zatrazz removed rL LLVM as the repository for this revision.

Fix format issues.

zatrazz updated this revision to Diff 50729.Mar 15 2016, 7:08 AM

Rebase against trunk and ping.

zatrazz abandoned this revision.Mar 21 2016, 2:12 PM

Ping.

You abandoned this. I guess that was mistake ?