This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Your change breaks gdb on ld.so
- From: "H . J . Lu" <hjl at lucon dot org>
- To: jimb at redhat dot com
- Cc: GDB <gdb at sources dot redhat dot com>
- Date: Fri, 22 Mar 2002 10:41:43 -0800
- Subject: Re: Your change breaks gdb on ld.so
- References: <20020322100523.A12659@lucon.org>
On Fri, Mar 22, 2002 at 10:05:23AM -0800, H . J . Lu wrote:
>
> Hi Jim,
>
> I believe your change
>
> http://sources.redhat.com/ml/gdb-patches/2001-10/msg00304.html
>
> causes
>
> http://sources.redhat.com/ml/gdb/2002-03/msg00155.html
>
> You replaced
>
> text_offset = pst->textlow;
>
> with
>
> text_offset = TEXTLOW (pst);
>
>
> in read_ofile_symtab. When I did
>
> # gdb gdb
> (gdb) r /lib/ld-linux.so.2
> (top-gdb) p *(struct symloc *)((pst)->read_symtab_private)
> $7 = {textlow = 6208, texthigh = 18842, ldsymoff = 12, ldsymlen = 28668,
> symbol_size = 12, symbol_offset = 88832, string_offset = 0,
> file_string_offset = 0}
> (top-gdb) p *pst
> $8 = {next = 0x0, filename = 0x401f9018 "rtld.c", fullname = 0x0,
> objfile = 0x823e700, section_offsets = 0x824a6b0, textlow = 2147489856,
> texthigh = 2147502490, dependencies = 0x0, number_of_dependencies = 0,
> globals_offset = 0, n_global_syms = 29, statics_offset = 0,
> n_static_syms = 578, symtab = 0x0,
> read_symtab = 0x80f74c4 <dbx_psymtab_to_symtab>,
> read_symtab_private = 0x82610a8 "@\030", readin = 0 '\0'}
>
> 2 textlow's aren't the same.
>
The problem is p->textlow and p->texthigh are adjusted in
objfile_relocate. But your patch doesn't take that into account. As
the result, TEXTLOW/TEXTHIGH have incorrect values.
H.J.