This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Win32 dlls without .text section
- From: egor duda <deo at logos-m dot ru>
- To: Christopher Faylor <cgf at redhat dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Sun, 15 Dec 2002 11:25:17 +0300
- Subject: Re: Win32 dlls without .text section
- Organization: deo
- References: <30457373598.20020926190638@logos-m.ru><689018337.20021210195014@logos-m.ru> <20021215045807.GA1745@redhat.com>
- Reply-to: egor duda <gdb at sources dot redhat dot com>
Hi!
Sunday, 15 December, 2002 Christopher Faylor cgf@redhat.com wrote:
CF> On Tue, Dec 10, 2002 at 07:50:14PM +0300, egor duda wrote:
>>Thursday, 26 September, 2002 egor duda deo@logos-m.ru wrote:
>>ed>Certain win32 dlls may have no .text section, but contain only .rsrc
>>ed>and .reloc sections. When such dll is loaded by application, and we
>>ed>try to run or attach to such application with gdb, we'll got
>>ed>internal_error in coffread.c (function coff_end_symtab).
>>
>>ed>What is the proper way to deal with such problem? Ignore files without
>>ed>.text section altogether? Try to deal with them? I'm not sure i fully
>>ed>understand why text section is needed to load symbol table. Can
>>ed>anybody explain?
>>
>>The patch to fix this problem:
>>
>>2002-12-10 Egor Duda <deo@logos-m.ru>
>>
>> * coffread.c (coff_symtab_read): Skip reading symbols from files
>> without text section to avoid internal errors.
CF> Does this really fix the problem or work around it? It seems like this patch
CF> might stop symtab reading for the whole dll rather than just ignore the fact
CF> that the dll has no text section.
What i have deduced from the gdb code (i have no formal COFF
specification, so i may be obviously wrong in my reasoning) is that
coff file must have text section to have a symbol table. The comment
before end_symtab() in buildsym.c says:
END_ADDR is the address of the end of the file's text. SECTION is
the section number (in objfile->section_offsets) of the blockvector
and linetable.
As far, as i understand, linetable may be absent, but there should
always be a blockvector.
Binutils always create a text section. I've seen file without text
section only once (though i have no experience with coff-based
platforms other than win32 and dos ones), and it have no debugging
symbols, so i'm not sure if it's possible at all to have a valid coff
file with debugging symbols AND without text section. If such files do
exist then my patch is a workaround, otherwise i think it's a fix :)
Egor. mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19