(bfd *, sec_ptr) ATTRIBUTE_HIDDEN;
extern long _bfd_elf_canonicalize_reloc
(bfd *, sec_ptr, arelent **, asymbol **) ATTRIBUTE_HIDDEN;
-extern asection * _bfd_elf_get_dynamic_reloc_section
- (bfd *, asection *, bool) ATTRIBUTE_HIDDEN;
extern asection * _bfd_elf_make_dynamic_reloc_section
(asection *, bfd *, unsigned int, bfd *, bool) ATTRIBUTE_HIDDEN;
extern long _bfd_elf_get_dynamic_reloc_upper_bound
dynobj = elf_hash_table (info)->dynobj;
sgot = NULL;
splt = NULL;
- sreloc = NULL;
switch (r_type)
{
/* When generating a shared object, these relocations are
copied into the output file to be resolved at run
time. */
+ sreloc = elf_section_data (input_section)->sreloc;
if (sreloc == NULL)
- {
- sreloc = _bfd_elf_get_dynamic_reloc_section
- (input_bfd, input_section, /*rela?*/ true);
- if (sreloc == NULL)
- return false;
- }
+ return false;
skip = false;
bfd_byte *loc;
bool skip = false;
bool relocate = false;
- asection *sreloc = _bfd_elf_get_dynamic_reloc_section
- (input_bfd, input_section,
- /*RELA*/ true);
+ asection *sreloc = elf_section_data (input_section)->sreloc;
BFD_ASSERT (sreloc != NULL);
bfd_vma * local_tlsdesc_gotents;
asection * sgot;
asection * splt;
- asection * sreloc = NULL;
+ asection * sreloc;
asection * srelgot;
bfd_vma addend;
bfd_signed_vma signed_addend;
}
*unresolved_reloc_p = false;
-
- if (sreloc == NULL && globals->root.dynamic_sections_created)
- {
- sreloc = _bfd_elf_get_dynamic_reloc_section (input_bfd, input_section,
- ! globals->use_rel);
-
- if (sreloc == NULL)
- return bfd_reloc_notsupported;
- }
-
skip = false;
relocate = false;
if (isrofixup)
arm_elf_add_rofixup (output_bfd, globals->srofixup, outrel.r_offset);
else
- elf32_arm_add_dynreloc (output_bfd, info, sreloc, &outrel);
+ {
+ sreloc = elf_section_data (input_section)->sreloc;
+ if (sreloc == NULL)
+ return bfd_reloc_notsupported;
+ elf32_arm_add_dynreloc (output_bfd, info, sreloc, &outrel);
+ }
/* If this reloc is against an external symbol, we do not want to
fiddle with the addend. Otherwise, we need to include the symbol
are copied into the output file to be resolved at run
time. */
+ sreloc = elf_section_data (input_section)->sreloc;
+ /* The section should have been created in cris_elf_check_relocs,
+ but that function will not be called for objects which fail in
+ cris_elf_merge_private_bfd_data. */
if (sreloc == NULL)
{
- sreloc = _bfd_elf_get_dynamic_reloc_section
- (dynobj, input_section, /*rela?*/ true);
- /* The section should have been created in cris_elf_check_relocs,
- but that function will not be called for objects which fail in
- cris_elf_merge_private_bfd_data. */
- if (sreloc == NULL)
- {
- bfd_set_error (bfd_error_bad_value);
- return false;
- }
+ bfd_set_error (bfd_error_bad_value);
+ return false;
}
skip = false;
{
for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
{
- asection *sreloc
- = _bfd_elf_get_dynamic_reloc_section (elf_hash_table (info)
- ->dynobj,
- s->section,
- /*rela?*/ true);
+ asection *sreloc = elf_section_data (s->section)->sreloc;
sreloc->size -= s->count * sizeof (Elf32_External_Rela);
}
return true;
sgot = htab->sgot;
splt = htab->splt;
- sreloc = NULL;
rel = relocs;
relend = relocs + input_section->reloc_count;
/* When generating a shared object, these relocations
are copied into the output file to be resolved at run
time. */
+ sreloc = elf_section_data (input_section)->sreloc;
if (sreloc == NULL)
- {
- sreloc = _bfd_elf_get_dynamic_reloc_section
- (input_bfd, input_section, /*rela?*/ true);
- if (sreloc == NULL)
- return false;
- }
+ return false;
skip = false;
relocate = false;
asection *sgot = NULL;
asection *sgotplt = NULL;
asection *splt = NULL;
- asection *sreloc = NULL;
+ asection *sreloc;
asection *srelgot = NULL;
bool is_vxworks_tls;
unsigned isec_segment, got_segment, plt_segment, check_segment[2];
are copied into the output file to be resolved at run
time. */
+ sreloc = elf_section_data (input_section)->sreloc;
if (sreloc == NULL)
- {
- sreloc = _bfd_elf_get_dynamic_reloc_section
- (input_bfd, input_section, /*rela?*/ true);
- if (sreloc == NULL)
- return false;
- }
+ return false;
skip = false;
relocate = false;
goto final_link_relocate;
}
+ sreloc = elf_section_data (input_section)->sreloc;
if (sreloc == NULL)
- {
- sreloc = _bfd_elf_get_dynamic_reloc_section
- (input_bfd, input_section, /*rela?*/ true);
- if (sreloc == NULL)
- return false;
- }
+ return false;
if (h == NULL || h->dynindx == -1)
indx = 0;
sgot = NULL;
splt = NULL;
sgotplt = NULL;
- sreloc = NULL;
rel = relocs;
relend = relocs + input_section->reloc_count;
/* When generating a shared object, these relocations
are copied into the output file to be resolved at run
time. */
+ sreloc = elf_section_data (input_section)->sreloc;
if (sreloc == NULL)
- {
- sreloc = _bfd_elf_get_dynamic_reloc_section
- (input_bfd, input_section, /*rela?*/ true);
- if (sreloc == NULL)
- return false;
- }
+ return false;
skip = false;
relocate = false;
return name;
}
-/* Returns the dynamic reloc section associated with SEC.
- If necessary compute the name of the dynamic reloc section based
- on SEC's name (looked up in ABFD's string table) and the setting
- of IS_RELA. */
-
-asection *
-_bfd_elf_get_dynamic_reloc_section (bfd *abfd,
- asection *sec,
- bool is_rela)
-{
- asection *reloc_sec = elf_section_data (sec)->sreloc;
-
- if (reloc_sec == NULL)
- {
- const char *name = get_dynamic_reloc_section_name (abfd, sec, is_rela);
-
- if (name != NULL)
- {
- reloc_sec = bfd_get_linker_section (abfd, name);
-
- if (reloc_sec != NULL)
- elf_section_data (sec)->sreloc = reloc_sec;
- }
- }
-
- return reloc_sec;
-}
-
/* Returns the dynamic reloc section associated with SEC. If the
section does not exist it is created and attached to the DYNOBJ
bfd and stored in the SRELOC field of SEC's elf_section_data