gdb/gdb-Set-entry-point-when-text-segment-is.patch

31 lines
774 B
Diff

https://sourceware.org/PR25678
https://bugs.gentoo.org/724614
From: mlimber <mlimber@gmail.com>
Date: Thu, 14 May 2020 13:09:05 -0400
Subject: [PATCH] PR symtab/25678: Set entry point when text segment is
missing. From patch by Jeremie Courreges-Anglas.
PR symtab/25678
* symfile.c: Set entry point when text segment is missing.
From patch by Jeremie Courreges-Anglas:
https://marc.info/?l=openbsd-ports&m=146569238229407&w=2
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -878,7 +878,12 @@ struct symfile_segment_data *
}
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;
+ }
}
}
--
1.9.1