This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Suggestion: Detect inconsistent structure definitions


----- Original Message -----
From: "Daniel Jacobowitz" <drow@mvista.com>
To: "Kris Warkentin" <kewarken@qnx.com>
Cc: <gdb@sources.redhat.com>; "Zack Weinberg" <zack@codesourcery.com>
Sent: Wednesday, March 13, 2002 7:02 PM
Subject: Re: Suggestion: Detect inconsistent structure definitions


> On Wed, Mar 13, 2002 at 01:41:16PM -0500, Kris Warkentin wrote:
> > Seems to me that the linker should be able to detect this problem as
> > well....It uses the debug information for error reporting.  The problem
here
>
> No, the linker uses symbol information.  It does -not- read debug info.

I'm not so sure about that.  I remember a problem with gnu ld crashing in
the dwarf1 interpretation section of the bfd when it couldn't resolve a
symbol. - if you link an app without debug info you will get different error
messages from ld than if it does have debug info.  You may be right in that
it doesn't read the debug info while it's linking - I think it only looks at
it if there's an error so that it can print nicer error messages (ie. source
file/line # vs. object)

>
> > is not so much the definitions of the structures but the reference to a
> > variable defined in another object which has a different definition.
>
> That's just a specific case of the problem Zack is describing, really.

I spent some time thinking about that and you're right - there's WAY too
many ways that a reference to a structure could pass across object
boundaries to check for them all.  The best we could do is to optionally
give warnings if structures of the same name and different format are
described in different objects.  One would think that, in practice, this
wouldn't come up that often and would most likely be a sign of a problem.

cheers,

Kris
>
> --
> Daniel Jacobowitz                           Carnegie Mellon University
> MontaVista Software                         Debian GNU/Linux Developer
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]