5.1 PATCH: Allow gdb to link on mips-sgi-irix5.3
Rainer Orth
ro@TechFak.Uni-Bielefeld.DE
Mon Jul 30 13:14:00 GMT 2001
[For some reason, I didn't get a copy of this message, but only found it in
the mailing list archive.]
Elena Zannoni writes:
> For ths particualr error, can you take a look at the threads:
> http://sources.redhat.com/ml/gdb-patches/2001-05/msg00178.html
> http://sources.redhat.com/ml/gdb-patches/2001-05/msg00187.html A
> similar problem was reported but a fix was not generated. Hopefully
> the discussion there that can help pinpoint your problem.
Indeed, and I have already re-discovered this problem on Tru64 UNIX, see PR
gdb/182. What's the problem with the fix above? Without it, gdb on Tru64
UNIX is practically unusable.
The problem with O32/mdebug on IRIX is similar: the binary in question has
no data section, and running the mips-sgi-irix5.3 gdb under gdb reveals
that the value of the symbol that causes the internal error reported is
just the address of the .rodata section.
The problem seems to be that mdebugread.c first uses SC_IS_DATA() to
determine what section a symbol belongs to (which allows .data, .sdata,
.rodata etc. sections), and than only uses SECT_OFF_DATA, which only works
for the .data section.
Here's readelf -S output for reference:
There are 20 section headers, starting at offset 0x6538:
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .interp PROGBITS 00400134 000134 000013 00 A 0 0 4
[ 2] .MIPS.options MIPS_OPTIONS 00400148 000148 000080 00 Ao 0 0 8
[ 3] .reginfo MIPS_REGINFO 004001c8 0001c8 000018 18 A 0 0 4
[ 4] .dynamic DYNAMIC 004001e0 0001e0 000100 08 A 6 0 4
[ 5] .liblist MIPS_LIBLIST 004002e0 0002e0 000014 14 A 6 1 4
[ 6] .dynstr STRTAB 004002f4 0002f4 00017f 00 A 0 0 4
[ 7] .hash HASH 00400474 000474 0001b8 04 A 8 0 4
[ 8] .dynsym DYNSYM 0040062c 00062c 0002c0 10 A 6 4 4
[ 9] .MIPS.symlib MIPS_SYMBOL_LIB 004008ec 0008ec 00002c 01 A 8 5 1
[10] .msym MIPS_MSYM 00400918 000918 000160 08 A 6 0 4
[11] .MIPS.stubs PROGBITS 00400a78 000a78 000044 04 AX 0 0 4
[12] .text PROGBITS 00400ac0 000ac0 000180 01 AX 0 0 16
[13] .init PROGBITS 00400c40 000c40 000020 01 AX 0 0 16
[14] .rodata PROGBITS 10004000 004000 000010 01 WA 0 0 16
[15] .got PROGBITS 10004010 004010 00006c 04 WAp 0 0 4
[16] .bss NOBITS 1000407c 00407c 00000c 00 WA 0 0 4
[17] .mdebug MIPS_DEBUG 00000000 005000 001464 01 0 0 4
[18] .compact_rel PROGBITS 00000000 006464 000030 00 0 0 4
[19] .shstrtab STRTAB 00000000 006494 0000a4 00 0 0 0
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
> This seems to be a bogus regnumber that is outside the range defined
> for your target.
As Eli Zaretskii already pointed out, this error does not occur in a
mips-sgi-irix6.2 configuration. Nonetheless the fix should probably go
into the mips-sgi-irix5.3 config, too.
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Email: ro@TechFak.Uni-Bielefeld.DE
More information about the Gdb-patches
mailing list