aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-12-08 11:41:12 +0000
committerAlan Modra <amodra@gmail.com>2005-12-08 11:41:12 +0000
commit0ba079102f920283bc5cd17805c4ea70f01fe378 (patch)
treef9e295e9e038b2d0c32aefdf5face21c91e06d8b /ld/emultempl
parent362307121f3de7cbf4646f028d5c7faeafe68c94 (diff)
downloadgdb-0ba079102f920283bc5cd17805c4ea70f01fe378.zip
gdb-0ba079102f920283bc5cd17805c4ea70f01fe378.tar.gz
gdb-0ba079102f920283bc5cd17805c4ea70f01fe378.tar.bz2
bfd/
* elf32-ppc.c (struct ppc_elf_link_hash_table): Add emit_stub_syms. (ppc_elf_select_plt_layout): Add emit_stub_syms param, save to htab. (add_stub_sym): New function. (allocate_dynrelocs): Call add_stub_sym. (ppc_elf_size_dynamic_sections): Emit __glink and __glink_PLTresolve when emit_stub_syms. * elf32-ppc.h (ppc_elf_select_plt_layout): Update prototype. ld/ * emultempl/ppc32elf.em (emit_stub_syms): New var. (ppc_after_open): Pass it to ppc_elf_select_plt_layout. (PARSE_AND_LIST_PROLOGUE <OPTION_STUBSYMS>): Define. (PARSE_AND_LIST_LONGOPTS): Add emit-stub-syms. (PARSE_AND_LIST_OPTIONS): Describe emit-stub-syms. (PARSE_AND_LIST_OPTIONS): Handle it.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/ppc32elf.em14
1 files changed, 13 insertions, 1 deletions
diff --git a/ld/emultempl/ppc32elf.em b/ld/emultempl/ppc32elf.em
index e4d56de..10f9107 100644
--- a/ld/emultempl/ppc32elf.em
+++ b/ld/emultempl/ppc32elf.em
@@ -41,6 +41,9 @@ is_ppc_elf32_vec(const bfd_target * vec)
/* Whether to run tls optimization. */
static int notlsopt = 0;
+/* Whether to emit symbols for stubs. */
+static int emit_stub_syms = 0;
+
/* Chooses the correct place for .plt and .got. */
static int old_plt = 0;
static int old_got = 0;
@@ -58,7 +61,9 @@ ppc_after_open (void)
lang_output_section_statement_type *plt_os[2];
lang_output_section_statement_type *got_os[2];
- new_plt = ppc_elf_select_plt_layout (output_bfd, &link_info, old_plt);
+ emit_stub_syms |= link_info.emitrelocations;
+ new_plt = ppc_elf_select_plt_layout (output_bfd, &link_info, old_plt,
+ emit_stub_syms);
if (new_plt < 0)
einfo ("%X%P: select_plt_layout problem %E\n");
@@ -126,9 +131,11 @@ PARSE_AND_LIST_PROLOGUE='
#define OPTION_NO_TLS_OPT 301
#define OPTION_OLD_PLT 302
#define OPTION_OLD_GOT 303
+#define OPTION_STUBSYMS 304
'
PARSE_AND_LIST_LONGOPTS='
+ { "emit-stub-syms", no_argument, NULL, OPTION_STUBSYMS },
{ "no-tls-optimize", no_argument, NULL, OPTION_NO_TLS_OPT },
{ "bss-plt", no_argument, NULL, OPTION_OLD_PLT },
{ "sdata-got", no_argument, NULL, OPTION_OLD_GOT },
@@ -136,6 +143,7 @@ PARSE_AND_LIST_LONGOPTS='
PARSE_AND_LIST_OPTIONS='
fprintf (file, _("\
+ --emit-stub-syms Label linker stubs with a symbol.\n\
--no-tls-optimize Don'\''t try to optimize TLS accesses.\n\
--bss-plt Force old-style BSS PLT.\n\
--sdata-got Force GOT location just before .sdata.\n"
@@ -143,6 +151,10 @@ PARSE_AND_LIST_OPTIONS='
'
PARSE_AND_LIST_ARGS_CASES='
+ case OPTION_STUBSYMS:
+ emit_stub_syms = 1;
+ break;
+
case OPTION_NO_TLS_OPT:
notlsopt = 1;
break;