return _bfd_elf_adjust_dynamic_copy (info, h, s);
}
\f
-/* This function is called after all the input files have been read,
- and the input sections have been assigned to output sections. We
- check for any mips16 stub sections that we can discard. */
-
-bool
-_bfd_mips_elf_early_size_sections (bfd *output_bfd,
- struct bfd_link_info *info)
-{
- asection *sect;
- struct mips_elf_link_hash_table *htab;
- struct mips_htab_traverse_info hti;
-
- htab = mips_elf_hash_table (info);
- BFD_ASSERT (htab != NULL);
-
- /* The .reginfo section has a fixed size. */
- sect = bfd_get_section_by_name (output_bfd, ".reginfo");
- if (sect != NULL)
- {
- bfd_set_section_size (sect, sizeof (Elf32_External_RegInfo));
- sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS;
- }
-
- /* The .MIPS.abiflags section has a fixed size. */
- sect = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags");
- if (sect != NULL)
- {
- bfd_set_section_size (sect, sizeof (Elf_External_ABIFlags_v0));
- sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS;
- }
-
- hti.info = info;
- hti.output_bfd = output_bfd;
- hti.error = false;
- mips_elf_link_hash_traverse (mips_elf_hash_table (info),
- mips_elf_check_symbols, &hti);
- if (hti.error)
- return false;
-
- return true;
-}
-
/* If the link uses a GOT, lay it out and work out its size. */
static bool
return true;
}
-/* Set the sizes of the dynamic sections. */
+/* Set the sizes of the dynamic sections, some mips non-dynamic sections,
+ and check for any mips16 stub sections that we can discard. */
bool
_bfd_mips_elf_late_size_sections (bfd *output_bfd,
asection *s, *sreldyn;
bool reltext;
struct mips_elf_link_hash_table *htab;
+ struct mips_htab_traverse_info hti;
htab = mips_elf_hash_table (info);
BFD_ASSERT (htab != NULL);
- dynobj = elf_hash_table (info)->dynobj;
+
+ /* The .reginfo section has a fixed size. */
+ s = bfd_get_section_by_name (output_bfd, ".reginfo");
+ if (s != NULL)
+ {
+ bfd_set_section_size (s, sizeof (Elf32_External_RegInfo));
+ s->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS;
+ }
+
+ /* The .MIPS.abiflags section has a fixed size. */
+ s = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags");
+ if (s != NULL)
+ {
+ bfd_set_section_size (s, sizeof (Elf_External_ABIFlags_v0));
+ s->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS;
+ }
+
+ hti.info = info;
+ hti.output_bfd = output_bfd;
+ hti.error = false;
+ mips_elf_link_hash_traverse (htab, mips_elf_check_symbols, &hti);
+ if (hti.error)
+ return false;
+
+ dynobj = htab->root.dynobj;
if (dynobj == NULL)
return true;
- if (elf_hash_table (info)->dynamic_sections_created)
+ if (htab->root.dynamic_sections_created)
{
/* Set the contents of the .interp section to the interpreter. */
if (bfd_link_executable (info) && !info->nointerp)
}
}
else if (bfd_link_executable (info)
- && ! mips_elf_hash_table (info)->use_rld_obj_head
+ && !htab->use_rld_obj_head
&& startswith (name, ".rld_map"))
{
/* We add a room for __rld_map. It will be filled in by the
}
else if (SGI_COMPAT (output_bfd)
&& startswith (name, ".compact_rel"))
- s->size += mips_elf_hash_table (info)->compact_rel_size;
+ s->size += htab->compact_rel_size;
else if (s == htab->root.splt)
{
/* If the last PLT entry has a branch delay slot, allocate
}
}
- if (elf_hash_table (info)->dynamic_sections_created)
+ if (htab->root.dynamic_sections_created)
{
/* Add some entries to the .dynamic section. We fill in the
values later, in _bfd_mips_elf_finish_dynamic_sections, but we
input_section->flags &= ~SEC_HAS_CONTENTS;
}
- /* Size has been set in _bfd_mips_elf_early_size_sections. */
+ /* Size has been set in _bfd_mips_elf_late_size_sections. */
BFD_ASSERT(o->size == sizeof (Elf_External_ABIFlags_v0));
/* Skip this section later on (I don't think this currently
input_section->flags &= ~SEC_HAS_CONTENTS;
}
- /* Size has been set in _bfd_mips_elf_early_size_sections. */
+ /* Size has been set in _bfd_mips_elf_late_size_sections. */
BFD_ASSERT(o->size == sizeof (Elf32_External_RegInfo));
/* Skip this section later on (I don't think this currently