This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
binutils is broken on ELF/MIPS (Re: Does gdb 5.2 support gcc 3.1.1 on Linux/mips?)
On Mon, Jun 03, 2002 at 09:29:59AM -0700, H . J . Lu wrote:
>
> Ok, it does look like a linker bug. For Linux/mipsel:
>
> # readelf -S ~/tmp/s.o| grep .debug_str
> [26] .debug_str MIPS_DWARF 00000000 00103f 000a96 01 MS 0 0 1
> # readelf -S ~/tmp/s| grep .debug_str
> [30] .debug_str MIPS_DWARF 00000000 002048 000a2a 01 MS 0 0 1
>
> Please note that on Linux/mipsel, the .debug_str section type is
> MIPS_DWARF, not like PROGBITS on Linux/x86. Also it is marked "MS".
> Somehow, linker failed to handle it and gdb complained:
>
> 3733 error ("DW_FORM_strp pointing outside of .debug_str section");
> (top-gdb) list
> 3728 error ("DW_FORM_strp used without .debug_str section");
> 3729 return NULL;
> 3730 }
> 3731 if (str_offset >= dwarf_str_size)
> 3732 {
> 3733 error ("DW_FORM_strp pointing outside of .debug_str section");
> 3734 return NULL;
> 3735 }
> 3736 gdb_assert (HOST_CHAR_BIT == 8);
> 3737 if (dwarf_str_buffer[str_offset] == '\0')
> (top-gdb) print str_offset
> $9 = 2617
> (top-gdb) print dwarf_str_size
> $10 = 2602
>
> Jakub, it looks like a SHF_MERGE related bug. Any ideas?
>
> Thanks.
>
Jakub, I believe your patch
http://sources.redhat.com/ml/binutils/2001-11/msg00580.html
breaks ELF/MIPS since it didn't modify ELF/MIPS to support relocating
STT_SECTION sym in SHF_MERGE section. As the result, the ELF/MIPS
linker generates incorrect debug information. Could you please look
into it?
BTW, I don't know if ELF/MIPS is the only broken target.
Thanks.
H.J.