aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-s390.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2024-03-28 19:25:42 +1030
committerAlan Modra <amodra@gmail.com>2024-04-02 10:32:04 +1030
commitaf969b14aedcc0ae27dcefab4327ff2d153dec8b (patch)
tree0798575242610edd85068427a07f486ee5750660 /bfd/elf32-s390.c
parentf37f8c46c2e876a524301d6916a04cf7debb6483 (diff)
downloadgdb-af969b14aedcc0ae27dcefab4327ff2d153dec8b.zip
gdb-af969b14aedcc0ae27dcefab4327ff2d153dec8b.tar.gz
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/elf32-s390.c')
-rw-r--r--bfd/elf32-s390.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index bd9eb1e..2b97b7d 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -1366,7 +1366,7 @@ elf_s390_gc_mark_hook (asection *sec,
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
@@ -1776,8 +1776,8 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
/* 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;
@@ -1788,7 +1788,7 @@ elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
htab = elf_s390_hash_table (info);
dynobj = htab->elf.dynobj;
if (dynobj == NULL)
- abort ();
+ return true;
if (htab->elf.dynamic_sections_created)
{
@@ -3925,7 +3925,7 @@ elf32_s390_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
#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