From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5544 invoked by alias); 31 Aug 2005 21:14:53 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 5496 invoked by uid 22791); 31 Aug 2005 21:14:40 -0000 Received: from sadr.equallogic.com (HELO sadr.equallogic.com) (66.155.203.134) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 31 Aug 2005 21:14:40 +0000 Received: from sadr.equallogic.com (localhost.localdomain [127.0.0.1]) by sadr.equallogic.com (8.12.8/8.12.8) with ESMTP id j7VLEcil016202 for ; Wed, 31 Aug 2005 17:14:38 -0400 Received: from M31.equallogic.com (M31.equallogic.com [172.16.1.31]) by sadr.equallogic.com (8.12.8/8.12.8) with SMTP id j7VLEcje016197; Wed, 31 Aug 2005 17:14:38 -0400 Received: from pkoning.equallogic.com ([172.16.1.163]) by M31.equallogic.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 31 Aug 2005 17:14:38 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17174.7612.800418.769197@gargle.gargle.HOWL> Date: Wed, 31 Aug 2005 21:14:00 -0000 From: Paul Koning To: kevinb@redhat.com Cc: gdb@sources.redhat.com Subject: Re: enable_break() in solib-svr4.c References: <17152.63787.724675.956910@gargle.gargle.HOWL> <20050831133045.7e6ea3ee@ironwood.lan> X-SW-Source: 2005-08/txt/msg00129.txt.bz2 >>>>> "Kevin" == Kevin Buettner writes: Kevin> On Mon, 15 Aug 2005 16:20:59 -0400 Paul Koning Kevin> wrote: >> The code in solib-svr4.c in several places seems to assume that >> the shared lib loader is linked to base address 0, loaded >> somewhere else, and relocated at runtime -- and ditto for other >> libraries. >> >> I've just been battling a bug in enable_break, where the load >> address of the shared lib loader is added to a symbol address from >> the solib_break_names[] list. That produces nonsense on >> NetBSD/MIPS, because ldd.elf_so is linked to 5ffe0000 so that >> address is added to the symbol address (5ffexxxx). >> >> As a hack solution I have it add the load address only if the >> symbol value is less than the load address. It seems to me the >> correct way to cure this is to compute the relocation delta -- the >> difference between the load address and the as-linked VMA of the >> start of the library (from the program headers). I did something >> like this in svr4_relocate_section_addresses. Kevin> I too would like to see your solution, hack or not. Kevin> Is this issue different than the ones already discussed as Kevin> part of the following thread? Kevin> http://sources.redhat.com/ml/gdb/2002-12/msg00266.html 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. It's not an issue that's commonly seen, because the vaddr in a shared library is nearly always zero. Nearly always, but not in MIPS/NetBSD, which is why I ran into this. I still have no further data from anyone more knowledgeable about NetBSD as to whether this should be viewed as a NetBSD dynamic loader bug. paul