From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9090F3858D28; Tue, 11 Apr 2023 21:58:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9090F3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681250285; bh=wDDnu39QHBtV+FOcsigIz7mL12H8slwqwHJvx+PSllk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uAN/ws7A9Dq1g7Ygj+PznSYiaCZKiL/hdAoq4gR3tJTbN4en5q/TvdKJCGhNASoc2 dFn2COg0H3DQDp/5ztul04guC6FjEiDh3RsiXQD68o2Bl38x/RkLhh7EZx/JJkw2pS eL8BfavikClZc4VeAL6VkoG5+U3n2SSffXLO30ek= From: "jreiser at BitWagon dot com" To: gdb-prs@sourceware.org Subject: [Bug symtab/25678] gdb crashes with "internal-error: sect_index_text not initialized" when .text missing and >2 segments Date: Tue, 11 Apr 2023 21:58:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jreiser at BitWagon dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D25678 John Reiser changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jreiser at BitWagon dot com --- Comment #12 from John Reiser --- I see this when I dlopen() a shared library that has (Elf64_Ehdr.e_shnum = =3D=3D 0) : =3D=3D=3D=3D=3D GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git /build/gdb-MVZsgD/gdb-10.1/gdb/symfile.c:878: internal-error: sect_index_te= xt not initialized A problem internal to GDB has been detected, further debugging may prove unreliable. Create a core file of GDB? (y or n) =3D=3D=3D=3D=3D Relying on the current libbfd, which looks only at ElfXX_Shdr (and not at ElfXX_Phdr{PT_DYNAMIC}), is not adequate when debugging execution. Neither= the operating system {Linux kernel), nor the run-time dynamic linker (rtld or ld-linux.so} pays any attention to ElfXX_Shdr. Instead, execution is controlled entirely by the ElfXX_Phdr. In particular, the PT_DYNAMIC segme= nt with its entries for PT_SYMTAB, PT_STRTAB, PT_GNU_HASH, PT_VERSYM, PT_VERNE= ED contain the same information that the SHT_DYNSYM, SHT_STRTAB, SHT_GNU_HASH, SHT_VERSYM, SHT_VERNEED sections may have once contained. So if ElfXX_Shdr cannot be found or do not look right, then libbfd and/or gdb should consult= the ELFXX_Phdr{PT_DYNAMIC}. --=20 You are receiving this mail because: You are on the CC list for the bug.=