[BFD]Don't create got section while processing TLS Local Exec relocations.
Fri Oct 12 16:09:00 GMT 2018
For Local Exec TLS model, the offset of the variable from the thread pointer
can be computed at static link time. This doesn't require GOT indirection.
The initial change is a bad fix for a problem during TLS GD -> LE relaxation.
TLS GD in large memory model requires to initialize gp register by loading the
address from literal pool. And this will generate a symbol reference to _GLOBAL_OFFSET_TABLE_.
ldr x1, .Lgot
adr x2, .Lgot
add x1, x2, x1
movz x0, #:tlsgd_g1:var
movk x0, #:tlsgd_g0_nc:var
add x0, x1, x0
.dword _GLOBAL_OFFSET_TABLE_ - .
However, after the relaxation, the got section is not needed.
But we still have a reference to _GLOBAL_OFFSET_TABLE_ left behind. This reference could not be removed.
The proper fix is to check whether _GLOBAL_OFFSET_TABLE_ is referenced, create got section if yes.
And the fix is already in the repository.
So I removed the wrong fix here (sorry!).
Okay to commit and backport to release branches?
2018-10-08 Renlin Li <email@example.com>
* elfnn-aarch64.c (elfNN_aarch64_check_relocs): Don't create got
section for Local Exec TLS model.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 626 bytes
Desc: not available
More information about the Binutils