aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl/hppaelf.em
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-11-12 07:56:38 +0000
committerAlan Modra <amodra@gmail.com>2002-11-12 07:56:38 +0000
commit836c6af1fd7e0872c86db24d7b8503af8c7a8bb6 (patch)
treeb7f6980adbed524d264fdf511a7860d9a2165384 /ld/emultempl/hppaelf.em
parentd6fe2dc1025ff668354949649d24933115b1b570 (diff)
downloadfsf-binutils-gdb-836c6af1fd7e0872c86db24d7b8503af8c7a8bb6.zip
fsf-binutils-gdb-836c6af1fd7e0872c86db24d7b8503af8c7a8bb6.tar.gz
fsf-binutils-gdb-836c6af1fd7e0872c86db24d7b8503af8c7a8bb6.tar.bz2
* emultempl/ppc64elf.em (ppc_before_allocation): New function.
(LDEMUL_BEFORE_ALLOCATION): Define. (gld${EMULATION_NAME}_finish): Run discard_info for relocatable linking. * emultemp/hppaelf.em ((gld${EMULATION_NAME}_finish): Likewise.
Diffstat (limited to 'ld/emultempl/hppaelf.em')
-rw-r--r--ld/emultempl/hppaelf.em72
1 files changed, 37 insertions, 35 deletions
diff --git a/ld/emultempl/hppaelf.em b/ld/emultempl/hppaelf.em
index 490ff07..394f28e 100644
--- a/ld/emultempl/hppaelf.em
+++ b/ld/emultempl/hppaelf.em
@@ -263,13 +263,6 @@ build_section_lists (statement)
static void
gld${EMULATION_NAME}_finish ()
{
- int ret;
-
- /* If generating a relocatable output file, then we don't
- have to examine the relocs. */
- if (link_info.relocateable)
- return;
-
/* bfd_elf32_discard_info just plays with debugging sections,
ie. doesn't affect any code, so we can delay resizing the
sections. It's likely we'll resize everything in the process of
@@ -277,46 +270,55 @@ gld${EMULATION_NAME}_finish ()
if (bfd_elf${ELFSIZE}_discard_info (output_bfd, &link_info))
need_laying_out = 1;
- ret = elf32_hppa_setup_section_lists (output_bfd, &link_info);
- if (ret != 0)
+ /* If generating a relocatable output file, then we don't
+ have to examine the relocs. */
+ if (! link_info.relocateable)
{
- if (ret < 0)
+ int ret = elf32_hppa_setup_section_lists (output_bfd, &link_info);
+
+ if (ret != 0)
{
- einfo ("%X%P: can not size stub section: %E\n");
- return;
- }
+ if (ret < 0)
+ {
+ einfo ("%X%P: can not size stub section: %E\n");
+ return;
+ }
- lang_for_each_statement (build_section_lists);
+ lang_for_each_statement (build_section_lists);
- /* Call into the BFD backend to do the real work. */
- if (! elf32_hppa_size_stubs (output_bfd,
- stub_file->the_bfd,
- &link_info,
- multi_subspace,
- group_size,
- &hppaelf_add_stub_section,
- &hppaelf_layout_sections_again))
- {
- einfo ("%X%P: can not size stub section: %E\n");
- return;
+ /* Call into the BFD backend to do the real work. */
+ if (! elf32_hppa_size_stubs (output_bfd,
+ stub_file->the_bfd,
+ &link_info,
+ multi_subspace,
+ group_size,
+ &hppaelf_add_stub_section,
+ &hppaelf_layout_sections_again))
+ {
+ einfo ("%X%P: can not size stub section: %E\n");
+ return;
+ }
}
}
if (need_laying_out)
hppaelf_layout_sections_again ();
- /* Set the global data pointer. */
- if (! elf32_hppa_set_gp (output_bfd, &link_info))
+ if (! link_info.relocateable)
{
- einfo ("%X%P: can not set gp\n");
- return;
- }
+ /* Set the global data pointer. */
+ if (! elf32_hppa_set_gp (output_bfd, &link_info))
+ {
+ einfo ("%X%P: can not set gp\n");
+ return;
+ }
- /* Now build the linker stubs. */
- if (stub_file->the_bfd->sections != NULL)
- {
- if (! elf32_hppa_build_stubs (&link_info))
- einfo ("%X%P: can not build stubs: %E\n");
+ /* Now build the linker stubs. */
+ if (stub_file->the_bfd->sections != NULL)
+ {
+ if (! elf32_hppa_build_stubs (&link_info))
+ einfo ("%X%P: can not build stubs: %E\n");
+ }
}
}