diff options
author | Alan Modra <amodra@gmail.com> | 2024-03-28 19:25:42 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2024-04-02 10:32:04 +1030 |
commit | af969b14aedcc0ae27dcefab4327ff2d153dec8b (patch) | |
tree | 0798575242610edd85068427a07f486ee5750660 /bfd/elf64-ia64-vms.c | |
parent | f37f8c46c2e876a524301d6916a04cf7debb6483 (diff) | |
download | fsf-binutils-gdb-af969b14aedcc0ae27dcefab4327ff2d153dec8b.zip fsf-binutils-gdb-af969b14aedcc0ae27dcefab4327ff2d153dec8b.tar.gz fsf-binutils-gdb-af969b14aedcc0ae27dcefab4327ff2d153dec8b.tar.bz2 |
PR 30569, always call elf_backend_size_dynamic_sections
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.
Diffstat (limited to 'bfd/elf64-ia64-vms.c')
-rw-r--r-- | bfd/elf64-ia64-vms.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bfd/elf64-ia64-vms.c b/bfd/elf64-ia64-vms.c index aa058a1..54133c9 100644 --- a/bfd/elf64-ia64-vms.c +++ b/bfd/elf64-ia64-vms.c @@ -2591,8 +2591,8 @@ elf64_ia64_adjust_dynamic_symbol (struct bfd_link_info *info ATTRIBUTE_UNUSED, } 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; @@ -2601,11 +2601,12 @@ elf64_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, 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. */ @@ -5486,8 +5487,8 @@ static const struct elf_size_info elf64_ia64_vms_size_info = { 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 \ |