diff --git a/0002-set-entry-point-when-text-segment-is-missing.patch b/0002-set-entry-point-when-text-segment-is-missing.patch new file mode 100644 index 0000000000000000000000000000000000000000..aa6ef9a47b9266b8cda0b8d7c6542029d96f36b0 --- /dev/null +++ b/0002-set-entry-point-when-text-segment-is-missing.patch @@ -0,0 +1,30 @@ +From 6490b5d2ec9c575757308c860c48b75c8e824bfe Mon Sep 17 00:00:00 2001 +From: cenhuilin +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 + diff --git a/gdb.spec b/gdb.spec index 27a1c8ea396833c57f9fedbd465c8a27e7729776..230849a0ff078ba106bf9b88cf536e0a4ab660de 100644 --- a/gdb.spec +++ b/gdb.spec @@ -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 - 11.1-3 +- set entry point when text segment is missing + * Tue Apr 12 2022 zhouwenpei - 11.1-2 - fix gdb build error via cherry-pick upstream patch