[PATCH] bfd: sframe: fix PR ld/33199

Indu Bhagat indu.bhagat@oracle.com
Thu Aug 14 05:14:56 GMT 2025


Fix PR ld/33199 SEGV in _bfd_x86_elf_create_sframe_plt

Currently, the selection for sframe_plt was not being done (and simply
set to NULL) for the case when !normal_target, causing SEGV on Solaris.
Initialize sframe_plt to init_table->sframe_lazy_plt when lazy_plt is
true, and NULL otherwise.  This is in line with htab->non_lazy_plt being
set to NULL for !normal_target.

bfd/
	PR ld/33199
	* elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
	Setup sframe_plt for !normal_target.
---
 bfd/elfxx-x86.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index 3dc00956eef..fb8bac43da7 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -4605,7 +4605,12 @@ _bfd_x86_elf_link_setup_gnu_properties
 	}
     }
   else
-    htab->sframe_plt = NULL;
+    {
+      if (lazy_plt)
+	htab->sframe_plt = init_table->sframe_lazy_plt;
+      else
+	htab->sframe_plt = NULL;
+    }
 
   /* If the non-lazy PLT is available, use it for all PLT entries if
      there are no PLT0 or no .plt section.  */
-- 
2.43.0



More information about the Binutils mailing list