This is the mail archive of the gdb@sourceware.org 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: enable_break() in solib-svr4.c


>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:

 Daniel> On Wed, Aug 31, 2005 at 05:14:36PM -0400, Paul Koning wrote:
 >> No, it's the same issue, materializing in a second place.
 >> 
 >> The same conclusion applies as before: either NetBSD is wrong --
 >> it should use the bizarre and unintuitive meaning of "base
 >> address" that appears to be intended by the document you quoted --
 >> or NetBSD is right, "base address" means "the address where the
 >> thing ended up" (which is the intuitive definition) and GDB is
 >> wrong in several places.
 >> 
 >> The reason I'm picking on the meaning of "base address" is that
 >> "address" normally means a place, not a difference.  If people
 >> mean difference, the normal term used is "offset" or
 >> "displacement" or something like that.  So I find it hard to
 >> believe that "base address" is meant to be a difference between
 >> two addresses.

 Daniel> I didn't check the thread to see what the "quoted document"
 Daniel> was, but this is from the ELF gABI:

 Daniel> Because position-independent code uses relative addressing
 Daniel> between segments, the difference between virtual addresses in
 Daniel> memory must match the difference between virtual addresses in
 Daniel> the file. The difference between the virtual address of any
 Daniel> segment in memory and the corresponding virtual address in
 Daniel> the file is thus a single constant value for any one
 Daniel> executable or shared object in a given process. This
 Daniel> difference is the base address.

 Daniel> It really doesn't get any clearer than that.

Other than the fact that it uses the word "address" in a highly
unusual way, I agree, that's pretty clear.  Certainly much more so
than the text quoted in that earlier message.

Ok then, so the conclusion is that NetBSD (in 1.6.2 and before, at
least) violates this rule when it puts the load address, rather than
the difference between load and file addresses, into the "base
address".

Given that bug, I suppose it would make sense to put a target specific
workaround into gdb, i.e., "if the target is NetBSD (or "if the
target is NetBSD-MIPS"??) then 'base address' is not a difference but
just the load address".

That should not be hard.

     paul


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