aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2011-07-14 03:28:22 +0000
committerAlan Modra <amodra@gmail.com>2011-07-14 03:28:22 +0000
commit9df0ef5fe7ecd8bd8dc591ea3bdb2d3fb089d710 (patch)
treeabefb750fcd256c0732b34ed5f67fe7be4d836f2 /ld/emultempl
parentfb42df5ed908e2bb9ce52a389981ea8b1c97cdf8 (diff)
downloadgdb-9df0ef5fe7ecd8bd8dc591ea3bdb2d3fb089d710.zip
gdb-9df0ef5fe7ecd8bd8dc591ea3bdb2d3fb089d710.tar.gz
gdb-9df0ef5fe7ecd8bd8dc591ea3bdb2d3fb089d710.tar.bz2
bfd/
* elf64-ppc.c (struct ppc_link_hash_table): Add plt_static_chain. (build_plt_stub): Add plt_static_chain param, don't load r11 if false. (build_tls_get_addr_stub): Likewise. (ppc_build_one_stub): Update calls to above. (ppc_size_one_stub): Adjust stub size. (ppc64_elf_size_stubs): Add plt_static_chain param, save to htab. * elf64-ppc.h (ppc64_elf_size_stubs): Update prototype. ld/ * emultempl/ppc64elf.em (plt_static_chain): New var. (gld${EMULATION_NAME}_after_allocation): Pass to ppc64_elf_size_stubs. (PARSE_AND_LIST_PROLOGUE, PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS, PARSE_AND_LIST_ARGS_CASES): Handle --plt-static-chain and --no-plt-static-chain. ld/testsuite/ * ld-powerpc/tlsexe.d, * ld-powerpc/tlsexe.g. *ld-powerpc/tlsexe.r, * ld-powerpc/tlsexetoc.d, * ld-powerpc/tlsexetoc.g, * ld-powerpc/tlsexetoc.r, * ld-powerpc/tlsso.d, * ld-powerpc/tlstocso.d: Update for plt stub change.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/ppc64elf.em25
1 files changed, 23 insertions, 2 deletions
diff --git a/ld/emultempl/ppc64elf.em b/ld/emultempl/ppc64elf.em
index 0c99592..a57861b 100644
--- a/ld/emultempl/ppc64elf.em
+++ b/ld/emultempl/ppc64elf.em
@@ -61,6 +61,9 @@ static int no_multi_toc = 0;
/* Whether to sort input toc and got sections. */
static int no_toc_sort = 0;
+/* Set if PLT call stubs should load r11. */
+static int plt_static_chain = 0;
+
/* Whether to emit symbols for stubs. */
static int emit_stub_syms = -1;
@@ -500,7 +503,7 @@ gld${EMULATION_NAME}_after_allocation (void)
einfo ("%P: .init/.fini fragments use differing TOC pointers\n");
/* Call into the BFD backend to do the real work. */
- if (!ppc64_elf_size_stubs (&link_info, group_size))
+ if (!ppc64_elf_size_stubs (&link_info, group_size, plt_static_chain))
einfo ("%X%P: can not size stub section: %E\n");
}
}
@@ -651,7 +654,9 @@ fi
#
PARSE_AND_LIST_PROLOGUE='
#define OPTION_STUBGROUP_SIZE 301
-#define OPTION_STUBSYMS (OPTION_STUBGROUP_SIZE + 1)
+#define OPTION_PLT_STATIC_CHAIN (OPTION_STUBGROUP_SIZE + 1)
+#define OPTION_NO_PLT_STATIC_CHAIN (OPTION_PLT_STATIC_CHAIN + 1)
+#define OPTION_STUBSYMS (OPTION_NO_PLT_STATIC_CHAIN + 1)
#define OPTION_NO_STUBSYMS (OPTION_STUBSYMS + 1)
#define OPTION_DOTSYMS (OPTION_NO_STUBSYMS + 1)
#define OPTION_NO_DOTSYMS (OPTION_DOTSYMS + 1)
@@ -666,6 +671,8 @@ PARSE_AND_LIST_PROLOGUE='
PARSE_AND_LIST_LONGOPTS='
{ "stub-group-size", required_argument, NULL, OPTION_STUBGROUP_SIZE },
+ { "plt-static-chain", no_argument, NULL, OPTION_PLT_STATIC_CHAIN },
+ { "no-plt-static-chain", no_argument, NULL, OPTION_NO_PLT_STATIC_CHAIN },
{ "emit-stub-syms", no_argument, NULL, OPTION_STUBSYMS },
{ "no-emit-stub-syms", no_argument, NULL, OPTION_NO_STUBSYMS },
{ "dotsyms", no_argument, NULL, OPTION_DOTSYMS },
@@ -691,6 +698,12 @@ PARSE_AND_LIST_OPTIONS='
choose suitable defaults.\n"
));
fprintf (file, _("\
+ --plt-static-chain PLT call stubs should load r11.\n"
+ ));
+ fprintf (file, _("\
+ --no-plt-static-chain PLT call stubs should not load r11. (default)\n"
+ ));
+ fprintf (file, _("\
--emit-stub-syms Label linker stubs with a symbol.\n"
));
fprintf (file, _("\
@@ -739,6 +752,14 @@ PARSE_AND_LIST_ARGS_CASES='
}
break;
+ case OPTION_PLT_STATIC_CHAIN:
+ plt_static_chain = 1;
+ break;
+
+ case OPTION_NO_PLT_STATIC_CHAIN:
+ plt_static_chain = 0;
+ break;
+
case OPTION_STUBSYMS:
emit_stub_syms = 1;
break;