+2003-02-18 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/ppc64elf.em (ppc_create_output_section_statements): Check
+ hash creator.
+ (ppc_before_allocation): Don't do optimizations if wrong hash table.
+ (gld${EMULATION_NAME}_finish): Ditto.
+
2003-02-17 Nick Clifton <nickc@redhat.com>
* ldmain.c (main) Default allow_shlib_undefined to true.
* scripttempl/elf32msp430_3.sc: New file. Linker script for msp430.
2002-12-30 Ralf Habacker <Ralf.Habacker@freenet.de>
- Charles Wilson <cwilson@ece.gatech.edu>
+ Charles Wilson <cwilson@ece.gatech.edu>
* ld/config.in (HAVE_REALPATH): New entry.
(HAVE_SYS_STAT_H, HAVE_SYS_TYPES_H): Removed: obsolete.
static void
ppc_create_output_section_statements ()
{
+ extern const bfd_target bfd_elf64_powerpc_vec;
+ extern const bfd_target bfd_elf64_powerpcle_vec;
+
+ if (link_info.hash->creator != &bfd_elf64_powerpc_vec
+ && link_info.hash->creator != &bfd_elf64_powerpcle_vec)
+ return;
+
stub_file = lang_add_input_file ("linker stubs",
lang_input_file_is_fake_enum,
NULL);
static void
ppc_before_allocation ()
{
- if (!ppc64_elf_edit_opd (output_bfd, &link_info))
- {
- einfo ("%X%P: can not edit opd %E\n");
- return;
- }
-
- if (ppc64_elf_tls_setup (output_bfd, &link_info) && !notlsopt)
+ if (stub_file != NULL)
{
- /* Size the sections. This is premature, but we want to know the
- TLS segment layout so that certain optimizations can be done. */
- lang_size_sections (stat_ptr->head, abs_output_section,
- &stat_ptr->head, 0, (bfd_vma) 0, NULL);
-
- if (!ppc64_elf_tls_optimize (output_bfd, &link_info))
+ if (!ppc64_elf_edit_opd (output_bfd, &link_info))
{
- einfo ("%X%P: TLS problem %E\n");
+ einfo ("%X%P: can not edit opd %E\n");
return;
}
- lang_reset_memory_regions ();
+ if (ppc64_elf_tls_setup (output_bfd, &link_info) && !notlsopt)
+ {
+ /* Size the sections. This is premature, but we want to know the
+ TLS segment layout so that certain optimizations can be done. */
+ lang_size_sections (stat_ptr->head, abs_output_section,
+ &stat_ptr->head, 0, (bfd_vma) 0, NULL);
+
+ if (!ppc64_elf_tls_optimize (output_bfd, &link_info))
+ {
+ einfo ("%X%P: TLS problem %E\n");
+ return;
+ }
+
+ lang_reset_memory_regions ();
+ }
}
gld${EMULATION_NAME}_before_allocation ();
/* If generating a relocatable output file, then we don't have any
stubs. */
- if (!link_info.relocateable)
+ if (stub_file != NULL && !link_info.relocateable)
{
int ret = ppc64_elf_setup_section_lists (output_bfd, &link_info);
if (ret != 0)
if (need_laying_out)
ppc_layout_sections_again ();
- if (stub_file->the_bfd->sections != NULL)
+ if (stub_file != NULL && stub_file->the_bfd->sections != NULL)
{
if (!ppc64_elf_build_stubs (&link_info))
einfo ("%X%P: can not build stubs: %E\n");