From 83e747fefc743262fbe2929753fe4457a8a2b5d5 Mon Sep 17 00:00:00 2001 From: roy Date: Fri, 9 Aug 2024 15:09:14 +0800 Subject: [PATCH] Set entry point when text segment is missing. --- ...Set-entry-point-when-text-segment-is.patch | 33 +++++++++++++++++++ gdb.spec | 6 +++- v1.5-libipt-static.patch | 13 -------- 3 files changed, 38 insertions(+), 14 deletions(-) create mode 100644 gdb-Set-entry-point-when-text-segment-is.patch delete mode 100644 v1.5-libipt-static.patch diff --git a/gdb-Set-entry-point-when-text-segment-is.patch b/gdb-Set-entry-point-when-text-segment-is.patch new file mode 100644 index 0000000..cd8bbfc --- /dev/null +++ b/gdb-Set-entry-point-when-text-segment-is.patch @@ -0,0 +1,33 @@ +From db9db842dc669f5c77f183a17d35f2b6a8011097 Mon Sep 17 00:00:00 2001 +From: YuPeng +Date: Tue, 12 Nov 2024 17:04:38 +0800 +Subject: [PATCH] gdb-Set-entry-point-when-text-segment-is + +Signed-off-by: YuPeng +Confilct:NA +Reference:https://marc.info/?l=openbsd-ports&m=146569238229407&w=2 +--- + gdb/symfile.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/gdb/symfile.c b/gdb/symfile.c +index a2d9980..09a6bd7 100644 +--- a/gdb/symfile.c ++++ b/gdb/symfile.c +@@ -883,7 +883,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 926ed7b..1373faa 100644 --- a/gdb.spec +++ b/gdb.spec @@ -1,6 +1,6 @@ Name: gdb Version: 11.1 -Release: 9 +Release: 10 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 @@ -106,6 +106,7 @@ Patch87: 0005-gdb-Add-LoongArch-clfs-system.patch Patch88: backport-CVE-2023-39128.patch Patch89: backport-CVE-2023-39129.patch Patch90: backport-CVE-2023-39130.patch +Patch91: gdb-Set-entry-point-when-text-segment-is.patch %global gdb_src gdb-%{version} %global gdb_build build-%{_target_platform} @@ -382,6 +383,9 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/gdb/python/gdb/command/backtrace.py %{_infodir}/gdb.info* %changelog +* Fri Aug 09 2024 Yu Peng - 11.1-10 +- Set entry point when text segment is missing. + * Wed Jun 12 2024 wangxiao - 11.1-9 - modify gdb-help package's license GFDL to GFDL-1.3-or-later diff --git a/v1.5-libipt-static.patch b/v1.5-libipt-static.patch deleted file mode 100644 index 69e1d1a..0000000 --- a/v1.5-libipt-static.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: processor-trace-2.0/libipt/src/posix/init.c -=================================================================== ---- processor-trace-2.0.orig/libipt/src/posix/init.c -+++ processor-trace-2.0/libipt/src/posix/init.c -@@ -29,7 +29,7 @@ - #include "pt_ild.h" - - --static void __attribute__((constructor)) init(void) -+void __libipt_init(void) - { - /* Initialize the Intel(R) Processor Trace instruction decoder. */ - pt_ild_init(); -- Gitee