From: Elena Zannoni <ezannoni@cygnus.com>
To: "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>
Cc: gdb@sourceware.cygnus.com, ezannoni@cygnus.com
Subject: Re: Problem with 2000-05-05 elfread.c change
Date: Mon, 02 Oct 2000 19:01:00 -0000 [thread overview]
Message-ID: <14809.15857.439093.624776@kwikemart.cygnus.com> (raw)
In-Reply-To: <200010021704.TAA02459@reisser.regent.e-technik.tu-muenchen.de>
Peter.Schauer writes:
I believe you. I was working on getting rid of that limit by
allocating stuff dynamically for the sections, but I didn't finish
it. Maybe I can find some time soon to finish it, but cannot guarantee
it. I'll see what I can do.
The change in elfread.c is however necessary to fix other problems.
Sorry.
Elena
> Problem with 2000-05-05 elfread.c change
>
> This change:
>
> 2000-05-05 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
>
> * elfread.c (elf_symtab_read): The calculation of 'offset'
> must be done for each symbol, not just once. The index
> used must be the index of the section where 'sym' resides,
> not .text.
>
> causes subtle and difficult to track down problems with some gcc compiled C++
> executables.
> These executables have a very large number of .gnu.linkonce sections
> when using native ld on Solaris (I have not yet tried GNU ld, but GDB
> should work with executables generated with native ld).
> As an example, testsuite/gdb.c++/virtfunc contains 95 sections, our large
> C++ application 2750 sections.
>
> The large number of sections causes an indexing beyond the bounds of the
> offsets array in the ANOFFSET macro, which does no bounds checking.
> So intermittent garbage is obtained for the offset value, causing
> symbols to obtain the wrong address.
>
>
> I hope that you have access to a GNU Solaris toolchain using native ld.
>
> You should then be able to verify the problem by applying the ANOFFSET
> bounds checking kludge below (can't use SECT_OFF_MAX, because not all users
> of ANOFFSET include gdb-stabs.h).
>
> Run the resulting GDB on testsuite/gdb.c++/virtfunc and watch it die...
>
> *** ./symtab.h.orig Fri Sep 15 21:27:33 2000
> --- ./symtab.h Fri Sep 29 23:22:48 2000
> ***************
> *** 831,837 ****
>
> #define ANOFFSET(secoff, whichone) \
> ((whichone == -1) ? \
> ! (internal_error ("Section index is uninitialized"), -1) : secoff->offsets[whichone])
>
> /* The maximum possible size of a section_offsets table. */
>
> --- 831,840 ----
>
> #define ANOFFSET(secoff, whichone) \
> ((whichone == -1) ? \
> ! (internal_error ("Section index is uninitialized"), -1) : \
> ! ((whichone >= 40) ? \
> ! (internal_error ("Section index out of bounds"), -1) : \
> ! secoff->offsets[whichone]))
>
> /* The maximum possible size of a section_offsets table. */
>
> --
> Peter Schauer pes@regent.e-technik.tu-muenchen.de
next prev parent reply other threads:[~2000-10-02 19:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-10-02 10:04 Peter.Schauer
2000-10-02 19:01 ` Elena Zannoni [this message]
2000-10-03 5:06 ` Peter.Schauer
2000-10-03 18:44 ` Elena Zannoni
2000-10-04 4:00 ` CVS GDB and Register Numbers and Remote Protocol Steven Johnson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=14809.15857.439093.624776@kwikemart.cygnus.com \
--to=ezannoni@cygnus.com \
--cc=Peter.Schauer@regent.e-technik.tu-muenchen.de \
--cc=gdb@sourceware.cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).