Re: [PATCH] [PR 25678] gdb crashes with "internal-error: sect_index_text not initialized" when .text

Simon Marchi
2020-05-17T14:01:30Z

On 2020-05-17 3:01 a.m., Andreas Schwab wrote:
> On Mai 16 2020, Simon Marchi wrote:
>
>> All the versions of libicudata.so I found in Ubuntu/Debian do have a .text
>> section.
>
> This is a debian local patch. By default, libicudata is linked with
> -nodefaultlibs -nostdlib, and the only included object file has no .text
> section.
>
> Andreas.

Thanks Andreas for the tip, I didn't think of checking the distro patches.

I was able to reproduce with this:

$ cat allo.c
int salut;
$ gcc allo.c -fPIC -o allo.o -g3 -O0 -c
$ gcc allo.o -shared -nostdlib -nodefaultlibs -o allo.so
$ ./gdb -q -nx a.out
Reading symbols from a.out...
(gdb) start
Temporary breakpoint 1 at 0x1136: file test.c, line 1.
Starting program: /home/smarchi/build/binutils-gdb/gdb/a.out
/home/smarchi/src/binutils-gdb/gdb/objfiles.h:524: internal-error: sect_index_text not initialized
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)

Simon