set entry point when text segment is missing

This commit is contained in:
cenhuilin 2022-07-08 03:36:57 +00:00
parent 05455579d3
commit 2ea7c9df03
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From 6490b5d2ec9c575757308c860c48b75c8e824bfe Mon Sep 17 00:00:00 2001
From: cenhuilin <cenhuilin@kylinos.cn>
Date: Fri, 8 Jul 2022 03:22:14 +0000
Subject: [PATCH] gdb set entry point when text segment is missing
---
gdb/symfile.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 0eb48d0..9137183 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -863,7 +863,12 @@ init_entry_point_info (struct objfile *objfile)
}
if (!found)
- ei->the_bfd_section_index = SECT_OFF_TEXT (objfile);
+ {
+ if (objfile->sect_index_text == -1)
+ ei->entry_point_p = 0;
+ else
+ ei->the_bfd_section_index = objfile->sect_index_text;
+ }
}
}
--
2.33.0

View File

@ -1,6 +1,6 @@
Name: gdb
Version: 11.1
Release: 2
Release: 3
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL-1.3
Source: ftp://sourceware.org/pub/gdb/releases/gdb-%{version}.tar.xz
@ -94,6 +94,7 @@ Patch81: gdb-rhbz2022177-dprintf-2.patch
# Fedra patch end
Patch82: 0001-Make-c-exp.y-work-with-Bison-3.8.patch
Patch83: 0002-set-entry-point-when-text-segment-is-missing.patch
%global gdb_src gdb-%{version}
%global gdb_build build-%{_target_platform}
@ -365,6 +366,9 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/gdb/python/gdb/command/backtrace.py
%{_infodir}/gdb.info*
%changelog
* Fri Jul 8 2022 cenhuilin <cenhuilin@kylinos.cn> - 11.1-3
- set entry point when text segment is missing
* Tue Apr 12 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 11.1-2
- fix gdb build error via cherry-pick upstream patch