(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.
+2003-07-10 Alan Modra <amodra@bigpond.net.au>
+
+ * 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.
+
2003-07-08 J"orn Rennecke <joern.rennecke@superh.com>
* emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_after_allocation):
.tocbss ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { *(.tocbss)}"
OTHER_PLT_RELOC_SECTIONS="
.rela.tocbss ${RELOCATING-0} : { *(.rela.tocbss) }"
-OTHER_GOT_SECTIONS="
- .toc ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { *(.toc) }"
+GOT="
+ .got ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { *(.got .toc) }"
OTHER_GOT_RELOC_SECTIONS="
.rela.toc ${RELOCATING-0} : { *(.rela.toc) }"
OTHER_READWRITE_SECTIONS="
/* 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;
}
ldlang_add_file (stub_file);
+ ppc64_elf_init_stub_bfd (stub_file->the_bfd, &link_info);
}
static void
if (info.add.head == NULL)
goto err_ret;
+ stub_added = 1;
if (hook_in_stub (&info, &os->children.head))
return stub_sec;
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);
/* 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,
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;
fi
INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }"
+test -z "$GOT" && GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }"
DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }"
.jcr ${RELOCATING-0} : { KEEP (*(.jcr)) }
${DATA_PLT+${PLT}}
${RELOCATING+${OTHER_GOT_SYMBOLS}}
- .got ${RELOCATING-0} : { *(.got.plt) *(.got) }
+ ${GOT}
${OTHER_GOT_SECTIONS}
${CREATE_SHLIB+${SDATA2}}
${CREATE_SHLIB+${SBSS2}}