summaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2003-07-10 00:38:19 +0000
committerAlan Modra <amodra@gmail.com>2003-07-10 00:38:19 +0000
commit68f8ff14d1fb0bd1254ca950188a8aadc8104de4 (patch)
treef722d16b601da9b59743731ba88d35e527f12cb3 /ld/emultempl
parente717da7ead54704139ab3c160e95ed3db479d871 (diff)
downloadbinutils-gdb-68f8ff14d1fb0bd1254ca950188a8aadc8104de4.tar.gz
* emulparams/elf64ppc.sh (OTHER_GOT_SECTIONS): Don't define.
(GOT): Define. * emultempl/ppc64elf.em (stub_added): New static var. (ppc_create_output_section_statements): Call ppc64_elf_init_stub_bfd. (ppc_add_stub_section): Set stub_added. (gld${EMULATION_NAME}_finish): Look for .got rather than .toc. Adjust ppc64_elf_size_stubs call and test for stubs. * scripttempl/elf.sc (GOT): Define and use.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/ppc64elf.em8
1 files changed, 5 insertions, 3 deletions
diff --git a/ld/emultempl/ppc64elf.em b/ld/emultempl/ppc64elf.em
index dfe7932bc04..b1b3f9ef07a 100644
--- a/ld/emultempl/ppc64elf.em
+++ b/ld/emultempl/ppc64elf.em
@@ -29,6 +29,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
/* Fake input file for stubs. */
static lang_input_statement_type *stub_file;
+static int stub_added = 0;
/* Whether we need to call ppc_layout_sections_again. */
static int need_laying_out = 0;
@@ -77,6 +78,7 @@ ppc_create_output_section_statements (void)
}
ldlang_add_file (stub_file);
+ ppc64_elf_init_stub_bfd (stub_file->the_bfd, &link_info);
}
static void
@@ -232,6 +234,7 @@ ppc_add_stub_section (const char *stub_sec_name, asection *input_section)
if (info.add.head == NULL)
goto err_ret;
+ stub_added = 1;
if (hook_in_stub (&info, &os->children.head))
return stub_sec;
@@ -330,7 +333,7 @@ gld${EMULATION_NAME}_finish (void)
return;
}
- toc_section = bfd_get_section_by_name (output_bfd, ".toc");
+ toc_section = bfd_get_section_by_name (output_bfd, ".got");
if (toc_section != NULL)
lang_for_each_statement (build_toc_list);
@@ -340,7 +343,6 @@ gld${EMULATION_NAME}_finish (void)
/* Call into the BFD backend to do the real work. */
if (!ppc64_elf_size_stubs (output_bfd,
- stub_file->the_bfd,
&link_info,
group_size,
&ppc_add_stub_section,
@@ -355,7 +357,7 @@ gld${EMULATION_NAME}_finish (void)
if (need_laying_out)
ppc_layout_sections_again ();
- if (stub_file != NULL && stub_file->the_bfd->sections != NULL)
+ if (stub_added)
{
char *msg = NULL;
char *line, *endline;