[GOLD] PowerPC --no-tls-optimize
authorAlan Modra <amodra@gmail.com>
Mon, 31 Jul 2017 10:23:49 +0000 (19:53 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 31 Jul 2017 10:23:49 +0000 (19:53 +0930)
commitaacb3b6dfc7a9162a049dada22f1079809188f02
tree168b902e162823b580f5c3041515e9b2a13d020f
parent54387c7fe27848e41a51c1eccc6a24b3d6d3441f
[GOLD] PowerPC --no-tls-optimize

This adds a --no-tls-optimize option for people who want to keep
__tls_get_addr calls in an executable rather than optimizing such code
sequences to IE/LE.

Also tidy some formatting errors, rename a variable to better reflect
its use, and tweak two functions that create pairs of GOT entries to
first check whether the GOT entry already exists before potentially
inserting the header via reserve(2).  Without the check it is possible
to waste one GOT entry.

* options.h (no_tls_optimize): New powerpc option.
* powerpc.cc (Target_powerpc::abiversion, set_abiversion): Formatting.
(Target_powerpc::stk_toc): Formatting, fix comment.
(Target_powerpc::Track_tls::tls_get_addr_state): Rename from
tls_get_addr.
(Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
Return TLSOPT_NONE when !tls_optimize.
(Target_powerpc::add_global_pair_with_rel): Check
for existing reloc before reserving.
(Target_powerpc::add_local_tls_pair): Likewise.
gold/ChangeLog
gold/options.h
gold/powerpc.cc