- /* If generating a relocatable output file, then we don't
- have to examine the relocs. */
- if (link_info.relocateable)
- 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_layaout_sections_again))
- {
- einfo ("%X%P: can not size stub section: %E\n");
- return;
- }
-
- /* Set the global data pointer. */
- if (! elf32_hppa_set_gp (output_bfd, &link_info))
+ int ret;
+
+ /* bfd_elf_discard_info just plays with data and debugging sections,
+ ie. doesn't affect code size, so we can delay resizing the
+ sections. It's likely we'll resize everything in the process of
+ adding stubs. */
+ ret = bfd_elf_discard_info (link_info.output_bfd, &link_info);
+ if (ret < 0)