Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Ansuel/f689afa59b211ed546effd682859d9d0 to your computer and use it in GitHub Desktop.
Save Ansuel/f689afa59b211ed546effd682859d9d0 to your computer and use it in GitHub Desktop.
From ec2e1dae5d46a002c8450b6b74315a9c5a9e3055 Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Wed, 20 Mar 2024 18:58:31 +0100
Subject: [PATCH] Move elf_backend_always_size_sections check later
* elflink.c (bfd_elf_size_dynamic_sections): Move
elf_backend_always_size_sections check later after elf size group
sections check. This fix link error with mips 24kc+24kf arch.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
bfd/elflink.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 5a6cb07b2ce..1e54c237b5e 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -6665,12 +6665,6 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
bed = get_elf_backend_data (output_bfd);
- /* 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))
- return false;
-
dynobj = elf_hash_table (info)->dynobj;
if (dynobj != NULL && elf_hash_table (info)->dynamic_sections_created)
@@ -7158,6 +7152,12 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
&& !_bfd_elf_size_group_sections (info))
return false;
+ /* 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))
+ return false;
+
/* Determine any GNU_STACK segment requirements, after the backend
has had a chance to set a default segment size. */
if (info->execstack)
--
2.43.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment