This largely mechanical patch is preparation for a followup patch.
For quite some time I've thought that it would be useful to call
elf_backend_size_dynamic_sections even when no dynamic objects are
seen by the linker. That's what this patch does, with some renaming.
There are no functional changes to the linker, just a move of the
dynobj test in bfd_elf_size_dynamic_sections to target backend
functions, replacing the asserts/aborts already there. No doubt some
of the current always_size_sections functions could be moved to
size_dynamic_sections but I haven't made that change.
Because both hooks are now always called, I have renamed
always_size_sections to early_size_sections and size_dynamic_sections
to late_size_sections. I condisdered calling late_size_sections plain
size_sections, since this is the usual target dynamic section sizing
hook, but decided that searching the sources for "size_sections" would
then hit early_size_sections and other functions.
/* The ADJUST_DYNAMIC_SYMBOL function is called by the ELF backend
linker for every symbol which is defined by a dynamic object and
referenced by a regular object. This is called after all the
- input files have been seen, but before the SIZE_DYNAMIC_SECTIONS
+ input files have been seen, but before the LATE_SIZE_SECTIONS
function has been called. The hash table entry should be
bfd_link_hash_defined ore bfd_link_hash_defweak, and it should be
defined in a section from a dynamic object. Dynamic object
bool (*elf_backend_adjust_dynamic_symbol)
(struct bfd_link_info *info, struct elf_link_hash_entry *h);
- /* The ALWAYS_SIZE_SECTIONS function is called by the backend linker
- after all the linker input files have been seen but before the
- section sizes have been set. This is called after
- ADJUST_DYNAMIC_SYMBOL, but before SIZE_DYNAMIC_SECTIONS. */
- bool (*elf_backend_always_size_sections)
+ /* The EARLY_SIZE_SECTIONS and LATE_SIZE_SECTIONS functions are
+ called by the backend linker after all linker input files have
+ been seen and sections have been assigned to output sections, but
+ before the section sizes have been set. Both of these functions
+ are called even when no dynamic object is seen by the linker.
+ Between them, they must set the sizes of the dynamic sections and
+ other backend specific sections, and may fill in their contents.
+ Most backends need only use LATE_SIZE_SECTIONS.
+ EARLY_SIZE_SECTIONS is called before --export-dynamic makes some
+ symbols dynamic and before ADJUST_DYNAMIC_SYMBOL processes
+ dynamic symbols, LATE_SIZE_SECTIONS afterwards. The generic ELF
+ linker can handle the .dynsym, .dynstr and .hash sections.
+ Besides those, these functions must handle the .interp section
+ and any other sections created by CREATE_DYNAMIC_SECTIONS. */
+ bool (*elf_backend_early_size_sections)
(bfd *output_bfd, struct bfd_link_info *info);
-
- /* The SIZE_DYNAMIC_SECTIONS function is called by the ELF backend
- linker after all the linker input files have been seen but before
- the sections sizes have been set. This is called after
- ADJUST_DYNAMIC_SYMBOL has been called on all appropriate symbols.
- It is only called when linking against a dynamic object. It must
- set the sizes of the dynamic sections, and may fill in their
- contents as well. The generic ELF linker can handle the .dynsym,
- .dynstr and .hash sections. This function must handle the
- .interp section and any sections created by the
- CREATE_DYNAMIC_SECTIONS entry point. */
- bool (*elf_backend_size_dynamic_sections)
+ bool (*elf_backend_late_size_sections)
(bfd *output_bfd, struct bfd_link_info *info);
/* The STRIP_ZERO_SIZED_DYNAMIC_SECTIONS function is called by the
/* Set the sizes of the dynamic sections. */
static bool
-_bfd_mn10300_elf_size_dynamic_sections (bfd * output_bfd,
- struct bfd_link_info * info)
+_bfd_mn10300_elf_late_size_sections (bfd * output_bfd,
+ struct bfd_link_info * info)
{
struct elf32_mn10300_link_hash_table *htab = elf32_mn10300_hash_table (info);
bfd * dynobj;
bool relocs;
dynobj = htab->root.dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (elf_hash_table (info)->dynamic_sections_created)
{
_bfd_mn10300_elf_create_dynamic_sections
#define elf_backend_adjust_dynamic_symbol \
_bfd_mn10300_elf_adjust_dynamic_symbol
-#define elf_backend_size_dynamic_sections \
- _bfd_mn10300_elf_size_dynamic_sections
+#define elf_backend_late_size_sections \
+ _bfd_mn10300_elf_late_size_sections
#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all
#define elf_backend_finish_dynamic_symbol \
_bfd_mn10300_elf_finish_dynamic_symbol
/* Set the sizes of the dynamic sections. */
static bool
-elf_arc_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+elf_arc_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *s;
struct elf_link_hash_table *htab = elf_hash_table (info);
dynobj = htab->dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (htab->dynamic_sections_created)
{
#define elf_backend_finish_dynamic_symbol elf_arc_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections elf_arc_finish_dynamic_sections
-#define elf_backend_size_dynamic_sections elf_arc_size_dynamic_sections
+#define elf_backend_late_size_sections elf_arc_late_size_sections
#define elf_backend_can_gc_sections 1
#define elf_backend_want_got_plt 1
/* Set the sizes of the dynamic sections. */
static bool
-elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info * info)
+elf32_arm_late_size_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info * info)
{
bfd * dynobj;
asection * s;
return false;
dynobj = elf_hash_table (info)->dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
+
check_use_blx (htab);
if (elf_hash_table (info)->dynamic_sections_created)
_TLS_MODULE_BASE_, if needed. */
static bool
-elf32_arm_always_size_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+elf32_arm_early_size_sections (bfd *output_bfd, struct bfd_link_info *info)
{
asection *tls_sec;
struct elf32_arm_link_hash_table *htab;
#define elf_backend_create_dynamic_sections elf32_arm_create_dynamic_sections
#define elf_backend_finish_dynamic_symbol elf32_arm_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections elf32_arm_finish_dynamic_sections
-#define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_sections
-#define elf_backend_always_size_sections elf32_arm_always_size_sections
+#define elf_backend_late_size_sections elf32_arm_late_size_sections
+#define elf_backend_early_size_sections elf32_arm_early_size_sections
#define elf_backend_init_index_section _bfd_elf_init_2_index_sections
#define elf_backend_init_file_header elf32_arm_init_file_header
#define elf_backend_reloc_type_class elf32_arm_reloc_type_class
/* Set the sizes of the dynamic sections. */
static bool
-elf32_bfinfdpic_size_dynamic_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+elf32_bfinfdpic_late_size_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
struct elf_link_hash_table *htab;
bfd *dynobj;
htab = elf_hash_table (info);
dynobj = htab->dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (htab->dynamic_sections_created)
{
}
static bool
-elf32_bfinfdpic_always_size_sections (bfd *output_bfd,
+elf32_bfinfdpic_early_size_sections (bfd *output_bfd,
struct bfd_link_info *info)
{
if (!bfd_link_relocatable (info)
}
static bool
-bfin_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+bfin_late_size_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *s;
bool relocs;
dynobj = elf_hash_table (info)->dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (elf_hash_table (info)->dynamic_sections_created)
{
#define elf_backend_check_relocs bfin_check_relocs
#define elf_backend_adjust_dynamic_symbol \
bfin_adjust_dynamic_symbol
-#define elf_backend_size_dynamic_sections \
- bfin_size_dynamic_sections
+#define elf_backend_late_size_sections bfin_late_size_sections
#define elf_backend_relocate_section bfin_relocate_section
#define elf_backend_finish_dynamic_symbol \
bfin_finish_dynamic_symbol
#undef bfd_elf32_bfd_link_hash_table_create
#define bfd_elf32_bfd_link_hash_table_create \
bfinfdpic_elf_link_hash_table_create
-#undef elf_backend_always_size_sections
-#define elf_backend_always_size_sections \
- elf32_bfinfdpic_always_size_sections
+#undef elf_backend_early_size_sections
+#define elf_backend_early_size_sections \
+ elf32_bfinfdpic_early_size_sections
#undef elf_backend_create_dynamic_sections
#define elf_backend_create_dynamic_sections \
#undef elf_backend_adjust_dynamic_symbol
#define elf_backend_adjust_dynamic_symbol \
elf32_bfinfdpic_adjust_dynamic_symbol
-#undef elf_backend_size_dynamic_sections
-#define elf_backend_size_dynamic_sections \
- elf32_bfinfdpic_size_dynamic_sections
+#undef elf_backend_late_size_sections
+#define elf_backend_late_size_sections \
+ elf32_bfinfdpic_late_size_sections
#undef elf_backend_finish_dynamic_symbol
#define elf_backend_finish_dynamic_symbol \
elf32_bfinfdpic_finish_dynamic_symbol
/* Set the sizes of the dynamic sections. */
static bool
-_bfd_cr16_elf_size_dynamic_sections (bfd * output_bfd,
- struct bfd_link_info * info)
+_bfd_cr16_elf_late_size_sections (bfd * output_bfd,
+ struct bfd_link_info * info)
{
bfd * dynobj;
asection * s;
bool relocs;
dynobj = elf_hash_table (info)->dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (elf_hash_table (info)->dynamic_sections_created)
{
_bfd_cr16_elf_create_dynamic_sections
#define elf_backend_adjust_dynamic_symbol \
_bfd_cr16_elf_adjust_dynamic_symbol
-#define elf_backend_size_dynamic_sections \
- _bfd_cr16_elf_size_dynamic_sections
+#define elf_backend_late_size_sections \
+ _bfd_cr16_elf_late_size_sections
#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all
#define elf_backend_finish_dynamic_symbol \
_bfd_cr16_elf_finish_dynamic_symbol
entry but we found we will not create any. Called when we find we will
not have any PLT for this symbol, by for example
elf_cris_adjust_dynamic_symbol when we're doing a proper dynamic link,
- or elf_cris_size_dynamic_sections if no dynamic sections will be
+ or elf_cris_late_size_sections if no dynamic sections will be
created (we're only linking static objects). */
static bool
/* Set the sizes of the dynamic sections. */
static bool
-elf_cris_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+elf_cris_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct elf_cris_link_hash_table * htab;
bfd *dynobj;
return false;
dynobj = htab->root.dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (htab->root.dynamic_sections_created)
{
elf_cris_adjust_dynamic_symbol
#define elf_backend_copy_indirect_symbol \
elf_cris_copy_indirect_symbol
-#define elf_backend_size_dynamic_sections \
- elf_cris_size_dynamic_sections
+#define elf_backend_late_size_sections \
+ elf_cris_late_size_sections
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
#define elf_backend_finish_dynamic_symbol \
elf_cris_finish_dynamic_symbol
/* Set the sizes of the dynamic sections. */
static bool
-csky_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+csky_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct csky_elf_link_hash_table *htab;
bfd *dynobj;
return false;
dynobj = htab->elf.dynobj;
if (dynobj == NULL)
- return false;
+ return true;
if (htab->elf.dynamic_sections_created)
{
/* Dynamic relocate related API. */
#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections
#define elf_backend_adjust_dynamic_symbol csky_elf_adjust_dynamic_symbol
-#define elf_backend_size_dynamic_sections csky_elf_size_dynamic_sections
+#define elf_backend_late_size_sections csky_elf_late_size_sections
#define elf_backend_finish_dynamic_symbol csky_elf_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections csky_elf_finish_dynamic_sections
#define elf_backend_rela_normal 1
/* Set the sizes of the dynamic sections. */
static bool
-elf32_frvfdpic_size_dynamic_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+elf32_frvfdpic_late_size_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *s;
struct _frvfdpic_dynamic_got_plt_info gpinfo;
dynobj = elf_hash_table (info)->dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (elf_hash_table (info)->dynamic_sections_created)
{
}
static bool
-elf32_frvfdpic_always_size_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+elf32_frvfdpic_early_size_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
if (!bfd_link_relocatable (info)
&& !bfd_elf_stack_segment_size (output_bfd, info,
#undef bfd_elf32_bfd_link_hash_table_create
#define bfd_elf32_bfd_link_hash_table_create \
frvfdpic_elf_link_hash_table_create
-#undef elf_backend_always_size_sections
-#define elf_backend_always_size_sections \
- elf32_frvfdpic_always_size_sections
+#undef elf_backend_early_size_sections
+#define elf_backend_early_size_sections \
+ elf32_frvfdpic_early_size_sections
#undef elf_backend_create_dynamic_sections
#define elf_backend_create_dynamic_sections \
#undef elf_backend_adjust_dynamic_symbol
#define elf_backend_adjust_dynamic_symbol \
elf32_frvfdpic_adjust_dynamic_symbol
-#undef elf_backend_size_dynamic_sections
-#define elf_backend_size_dynamic_sections \
- elf32_frvfdpic_size_dynamic_sections
+#undef elf_backend_late_size_sections
+#define elf_backend_late_size_sections \
+ elf32_frvfdpic_late_size_sections
#undef bfd_elf32_bfd_relax_section
#define bfd_elf32_bfd_relax_section \
elf32_frvfdpic_relax_section
/* Set the sizes of the dynamic sections. */
static bool
-elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+elf32_hppa_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct elf32_hppa_link_hash_table *htab;
bfd *dynobj;
dynobj = htab->etab.dynobj;
if (dynobj == NULL)
- abort ();
+ return true;
if (htab->etab.dynamic_sections_created)
{
#define elf_backend_hide_symbol elf32_hppa_hide_symbol
#define elf_backend_finish_dynamic_symbol elf32_hppa_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections elf32_hppa_finish_dynamic_sections
-#define elf_backend_size_dynamic_sections elf32_hppa_size_dynamic_sections
+#define elf_backend_late_size_sections elf32_hppa_late_size_sections
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
#define elf_backend_gc_mark_hook elf32_hppa_gc_mark_hook
#define elf_backend_grok_prstatus elf32_hppa_grok_prstatus
}
static bool
-elf_i386_always_size_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+elf_i386_early_size_sections (bfd *output_bfd, struct bfd_link_info *info)
{
bfd *abfd;
elf_i386_scan_relocs))
return false;
- return _bfd_x86_elf_always_size_sections (output_bfd, info);
+ return _bfd_x86_elf_early_size_sections (output_bfd, info);
}
/* Set the correct type for an x86 ELF section. We do this by the
#define bfd_elf32_get_synthetic_symtab elf_i386_get_synthetic_symtab
#define elf_backend_relocs_compatible _bfd_elf_relocs_compatible
-#define elf_backend_always_size_sections elf_i386_always_size_sections
+#define elf_backend_early_size_sections elf_i386_early_size_sections
#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections
#define elf_backend_fake_sections elf_i386_fake_sections
#define elf_backend_finish_dynamic_sections elf_i386_finish_dynamic_sections
/* Set the sizes of the dynamic sections. */
static bool
-lm32_elf_size_dynamic_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+lm32_elf_late_size_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
struct elf_lm32_link_hash_table *htab;
bfd *dynobj;
return false;
dynobj = htab->root.dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (htab->root.dynamic_sections_created)
{
}
static bool
-lm32_elf_always_size_sections (bfd *output_bfd, struct bfd_link_info *info)
+lm32_elf_early_size_sections (bfd *output_bfd, struct bfd_link_info *info)
{
if (!bfd_link_relocatable (info))
{
#define bfd_elf32_bfd_link_hash_table_create lm32_elf_link_hash_table_create
#define elf_backend_check_relocs lm32_elf_check_relocs
#define elf_backend_reloc_type_class lm32_elf_reloc_type_class
-#define elf_backend_size_dynamic_sections lm32_elf_size_dynamic_sections
+#define elf_backend_late_size_sections lm32_elf_late_size_sections
#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all
#define elf_backend_create_dynamic_sections lm32_elf_create_dynamic_sections
#define elf_backend_finish_dynamic_sections lm32_elf_finish_dynamic_sections
#undef elf32_bed
#define elf32_bed elf32_lm32fdpic_bed
-#undef elf_backend_always_size_sections
-#define elf_backend_always_size_sections lm32_elf_always_size_sections
+#undef elf_backend_early_size_sections
+#define elf_backend_early_size_sections lm32_elf_early_size_sections
#undef bfd_elf32_bfd_copy_private_bfd_data
#define bfd_elf32_bfd_copy_private_bfd_data lm32_elf_fdpic_copy_private_bfd_data
}
static bool
-m32c_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+m32c_elf_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *splt;
#define elf_backend_check_relocs m32c_elf_check_relocs
#define elf_backend_object_p m32c_elf_object_p
#define elf_symbol_leading_char ('_')
-#define elf_backend_always_size_sections \
- m32c_elf_always_size_sections
+#define elf_backend_early_size_sections \
+ m32c_elf_early_size_sections
#define elf_backend_finish_dynamic_sections \
m32c_elf_finish_dynamic_sections
/* Set the sizes of the dynamic sections. */
static bool
-m32r_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+m32r_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct elf_link_hash_table *htab;
bfd *dynobj;
bfd *ibfd;
#ifdef DEBUG_PIC
- printf ("m32r_elf_size_dynamic_sections()\n");
+ printf ("m32r_elf_late_size_sections()\n");
#endif
htab = m32r_elf_hash_table (info);
return false;
dynobj = htab->dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (htab->dynamic_sections_created)
{
#define elf_backend_create_dynamic_sections m32r_elf_create_dynamic_sections
#define bfd_elf32_bfd_link_hash_table_create m32r_elf_link_hash_table_create
-#define elf_backend_size_dynamic_sections m32r_elf_size_dynamic_sections
+#define elf_backend_late_size_sections m32r_elf_late_size_sections
#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all
#define elf_backend_finish_dynamic_sections m32r_elf_finish_dynamic_sections
#define elf_backend_adjust_dynamic_symbol m32r_elf_adjust_dynamic_symbol
It's a convenient place to determine the PLT style. */
static bool
-elf_m68k_always_size_sections (bfd *output_bfd, struct bfd_link_info *info)
+elf_m68k_early_size_sections (bfd *output_bfd, struct bfd_link_info *info)
{
/* Bind input BFDs to GOTs and calculate sizes of .got and .rela.got
sections. */
/* Set the sizes of the dynamic sections. */
static bool
-elf_m68k_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+elf_m68k_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *s;
bool relocs;
dynobj = elf_hash_table (info)->dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (elf_hash_table (info)->dynamic_sections_created)
{
#define bfd_elf32_bfd_final_link bfd_elf_final_link
#define elf_backend_check_relocs elf_m68k_check_relocs
-#define elf_backend_always_size_sections \
- elf_m68k_always_size_sections
+#define elf_backend_early_size_sections \
+ elf_m68k_early_size_sections
#define elf_backend_adjust_dynamic_symbol \
elf_m68k_adjust_dynamic_symbol
-#define elf_backend_size_dynamic_sections \
- elf_m68k_size_dynamic_sections
+#define elf_backend_late_size_sections elf_m68k_late_size_sections
#define elf_backend_final_write_processing elf_m68k_final_write_processing
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
#define elf_backend_relocate_section elf_m68k_relocate_section
/* Set the sizes of the dynamic sections. */
static bool
-elf_metag_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+elf_metag_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct elf_metag_link_hash_table *htab;
bfd *dynobj;
htab = metag_link_hash_table (info);
dynobj = htab->etab.dynobj;
if (dynobj == NULL)
- abort ();
+ return true;
if (htab->etab.dynamic_sections_created)
{
#define elf_backend_adjust_dynamic_symbol elf_metag_adjust_dynamic_symbol
#define elf_backend_finish_dynamic_symbol elf_metag_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections elf_metag_finish_dynamic_sections
-#define elf_backend_size_dynamic_sections elf_metag_size_dynamic_sections
+#define elf_backend_late_size_sections elf_metag_late_size_sections
#define elf_backend_omit_section_dynsym \
_bfd_elf_omit_section_dynsym_all
#define elf_backend_init_file_header elf_metag_init_file_header
/* Set the sizes of the dynamic sections. */
static bool
-microblaze_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+microblaze_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct elf32_mb_link_hash_table *htab;
bfd *dynobj;
return false;
dynobj = htab->elf.dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections
#define elf_backend_finish_dynamic_sections microblaze_elf_finish_dynamic_sections
#define elf_backend_finish_dynamic_symbol microblaze_elf_finish_dynamic_symbol
-#define elf_backend_size_dynamic_sections microblaze_elf_size_dynamic_sections
+#define elf_backend_late_size_sections microblaze_elf_late_size_sections
#define elf_backend_add_symbol_hook microblaze_elf_add_symbol_hook
#include "elf32-target.h"
#define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag
#define elf_backend_adjust_dynamic_symbol \
_bfd_mips_elf_adjust_dynamic_symbol
-#define elf_backend_always_size_sections \
- _bfd_mips_elf_always_size_sections
-#define elf_backend_size_dynamic_sections \
- _bfd_mips_elf_size_dynamic_sections
+#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections
+#define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
#define elf_backend_relocate_section _bfd_mips_elf_relocate_section
#define elf_backend_finish_dynamic_symbol \
/* Set the sizes of the dynamic sections. */
static bool
-nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+nds32_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct elf_nds32_link_hash_table *htab;
bfd *dynobj;
return false;
dynobj = elf_hash_table (info)->dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (elf_hash_table (info)->dynamic_sections_created)
{
#define elf_backend_create_dynamic_sections nds32_elf_create_dynamic_sections
#define elf_backend_finish_dynamic_sections nds32_elf_finish_dynamic_sections
#define elf_backend_finish_dynamic_symbol nds32_elf_finish_dynamic_symbol
-#define elf_backend_size_dynamic_sections nds32_elf_size_dynamic_sections
+#define elf_backend_late_size_sections nds32_elf_late_size_sections
#define elf_backend_relocate_section nds32_elf_relocate_section
#define elf_backend_gc_mark_hook nds32_elf_gc_mark_hook
#define elf_backend_grok_prstatus nds32_elf_grok_prstatus
return true;
}
-/* Worker function for nios2_elf32_size_dynamic_sections. */
+/* Worker function for nios2_elf32_late_size_sections. */
static bool
adjust_dynrelocs (struct elf_link_hash_entry *h, void *inf)
{
return true;
}
-/* Another worker function for nios2_elf32_size_dynamic_sections.
+/* Another worker function for nios2_elf32_late_size_sections.
Allocate space in .plt, .got and associated reloc sections for
dynamic relocs. */
static bool
return true;
}
-/* Implement elf_backend_size_dynamic_sections:
+/* Implement elf_backend_late_size_sections:
Set the sizes of the dynamic sections. */
static bool
-nios2_elf32_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+nios2_elf32_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *s;
htab = elf32_nios2_hash_table (info);
dynobj = htab->root.dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
htab->res_n_size = 0;
if (htab->root.dynamic_sections_created)
nios2_elf32_finish_dynamic_sections
#define elf_backend_adjust_dynamic_symbol nios2_elf32_adjust_dynamic_symbol
#define elf_backend_reloc_type_class nios2_elf32_reloc_type_class
-#define elf_backend_size_dynamic_sections nios2_elf32_size_dynamic_sections
+#define elf_backend_late_size_sections nios2_elf32_late_size_sections
#define elf_backend_add_symbol_hook nios2_elf_add_symbol_hook
#define elf_backend_copy_indirect_symbol nios2_elf32_copy_indirect_symbol
#define elf_backend_object_p nios2_elf32_object_p
/* Set the sizes of the dynamic sections. */
static bool
-or1k_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+or1k_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct elf_or1k_link_hash_table *htab;
bfd *dynobj;
return false;
dynobj = htab->root.dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (htab->root.dynamic_sections_created)
{
#define elf_backend_copy_indirect_symbol or1k_elf_copy_indirect_symbol
#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections
#define elf_backend_finish_dynamic_sections or1k_elf_finish_dynamic_sections
-#define elf_backend_size_dynamic_sections or1k_elf_size_dynamic_sections
+#define elf_backend_late_size_sections or1k_elf_late_size_sections
#define elf_backend_adjust_dynamic_symbol or1k_elf_adjust_dynamic_symbol
#define elf_backend_finish_dynamic_symbol or1k_elf_finish_dynamic_symbol
/* Set the sizes of the dynamic sections. */
static bool
-ppc_elf_size_dynamic_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+ppc_elf_late_size_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
struct ppc_elf_link_hash_table *htab;
asection *s;
bfd *ibfd;
#ifdef DEBUG
- fprintf (stderr, "ppc_elf_size_dynamic_sections called\n");
+ fprintf (stderr, "ppc_elf_late_size_sections called\n");
#endif
htab = ppc_elf_hash_table (info);
- BFD_ASSERT (htab->elf.dynobj != NULL);
+ if (htab->elf.dynobj == NULL)
+ return true;
if (elf_hash_table (info)->dynamic_sections_created)
{
#define elf_backend_copy_indirect_symbol ppc_elf_copy_indirect_symbol
#define elf_backend_adjust_dynamic_symbol ppc_elf_adjust_dynamic_symbol
#define elf_backend_add_symbol_hook ppc_elf_add_symbol_hook
-#define elf_backend_size_dynamic_sections ppc_elf_size_dynamic_sections
+#define elf_backend_late_size_sections ppc_elf_late_size_sections
#define elf_backend_hash_symbol ppc_elf_hash_symbol
#define elf_backend_finish_dynamic_symbol ppc_elf_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections ppc_elf_finish_dynamic_sections
}
static bool
-rl78_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+rl78_elf_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *splt;
#define bfd_elf32_bfd_relax_section rl78_elf_relax_section
#define elf_backend_check_relocs rl78_elf_check_relocs
-#define elf_backend_always_size_sections \
- rl78_elf_always_size_sections
+#define elf_backend_early_size_sections \
+ rl78_elf_early_size_sections
#define elf_backend_finish_dynamic_sections \
rl78_elf_finish_dynamic_sections
entry but we found we will not create any. Called when we find we will
not have any PLT for this symbol, by for example
elf_s390_adjust_dynamic_symbol when we're doing a proper dynamic link,
- or elf_s390_size_dynamic_sections if no dynamic sections will be
+ or elf_s390_late_size_sections if no dynamic sections will be
created (we're only linking static objects). */
static void
/* Set the sizes of the dynamic sections. */
static bool
-elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+elf_s390_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct elf_s390_link_hash_table *htab;
bfd *dynobj;
htab = elf_s390_hash_table (info);
dynobj = htab->elf.dynobj;
if (dynobj == NULL)
- abort ();
+ return true;
if (htab->elf.dynamic_sections_created)
{
#define elf_backend_gc_mark_hook elf_s390_gc_mark_hook
#define elf_backend_reloc_type_class elf_s390_reloc_type_class
#define elf_backend_relocate_section elf_s390_relocate_section
-#define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections
+#define elf_backend_late_size_sections elf_s390_late_size_sections
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
#define elf_backend_grok_prstatus elf_s390_grok_prstatus
#define elf_backend_grok_psinfo elf_s390_grok_psinfo
appear towards the end. This reduces the amount of GOT space
required. MAX_LOCAL is used to set the number of local symbols
known to be in the dynamic symbol table. During
- s3_bfd_score_elf_size_dynamic_sections, this value is 1. Afterward, the
+ s3_bfd_score_elf_late_size_sections, this value is 1. Afterward, the
section symbols are added and the count is higher. */
static bool
score_elf_sort_hash_table (struct bfd_link_info *info,
/* This function is called after all the input files have been read,
and the input sections have been assigned to output sections. */
static bool
-s3_bfd_score_elf_always_size_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+s3_bfd_score_elf_early_size_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *s;
/* Set the sizes of the dynamic sections. */
static bool
-s3_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
+s3_bfd_score_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info)
{
bfd *dynobj;
asection *s;
bool reltext;
dynobj = elf_hash_table (info)->dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (elf_hash_table (info)->dynamic_sections_created)
{
}
else if (startswith (name, ".got"))
{
- /* s3_bfd_score_elf_always_size_sections() has already done
+ /* s3_bfd_score_elf_early_size_sections() has already done
most of the work, but some symbols may have been mapped
to versions that we must now resolve in the got_entries
hash tables. */
}
static bool
-_bfd_score_elf_always_size_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+_bfd_score_elf_early_size_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
if (bfd_get_mach (output_bfd) == bfd_mach_score3)
- return s3_bfd_score_elf_always_size_sections (output_bfd, info);
+ return s3_bfd_score_elf_early_size_sections (output_bfd, info);
else
- return s7_bfd_score_elf_always_size_sections (output_bfd, info);
+ return s7_bfd_score_elf_early_size_sections (output_bfd, info);
}
static bool
-_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
+_bfd_score_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info)
{
if (bfd_get_mach (output_bfd) == bfd_mach_score3)
- return s3_bfd_score_elf_size_dynamic_sections (output_bfd, info);
+ return s3_bfd_score_elf_late_size_sections (output_bfd, info);
else
- return s7_bfd_score_elf_size_dynamic_sections (output_bfd, info);
+ return s7_bfd_score_elf_late_size_sections (output_bfd, info);
}
static bool
_bfd_score_elf_section_from_bfd_section
#define elf_backend_adjust_dynamic_symbol \
_bfd_score_elf_adjust_dynamic_symbol
-#define elf_backend_always_size_sections \
- _bfd_score_elf_always_size_sections
-#define elf_backend_size_dynamic_sections \
- _bfd_score_elf_size_dynamic_sections
+#define elf_backend_early_size_sections \
+ _bfd_score_elf_early_size_sections
+#define elf_backend_late_size_sections \
+ _bfd_score_elf_late_size_sections
#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all
#define elf_backend_create_dynamic_sections \
_bfd_score_elf_create_dynamic_sections
struct elf_link_hash_entry *);
extern bool
-s7_bfd_score_elf_always_size_sections (bfd *, struct bfd_link_info *);
+s7_bfd_score_elf_early_size_sections (bfd *, struct bfd_link_info *);
extern bool
-s7_bfd_score_elf_size_dynamic_sections (bfd *, struct bfd_link_info *);
+s7_bfd_score_elf_late_size_sections (bfd *, struct bfd_link_info *);
extern bool
s7_bfd_score_elf_create_dynamic_sections (bfd *, struct bfd_link_info *);
appear towards the end. This reduces the amount of GOT space
required. MAX_LOCAL is used to set the number of local symbols
known to be in the dynamic symbol table. During
- s7_bfd_score_elf_size_dynamic_sections, this value is 1. Afterward, the
+ s7_bfd_score_elf_late_size_sections, this value is 1. Afterward, the
section symbols are added and the count is higher. */
static bool
and the input sections have been assigned to output sections. */
bool
-s7_bfd_score_elf_always_size_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+s7_bfd_score_elf_early_size_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *s;
/* Set the sizes of the dynamic sections. */
bool
-s7_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
+s7_bfd_score_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info)
{
bfd *dynobj;
asection *s;
bool reltext;
dynobj = elf_hash_table (info)->dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (elf_hash_table (info)->dynamic_sections_created)
{
}
else if (startswith (name, ".got"))
{
- /* s7_bfd_score_elf_always_size_sections() has already done
+ /* s7_bfd_score_elf_early_size_sections() has already done
most of the work, but some symbols may have been mapped
to versions that we must now resolve in the got_entries
hash tables. */
It's a convenient place to determine the PLT style. */
static bool
-sh_elf_always_size_sections (bfd *output_bfd, struct bfd_link_info *info)
+sh_elf_early_size_sections (bfd *output_bfd, struct bfd_link_info *info)
{
sh_elf_hash_table (info)->plt_info = get_plt_info (output_bfd,
bfd_link_pic (info));
/* Set the sizes of the dynamic sections. */
static bool
-sh_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+sh_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct elf_sh_link_hash_table *htab;
bfd *dynobj;
return false;
dynobj = htab->root.dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (htab->root.dynamic_sections_created)
{
sh_elf_link_hash_table_create
#define elf_backend_adjust_dynamic_symbol \
sh_elf_adjust_dynamic_symbol
-#define elf_backend_always_size_sections \
- sh_elf_always_size_sections
-#define elf_backend_size_dynamic_sections \
- sh_elf_size_dynamic_sections
+#define elf_backend_early_size_sections sh_elf_early_size_sections
+#define elf_backend_late_size_sections sh_elf_late_size_sections
#define elf_backend_omit_section_dynsym sh_elf_omit_section_dynsym
#define elf_backend_finish_dynamic_symbol \
sh_elf_finish_dynamic_symbol
#define elf_backend_adjust_dynamic_symbol \
_bfd_sparc_elf_adjust_dynamic_symbol
#define elf_backend_omit_section_dynsym _bfd_sparc_elf_omit_section_dynsym
-#define elf_backend_size_dynamic_sections \
- _bfd_sparc_elf_size_dynamic_sections
+#define elf_backend_late_size_sections _bfd_sparc_elf_late_size_sections
#define elf_backend_relocate_section _bfd_sparc_elf_relocate_section
#define elf_backend_finish_dynamic_symbol \
_bfd_sparc_elf_finish_dynamic_symbol
/* Set the sizes of the dynamic sections. */
static bool
-elf32_tic6x_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
+elf32_tic6x_late_size_sections (bfd *output_bfd, struct bfd_link_info *info)
{
struct elf32_tic6x_link_hash_table *htab;
bfd *dynobj;
htab = elf32_tic6x_hash_table (info);
dynobj = htab->elf.dynobj;
if (dynobj == NULL)
- abort ();
+ return true;
if (htab->elf.dynamic_sections_created)
{
and the input sections have been assigned to output sections. */
static bool
-elf32_tic6x_always_size_sections (bfd *output_bfd, struct bfd_link_info *info)
+elf32_tic6x_early_size_sections (bfd *output_bfd, struct bfd_link_info *info)
{
if (elf32_tic6x_using_dsbt (output_bfd) && !bfd_link_relocatable (info)
&& !bfd_elf_stack_segment_size (output_bfd, info,
#define elf_backend_relocs_compatible _bfd_elf_relocs_compatible
#define elf_backend_finish_dynamic_symbol \
elf32_tic6x_finish_dynamic_symbol
-#define elf_backend_always_size_sections \
- elf32_tic6x_always_size_sections
-#define elf_backend_size_dynamic_sections \
- elf32_tic6x_size_dynamic_sections
+#define elf_backend_early_size_sections \
+ elf32_tic6x_early_size_sections
+#define elf_backend_late_size_sections \
+ elf32_tic6x_late_size_sections
#define elf_backend_finish_dynamic_sections \
elf32_tic6x_finish_dynamic_sections
#define bfd_elf32_bfd_final_link \
#define elf_backend_check_relocs tilegx_elf_check_relocs
#define elf_backend_adjust_dynamic_symbol tilegx_elf_adjust_dynamic_symbol
#define elf_backend_omit_section_dynsym tilegx_elf_omit_section_dynsym
-#define elf_backend_size_dynamic_sections tilegx_elf_size_dynamic_sections
+#define elf_backend_late_size_sections tilegx_elf_late_size_sections
#define elf_backend_relocate_section tilegx_elf_relocate_section
#define elf_backend_finish_dynamic_symbol tilegx_elf_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections tilegx_elf_finish_dynamic_sections
#define ELF32_DYNAMIC_INTERPRETER "/lib/ld.so.1"
static bool
-tilepro_elf_size_dynamic_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+tilepro_elf_late_size_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
- (void)output_bfd;
-
struct elf_link_hash_table *htab;
bfd *dynobj;
asection *s;
htab = tilepro_elf_hash_table (info);
BFD_ASSERT (htab != NULL);
dynobj = htab->dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (elf_hash_table (info)->dynamic_sections_created)
{
#define elf_backend_check_relocs tilepro_elf_check_relocs
#define elf_backend_adjust_dynamic_symbol tilepro_elf_adjust_dynamic_symbol
#define elf_backend_omit_section_dynsym tilepro_elf_omit_section_dynsym
-#define elf_backend_size_dynamic_sections tilepro_elf_size_dynamic_sections
+#define elf_backend_late_size_sections tilepro_elf_late_size_sections
#define elf_backend_relocate_section tilepro_elf_relocate_section
#define elf_backend_finish_dynamic_symbol tilepro_elf_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections tilepro_elf_finish_dynamic_sections
asection *, const Elf_Internal_Rela *);
static bool elf_vax_adjust_dynamic_symbol (struct bfd_link_info *,
struct elf_link_hash_entry *);
-static bool elf_vax_size_dynamic_sections (bfd *, struct bfd_link_info *);
static int elf_vax_relocate_section (bfd *, struct bfd_link_info *,
bfd *, asection *, bfd_byte *,
Elf_Internal_Rela *,
/* Discard unused dynamic data if this is a static link. */
static bool
-elf_vax_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+elf_vax_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *s;
/* Set the sizes of the dynamic sections. */
static bool
-elf_vax_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
+elf_vax_late_size_sections (bfd *output_bfd, struct bfd_link_info *info)
{
bfd *dynobj;
asection *s;
bool relocs;
dynobj = elf_hash_table (info)->dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (elf_hash_table (info)->dynamic_sections_created)
{
#define elf_backend_check_relocs elf_vax_check_relocs
#define elf_backend_adjust_dynamic_symbol \
elf_vax_adjust_dynamic_symbol
-#define elf_backend_always_size_sections \
- elf_vax_always_size_sections
-#define elf_backend_size_dynamic_sections \
- elf_vax_size_dynamic_sections
+#define elf_backend_early_size_sections elf_vax_early_size_sections
+#define elf_backend_late_size_sections elf_vax_late_size_sections
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
#define elf_backend_relocate_section elf_vax_relocate_section
#define elf_backend_finish_dynamic_symbol \
}
static bool
-xstormy16_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+xstormy16_elf_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *splt;
#define elf_backend_relocate_section xstormy16_elf_relocate_section
#define elf_backend_gc_mark_hook xstormy16_elf_gc_mark_hook
#define elf_backend_check_relocs xstormy16_elf_check_relocs
-#define elf_backend_always_size_sections \
- xstormy16_elf_always_size_sections
+#define elf_backend_early_size_sections \
+ xstormy16_elf_early_size_sections
#define elf_backend_omit_section_dynsym \
_bfd_elf_omit_section_dynsym_all
#define elf_backend_finish_dynamic_sections \
/* Set the sizes of the dynamic sections. */
static bool
-elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+elf_xtensa_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct elf_xtensa_link_hash_table *htab;
bfd *dynobj, *abfd;
dynobj = elf_hash_table (info)->dynobj;
if (dynobj == NULL)
- abort ();
+ return true;
srelgot = htab->elf.srelgot;
srelplt = htab->elf.srelplt;
}
static bool
-elf_xtensa_always_size_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+elf_xtensa_early_size_sections (bfd *output_bfd, struct bfd_link_info *info)
{
struct elf_xtensa_link_hash_table *htab;
asection *tls_sec;
#define elf_backend_object_p elf_xtensa_object_p
#define elf_backend_reloc_type_class elf_xtensa_reloc_type_class
#define elf_backend_relocate_section elf_xtensa_relocate_section
-#define elf_backend_size_dynamic_sections elf_xtensa_size_dynamic_sections
-#define elf_backend_always_size_sections elf_xtensa_always_size_sections
+#define elf_backend_late_size_sections elf_xtensa_late_size_sections
+#define elf_backend_early_size_sections elf_xtensa_early_size_sections
#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all
#define elf_backend_special_sections elf_xtensa_special_sections
#define elf_backend_action_discarded elf_xtensa_action_discarded
}
static bool
-elf64_alpha_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+elf64_alpha_early_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
bfd *i;
struct alpha_elf_link_hash_table * htab;
/* Set the sizes of the dynamic sections. */
static bool
-elf64_alpha_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+elf64_alpha_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *s;
return false;
dynobj = elf_hash_table(info)->dynobj;
- BFD_ASSERT(dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (elf_hash_table (info)->dynamic_sections_created)
{
elf64_alpha_merge_symbol_attribute
#define elf_backend_copy_indirect_symbol \
elf64_alpha_copy_indirect_symbol
-#define elf_backend_always_size_sections \
- elf64_alpha_always_size_sections
-#define elf_backend_size_dynamic_sections \
- elf64_alpha_size_dynamic_sections
+#define elf_backend_early_size_sections \
+ elf64_alpha_early_size_sections
+#define elf_backend_late_size_sections \
+ elf64_alpha_late_size_sections
#define elf_backend_omit_section_dynsym \
_bfd_elf_omit_section_dynsym_all
#define elf_backend_relocate_section \
static bool elf64_hppa_mark_milli_and_exported_functions
(struct elf_link_hash_entry *, void *);
-static bool elf64_hppa_size_dynamic_sections
- (bfd *, struct bfd_link_info *);
-
static int elf64_hppa_link_output_symbol_hook
(struct bfd_link_info *, const char *, Elf_Internal_Sym *,
asection *, struct elf_link_hash_entry *);
the contents of our special sections. */
static bool
-elf64_hppa_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
+elf64_hppa_late_size_sections (bfd *output_bfd, struct bfd_link_info *info)
{
struct elf64_hppa_link_hash_table *hppa_info;
struct elf64_hppa_allocate_data data;
return false;
dynobj = hppa_info->root.dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
/* Mark each function this program exports so that we will allocate
space in the .opd section for each function's FPTR. If we are
#define elf_backend_adjust_dynamic_symbol \
elf64_hppa_adjust_dynamic_symbol
-#define elf_backend_size_dynamic_sections \
- elf64_hppa_size_dynamic_sections
+#define elf_backend_late_size_sections elf64_hppa_late_size_sections
#define elf_backend_finish_dynamic_symbol \
elf64_hppa_finish_dynamic_symbol
}
static bool
-elf64_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+elf64_ia64_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct elf64_ia64_allocate_data data;
struct elf64_ia64_link_hash_table *ia64_info;
struct elf_link_hash_table *hash_table;
hash_table = elf_hash_table (info);
- dynobj = hash_table->dynobj;
ia64_info = elf64_ia64_hash_table (info);
if (ia64_info == NULL)
return false;
- BFD_ASSERT(dynobj != NULL);
+ dynobj = hash_table->dynobj;
+ if (dynobj == NULL)
+ return true;
data.info = info;
/* Allocate the GOT entries. */
elf64_ia64_check_relocs
#define elf_backend_adjust_dynamic_symbol \
elf64_ia64_adjust_dynamic_symbol
-#define elf_backend_size_dynamic_sections \
- elf64_ia64_size_dynamic_sections
+#define elf_backend_late_size_sections \
+ elf64_ia64_late_size_sections
#define elf_backend_omit_section_dynsym \
_bfd_elf_omit_section_dynsym_all
#define elf_backend_relocate_section \
#define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag
#define elf_backend_adjust_dynamic_symbol \
_bfd_mips_elf_adjust_dynamic_symbol
-#define elf_backend_always_size_sections \
- _bfd_mips_elf_always_size_sections
-#define elf_backend_size_dynamic_sections \
- _bfd_mips_elf_size_dynamic_sections
+#define elf_backend_early_size_sections \
+ _bfd_mips_elf_early_size_sections
+#define elf_backend_late_size_sections \
+ _bfd_mips_elf_late_size_sections
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
#define elf_backend_relocate_section _bfd_mips_elf_relocate_section
#define elf_backend_finish_dynamic_symbol \
#define elf_backend_adjust_dynamic_symbol ppc64_elf_adjust_dynamic_symbol
#define elf_backend_hide_symbol ppc64_elf_hide_symbol
#define elf_backend_maybe_function_sym ppc64_elf_maybe_function_sym
-#define elf_backend_always_size_sections ppc64_elf_edit
-#define elf_backend_size_dynamic_sections ppc64_elf_size_dynamic_sections
+#define elf_backend_early_size_sections ppc64_elf_edit
+#define elf_backend_late_size_sections ppc64_elf_late_size_sections
#define elf_backend_hash_symbol ppc64_elf_hash_symbol
#define elf_backend_init_index_section _bfd_elf_init_2_index_sections
#define elf_backend_action_discarded ppc64_elf_action_discarded
((((v) & 0x3ffff0000ULL) << 16) | (v & 0xffff))
#define HA34(v) ((v + (1ULL << 33)) >> 34)
-/* Called via elf_link_hash_traverse from ppc64_elf_size_dynamic_sections
+/* Called via elf_link_hash_traverse from ppc64_elf_late_size_sections
to set up space for global entry stubs. These are put in glink,
after the branch table. */
/* Set the sizes of the dynamic sections. */
static bool
-ppc64_elf_size_dynamic_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+ppc64_elf_late_size_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
struct ppc_link_hash_table *htab;
bfd *dynobj;
dynobj = htab->elf.dynobj;
if (dynobj == NULL)
- abort ();
+ return true;
if (htab->elf.dynamic_sections_created)
{
entry but we found we will not create any. Called when we find we will
not have any PLT for this symbol, by for example
elf_s390_adjust_dynamic_symbol when we're doing a proper dynamic link,
- or elf_s390_size_dynamic_sections if no dynamic sections will be
+ or elf_s390_late_size_sections if no dynamic sections will be
created (we're only linking static objects). */
static void
/* Set the sizes of the dynamic sections. */
static bool
-elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+elf_s390_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct elf_s390_link_hash_table *htab;
bfd *dynobj;
dynobj = htab->elf.dynobj;
if (dynobj == NULL)
- abort ();
+ return true;
if (htab->elf.dynamic_sections_created)
{
#define elf_backend_gc_mark_hook elf_s390_gc_mark_hook
#define elf_backend_reloc_type_class elf_s390_reloc_type_class
#define elf_backend_relocate_section elf_s390_relocate_section
-#define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections
+#define elf_backend_late_size_sections elf_s390_late_size_sections
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
#define elf_backend_grok_prstatus elf_s390_grok_prstatus
#define elf_backend_grok_psinfo elf_s390_grok_psinfo
_bfd_sparc_elf_adjust_dynamic_symbol
#define elf_backend_omit_section_dynsym \
_bfd_sparc_elf_omit_section_dynsym
-#define elf_backend_size_dynamic_sections \
- _bfd_sparc_elf_size_dynamic_sections
+#define elf_backend_late_size_sections \
+ _bfd_sparc_elf_late_size_sections
#define elf_backend_relocate_section \
_bfd_sparc_elf_relocate_section
#define elf_backend_finish_dynamic_symbol \
#define elf_backend_check_relocs tilegx_elf_check_relocs
#define elf_backend_adjust_dynamic_symbol tilegx_elf_adjust_dynamic_symbol
#define elf_backend_omit_section_dynsym tilegx_elf_omit_section_dynsym
-#define elf_backend_size_dynamic_sections tilegx_elf_size_dynamic_sections
+#define elf_backend_late_size_sections tilegx_elf_late_size_sections
#define elf_backend_relocate_section tilegx_elf_relocate_section
#define elf_backend_finish_dynamic_symbol tilegx_elf_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections tilegx_elf_finish_dynamic_sections
}
static bool
-elf_x86_64_always_size_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+elf_x86_64_early_size_sections (bfd *output_bfd, struct bfd_link_info *info)
{
bfd *abfd;
elf_x86_64_scan_relocs))
return false;
- return _bfd_x86_elf_always_size_sections (output_bfd, info);
+ return _bfd_x86_elf_early_size_sections (output_bfd, info);
}
/* Return the relocation value for @tpoff relocation
elf_x86_64_reloc_name_lookup
#define elf_backend_relocs_compatible elf_x86_64_relocs_compatible
-#define elf_backend_always_size_sections elf_x86_64_always_size_sections
+#define elf_backend_early_size_sections elf_x86_64_early_size_sections
#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections
#define elf_backend_finish_dynamic_sections elf_x86_64_finish_dynamic_sections
#define elf_backend_finish_dynamic_symbol elf_x86_64_finish_dynamic_symbol
/* The backend may have to create some sections regardless of whether
we're dynamic or not. */
- if (bed->elf_backend_always_size_sections
- && ! (*bed->elf_backend_always_size_sections) (output_bfd, info))
+ if (bed->elf_backend_early_size_sections
+ && !bed->elf_backend_early_size_sections (output_bfd, info))
return false;
dynobj = elf_hash_table (info)->dynobj;
/* The backend must work out the sizes of all the other dynamic
sections. */
- if (dynobj != NULL
- && bed->elf_backend_size_dynamic_sections != NULL
- && ! (*bed->elf_backend_size_dynamic_sections) (output_bfd, info))
+ if (bed->elf_backend_late_size_sections != NULL
+ && !bed->elf_backend_late_size_sections (output_bfd, info))
return false;
if (dynobj != NULL && elf_hash_table (info)->dynamic_sections_created)
#define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag
#define elf_backend_adjust_dynamic_symbol \
_bfd_mips_elf_adjust_dynamic_symbol
-#define elf_backend_always_size_sections \
- _bfd_mips_elf_always_size_sections
-#define elf_backend_size_dynamic_sections \
- _bfd_mips_elf_size_dynamic_sections
+#define elf_backend_early_size_sections _bfd_mips_elf_early_size_sections
+#define elf_backend_late_size_sections _bfd_mips_elf_late_size_sections
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
#define elf_backend_relocate_section _bfd_mips_elf_relocate_section
#define elf_backend_finish_dynamic_symbol \
allocate space for one relocation on the slot. Record the GOT offset
for this symbol.
- elfNN_aarch64_size_dynamic_sections ()
+ elfNN_aarch64_late_size_sections ()
Iterate all input BFDS, look for in the local symbol data structure
constructed earlier for local TLS symbols and allocate them double
though ! */
static bool
-elfNN_aarch64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+elfNN_aarch64_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct elf_aarch64_link_hash_table *htab;
bfd *dynobj;
htab = elf_aarch64_hash_table ((info));
dynobj = htab->root.dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (htab->root.dynamic_sections_created)
{
_TLS_MODULE_BASE_, if needed. */
static bool
-elfNN_aarch64_always_size_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+elfNN_aarch64_early_size_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
asection *tls_sec;
#define elf_backend_adjust_dynamic_symbol \
elfNN_aarch64_adjust_dynamic_symbol
-#define elf_backend_always_size_sections \
- elfNN_aarch64_always_size_sections
+#define elf_backend_early_size_sections \
+ elfNN_aarch64_early_size_sections
#define elf_backend_check_relocs \
elfNN_aarch64_check_relocs
#define elf_backend_modify_headers \
elfNN_aarch64_modify_headers
-#define elf_backend_size_dynamic_sections \
- elfNN_aarch64_size_dynamic_sections
+#define elf_backend_late_size_sections \
+ elfNN_aarch64_late_size_sections
#define elf_backend_size_info \
elfNN_aarch64_size_info
}
static bool
-elfNN_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+elfNN_ia64_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct elfNN_ia64_allocate_data data;
struct elfNN_ia64_link_hash_table *ia64_info;
if (ia64_info == NULL)
return false;
dynobj = ia64_info->root.dynobj;
+ if (dynobj == NULL)
+ return true;
ia64_info->self_dtpmod_offset = (bfd_vma) -1;
- BFD_ASSERT(dynobj != NULL);
data.info = info;
/* Set the contents of the .interp section to the interpreter. */
elfNN_ia64_check_relocs
#define elf_backend_adjust_dynamic_symbol \
elfNN_ia64_adjust_dynamic_symbol
-#define elf_backend_size_dynamic_sections \
- elfNN_ia64_size_dynamic_sections
+#define elf_backend_late_size_sections \
+ elfNN_ia64_late_size_sections
#define elf_backend_omit_section_dynsym \
_bfd_elf_omit_section_dynsym_all
#define elf_backend_relocate_section \
/* This is the most important function of all . Innocuosly named
though ! */
static bool
-elfNN_kvx_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+elfNN_kvx_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct elf_kvx_link_hash_table *htab;
bfd *dynobj;
htab = elf_kvx_hash_table ((info));
dynobj = htab->root.dynobj;
-
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (htab->root.dynamic_sections_created)
{
_TLS_MODULE_BASE_, if needed. */
static bool
-elfNN_kvx_always_size_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+elfNN_kvx_early_size_sections (bfd *output_bfd, struct bfd_link_info *info)
{
asection *tls_sec;
#define elf_backend_adjust_dynamic_symbol \
elfNN_kvx_adjust_dynamic_symbol
-#define elf_backend_always_size_sections \
- elfNN_kvx_always_size_sections
+#define elf_backend_early_size_sections \
+ elfNN_kvx_early_size_sections
#define elf_backend_check_relocs \
elfNN_kvx_check_relocs
#define elf_backend_reloc_type_class \
elfNN_kvx_reloc_type_class
-#define elf_backend_size_dynamic_sections \
- elfNN_kvx_size_dynamic_sections
+#define elf_backend_late_size_sections \
+ elfNN_kvx_late_size_sections
#define elf_backend_can_refcount 1
#define elf_backend_can_gc_sections 1
}
static bool
-loongarch_elf_size_dynamic_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+loongarch_elf_late_size_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
struct loongarch_elf_link_hash_table *htab;
bfd *dynobj;
htab = loongarch_elf_hash_table (info);
BFD_ASSERT (htab != NULL);
dynobj = htab->elf.dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (htab->elf.dynamic_sections_created)
{
loongarch_elf_create_dynamic_sections
#define elf_backend_check_relocs loongarch_elf_check_relocs
#define elf_backend_adjust_dynamic_symbol loongarch_elf_adjust_dynamic_symbol
-#define elf_backend_size_dynamic_sections loongarch_elf_size_dynamic_sections
+#define elf_backend_late_size_sections loongarch_elf_late_size_sections
#define elf_backend_relocate_section loongarch_elf_relocate_section
#define elf_backend_finish_dynamic_symbol loongarch_elf_finish_dynamic_symbol
#define elf_backend_output_arch_local_syms \
}
static bool
-riscv_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
+riscv_elf_late_size_sections (bfd *output_bfd, struct bfd_link_info *info)
{
struct riscv_elf_link_hash_table *htab;
bfd *dynobj;
htab = riscv_elf_hash_table (info);
BFD_ASSERT (htab != NULL);
dynobj = htab->elf.dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (elf_hash_table (info)->dynamic_sections_created)
{
#define elf_backend_create_dynamic_sections riscv_elf_create_dynamic_sections
#define elf_backend_check_relocs riscv_elf_check_relocs
#define elf_backend_adjust_dynamic_symbol riscv_elf_adjust_dynamic_symbol
-#define elf_backend_size_dynamic_sections riscv_elf_size_dynamic_sections
+#define elf_backend_late_size_sections riscv_elf_late_size_sections
#define elf_backend_relocate_section riscv_elf_relocate_section
#define elf_backend_finish_dynamic_symbol riscv_elf_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections riscv_elf_finish_dynamic_sections
check for any mips16 stub sections that we can discard. */
bool
-_bfd_mips_elf_always_size_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+_bfd_mips_elf_early_size_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
asection *sect;
struct mips_elf_link_hash_table *htab;
/* Set the sizes of the dynamic sections. */
bool
-_bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+_bfd_mips_elf_late_size_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *s, *sreldyn;
htab = mips_elf_hash_table (info);
BFD_ASSERT (htab != NULL);
dynobj = elf_hash_table (info)->dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (elf_hash_table (info)->dynamic_sections_created)
{
input_section->flags &= ~SEC_HAS_CONTENTS;
}
- /* Size has been set in _bfd_mips_elf_always_size_sections. */
+ /* Size has been set in _bfd_mips_elf_early_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_always_size_sections. */
+ /* Size has been set in _bfd_mips_elf_early_size_sections. */
BFD_ASSERT(o->size == sizeof (Elf32_External_RegInfo));
/* Skip this section later on (I don't think this currently
(bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
extern bool _bfd_mips_elf_adjust_dynamic_symbol
(struct bfd_link_info *, struct elf_link_hash_entry *);
-extern bool _bfd_mips_elf_always_size_sections
+extern bool _bfd_mips_elf_early_size_sections
(bfd *, struct bfd_link_info *);
-extern bool _bfd_mips_elf_size_dynamic_sections
+extern bool _bfd_mips_elf_late_size_sections
(bfd *, struct bfd_link_info *);
extern int _bfd_mips_elf_relocate_section
(bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
/* Set the sizes of the dynamic sections. */
bool
-_bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+_bfd_sparc_elf_late_size_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
struct _bfd_sparc_elf_link_hash_table *htab;
bfd *dynobj;
htab = _bfd_sparc_elf_hash_table (info);
BFD_ASSERT (htab != NULL);
dynobj = htab->elf.dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (elf_hash_table (info)->dynamic_sections_created)
{
(struct bfd_link_info *, struct elf_link_hash_entry *);
extern bool _bfd_sparc_elf_omit_section_dynsym
(bfd *, struct bfd_link_info *, asection *);
-extern bool _bfd_sparc_elf_size_dynamic_sections
+extern bool _bfd_sparc_elf_late_size_sections
(bfd *, struct bfd_link_info *);
extern bool _bfd_sparc_elf_new_section_hook
(bfd *, asection *);
#ifndef elf_backend_adjust_dynamic_symbol
#define elf_backend_adjust_dynamic_symbol 0
#endif
-#ifndef elf_backend_always_size_sections
-#define elf_backend_always_size_sections 0
+#ifndef elf_backend_early_size_sections
+#define elf_backend_early_size_sections 0
#endif
-#ifndef elf_backend_size_dynamic_sections
-#define elf_backend_size_dynamic_sections 0
+#ifndef elf_backend_late_size_sections
+#define elf_backend_late_size_sections 0
#endif
#ifndef elf_backend_strip_zero_sized_dynamic_sections
#define elf_backend_strip_zero_sized_dynamic_sections 0
elf_backend_check_directives,
elf_backend_notice_as_needed,
elf_backend_adjust_dynamic_symbol,
- elf_backend_always_size_sections,
- elf_backend_size_dynamic_sections,
+ elf_backend_early_size_sections,
+ elf_backend_late_size_sections,
elf_backend_strip_zero_sized_dynamic_sections,
elf_backend_init_index_section,
elf_backend_relocate_section,
}
bool
-tilegx_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+tilegx_elf_late_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct tilegx_elf_link_hash_table *htab;
bfd *dynobj;
htab = tilegx_elf_hash_table (info);
BFD_ASSERT (htab != NULL);
dynobj = htab->elf.dynobj;
- BFD_ASSERT (dynobj != NULL);
+ if (dynobj == NULL)
+ return true;
if (elf_hash_table (info)->dynamic_sections_created)
{
asection *);
extern bool
-tilegx_elf_size_dynamic_sections (bfd *, struct bfd_link_info *);
+tilegx_elf_late_size_sections (bfd *, struct bfd_link_info *);
extern int
tilegx_elf_relocate_section (bfd *, struct bfd_link_info *,
/* Set the sizes of the dynamic sections. */
bool
-_bfd_x86_elf_size_dynamic_sections (bfd *output_bfd,
+_bfd_x86_elf_late_size_sections (bfd *output_bfd,
struct bfd_link_info *info)
{
struct elf_x86_link_hash_table *htab;
return false;
dynobj = htab->elf.dynobj;
if (dynobj == NULL)
- abort ();
+ return true;
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
bool
-_bfd_x86_elf_always_size_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+_bfd_x86_elf_early_size_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
asection *tls_sec = elf_hash_table (info)->tls_sec;
const Elf_Internal_Rela *, struct elf_link_hash_entry *,
Elf_Internal_Sym *, Elf_Internal_Shdr *, bool *) ATTRIBUTE_HIDDEN;
-extern bool _bfd_x86_elf_size_dynamic_sections
+extern bool _bfd_x86_elf_late_size_sections
(bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
extern struct elf_x86_link_hash_table *_bfd_x86_elf_finish_dynamic_sections
(bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
-extern bool _bfd_x86_elf_always_size_sections
+extern bool _bfd_x86_elf_early_size_sections
(bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
extern void _bfd_x86_elf_merge_symbol_attribute
#define elf_backend_check_relocs \
_bfd_x86_elf_check_relocs
-#define elf_backend_size_dynamic_sections \
- _bfd_x86_elf_size_dynamic_sections
+#define elf_backend_late_size_sections \
+ _bfd_x86_elf_late_size_sections
#define elf_backend_merge_symbol_attribute \
_bfd_x86_elf_merge_symbol_attribute
#define elf_backend_copy_indirect_symbol \
/* The backend must work out the sizes of all the other dynamic
sections. */
- if (elf_hash_table (&link_info)->dynamic_sections_created
- && bed->elf_backend_size_dynamic_sections
- && ! (*bed->elf_backend_size_dynamic_sections) (link_info.output_bfd,
- &link_info))
+ if (bed->elf_backend_late_size_sections
+ && !bed->elf_backend_late_size_sections (link_info.output_bfd,
+ &link_info))
einfo (_("%F%P: failed to set dynamic section sizes: %E\n"));
before_allocation_default ();