aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-x86.c
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@kernel.org>2024-11-01 15:26:13 -0700
committerIndu Bhagat <indu.bhagat@oracle.com>2024-11-01 15:31:21 -0700
commit1785837a25709721358dab9ee16bbfee74f5f4d1 (patch)
tree47c9a89938437c8475ac3694dc6522f8bbd17486 /bfd/elfxx-x86.c
parent360f74a101937d1c26e5e0b341043bac6e2d299d (diff)
downloadgdb-1785837a25709721358dab9ee16bbfee74f5f4d1.zip
gdb-1785837a25709721358dab9ee16bbfee74f5f4d1.tar.gz
gdb-1785837a25709721358dab9ee16bbfee74f5f4d1.tar.bz2
ld: fix PR/32297
When _creating_ SFrame information for the linker created .plt.sec, the code correctly checks for presence of .plt.sec. When _writing_ the SFrame section for the corresponding .plt.sec, however, the conditionals were wrongly checking for splt. This was causing an assertion at link time. This issue has been known to affect glibc build with SFrame enabled. No testcase is added just yet. A later commit ensures correct SFrame stack trace information is created for .plt.got. A test case (where only .plt and .plt.got are created) is added then. PR/32297 sframe: bfd assertion with empty main on IBT enabled system Committed by Indu Bhagat. ChangeLog: PR/32297 * bfd/elfxx-x86.c (_bfd_x86_elf_late_size_sections): Check for plt_second member not for splt.
Diffstat (limited to 'bfd/elfxx-x86.c')
-rw-r--r--bfd/elfxx-x86.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index dd951b9..0d83ce5 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -2680,8 +2680,8 @@ _bfd_x86_elf_late_size_sections (bfd *output_bfd,
_bfd_x86_elf_write_sframe_plt (output_bfd, info, SFRAME_PLT);
if (htab->plt_second_sframe != NULL
- && htab->elf.splt != NULL
- && htab->elf.splt->size != 0
+ && htab->plt_second != NULL
+ && htab->plt_second->size != 0
&& htab->plt_second_sframe->contents == NULL)
_bfd_x86_elf_write_sframe_plt (output_bfd, info, SFRAME_PLT_SEC);
}