diff options
author | Alan Modra <amodra@gmail.com> | 2015-09-18 16:17:49 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2015-09-18 16:38:03 +0930 |
commit | 7c9cf4158452094f4c463676e5122c5c4ce64de8 (patch) | |
tree | 0ffa90631c601f42f7c88145c3faef48e8d6fdab /ld/emultempl/ppc64elf.em | |
parent | 975f8a9e3144e4d3d3f391e907c8bf94b23dc8b6 (diff) | |
download | gdb-7c9cf4158452094f4c463676e5122c5c4ce64de8.zip gdb-7c9cf4158452094f4c463676e5122c5c4ce64de8.tar.gz gdb-7c9cf4158452094f4c463676e5122c5c4ce64de8.tar.bz2 |
Add PowerPC64 ld --tls-get-addr-optimize.
Sometimes it may be of benefit to force use of the __tls_get_addr_opt
call stub even when the glibc being used during linking does not
advertise __tls_get_addr_opt.
bfd/
* elf64-ppc.h (struct ppc64_elf_params <tls_get_addr_opt>): Rename
from no_tls_get_addr_opt.
* elf64-ppc.c: Update for rename and inversion of tls_get_addr_opt.
(ppc64_elf_tls_setup): Set tls_get_addr_opt to 0 only when at
default of -1.
ld/
* emultempl/ppc64elf.em (params): Init tls_get_addr_opt field to -1.
(OPTION_TLS_GET_ADDR_OPT): Define.
(PARSE_AND_LIST_LONGOPTS): Handle --tls-get-addr-opt.
(PARSE_AND_LIST_OPTIONS, PARSE_AND_LIST_ARGS_CASES): Likewise.
* ld.texinfo: Document --tls-get-addr-optimize and
--no-tls-get-addr-optimize.
Diffstat (limited to 'ld/emultempl/ppc64elf.em')
-rw-r--r-- | ld/emultempl/ppc64elf.em | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/ld/emultempl/ppc64elf.em b/ld/emultempl/ppc64elf.em index 41942f9..08bd5d4 100644 --- a/ld/emultempl/ppc64elf.em +++ b/ld/emultempl/ppc64elf.em @@ -37,7 +37,7 @@ static void ppc_layout_sections_again (void); static struct ppc64_elf_params params = { NULL, &ppc_add_stub_section, &ppc_layout_sections_again, - 1, 0, 0, + 1, -1, 0, ${DEFAULT_PLT_STATIC_CHAIN-0}, -1, 0, 0, -1, -1, 0}; @@ -699,7 +699,8 @@ PARSE_AND_LIST_PROLOGUE=${PARSE_AND_LIST_PROLOGUE}' #define OPTION_DOTSYMS (OPTION_NO_SAVRES + 1) #define OPTION_NO_DOTSYMS (OPTION_DOTSYMS + 1) #define OPTION_NO_TLS_OPT (OPTION_NO_DOTSYMS + 1) -#define OPTION_NO_TLS_GET_ADDR_OPT (OPTION_NO_TLS_OPT + 1) +#define OPTION_TLS_GET_ADDR_OPT (OPTION_NO_TLS_OPT + 1) +#define OPTION_NO_TLS_GET_ADDR_OPT (OPTION_TLS_GET_ADDR_OPT + 1) #define OPTION_NO_OPD_OPT (OPTION_NO_TLS_GET_ADDR_OPT + 1) #define OPTION_NO_TOC_OPT (OPTION_NO_OPD_OPT + 1) #define OPTION_NO_MULTI_TOC (OPTION_NO_TOC_OPT + 1) @@ -722,6 +723,7 @@ PARSE_AND_LIST_LONGOPTS=${PARSE_AND_LIST_LONGOPTS}' { "save-restore-funcs", no_argument, NULL, OPTION_SAVRES }, { "no-save-restore-funcs", no_argument, NULL, OPTION_NO_SAVRES }, { "no-tls-optimize", no_argument, NULL, OPTION_NO_TLS_OPT }, + { "tls-get-addr-optimize", no_argument, NULL, OPTION_TLS_GET_ADDR_OPT }, { "no-tls-get-addr-optimize", no_argument, NULL, OPTION_NO_TLS_GET_ADDR_OPT }, { "no-opd-optimize", no_argument, NULL, OPTION_NO_OPD_OPT }, { "no-toc-optimize", no_argument, NULL, OPTION_NO_TOC_OPT }, @@ -786,6 +788,9 @@ PARSE_AND_LIST_OPTIONS=${PARSE_AND_LIST_OPTIONS}' --no-tls-optimize Don'\''t try to optimize TLS accesses.\n" )); fprintf (file, _("\ + --tls-get-addr-optimize Force use of special __tls_get_addr call.\n" + )); + fprintf (file, _("\ --no-tls-get-addr-optimize Don'\''t use a special __tls_get_addr call.\n" )); fprintf (file, _("\ @@ -877,8 +882,12 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}' no_tls_opt = 1; break; + case OPTION_TLS_GET_ADDR_OPT: + params.tls_get_addr_opt = 1; + break; + case OPTION_NO_TLS_GET_ADDR_OPT: - params.no_tls_get_addr_opt = 1; + params.tls_get_addr_opt = 0; break; case OPTION_NO_OPD_OPT: @@ -903,7 +912,7 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}' case OPTION_TRADITIONAL_FORMAT: no_tls_opt = 1; - params.no_tls_get_addr_opt = 1; + params.tls_get_addr_opt = 0; no_opd_opt = 1; no_toc_opt = 1; params.no_multi_toc = 1; |