From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5568 invoked by alias); 29 Jul 2010 16:37:04 -0000 Received: (qmail 5547 invoked by uid 22791); 29 Jul 2010 16:37:01 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Jul 2010 16:36:57 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id F0B8A2BAC14; Thu, 29 Jul 2010 12:36:55 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id uK1ftHfR7C5A; Thu, 29 Jul 2010 12:36:55 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id AD9442BABAB; Thu, 29 Jul 2010 12:36:55 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 1926E5BE20; Thu, 29 Jul 2010 09:36:48 -0700 (PDT) Date: Thu, 29 Jul 2010 16:37:00 -0000 From: Joel Brobecker To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: [patch] Fix regression on prelinked executables Message-ID: <20100729163648.GA13267@adacore.com> References: <20100715095457.GA22922@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100715095457.GA22922@host0.dyn.jankratochvil.net> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-07/txt/msg00542.txt.bz2 > Curiously GDB already uses at > many places > baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); > instead of using offset for the appropriate section at that place and nobody > complains. It's something I actually noticed almost 10 years ago, now, while working on Tru64, I think. But I never really found a situation that required me to work on that, so... > gdb/ > 2010-07-15 Jan Kratochvil > > * symfile.c (addr_section_name): New function. > (addrs_section_compar): Use it. > (addr_info_make_relative): Use it. Move variable sect_name into a more > inner block. Make ".dynbss" and ".sdynbss" checks more strict. I think that this is OK. I'm not sure about putting it on the 7.2 branch, however. Given that this can directly affect Darwin, I'd rather give this patch an observation period and potentially put it in 7.2.1. > gdb/testsuite/ > 2010-07-15 Jan Kratochvil > > * gdb.base/prelink-lib.c (copyreloc): New initialized variable. > * gdb.base/prelink.c (copyreloc, bssvar, bssvarp): New variables. > (main): Use copyreloc. > * gdb.base/prelink.exp (split debug of executable) > (.dynbss vs. .bss address shift): New tests. This part is OK. > if (!(strcmp (sect_name, ".gnu.liblist") == 0 > || strcmp (sect_name, ".gnu.conflict") == 0 > - || strcmp (sect_name, ".dynbss") == 0 > - || strcmp (sect_name, ".sdynbss") == 0)) > + || (strcmp (sect_name, ".bss") == 0 > + && i > 0 > + && strcmp (addrs->other[i - 1].name, ".dynbss") == 0 > + && addrs_to_abfd_addrs[i - 1] != NULL) > + || (strcmp (sect_name, ".sbss") == 0 > + && i > 0 > + && strcmp (addrs->other[i - 1].name, ".sdynbss") == 0 > + && addrs_to_abfd_addrs[i - 1] != NULL))) I had to think over this for a while, and I think that the two new checks are correct. However, I'm still trying to figure out why it's correct to also remove the simple check for .dynbss. In other words, if .dynbss is missing from the separate debug object file, shouldn't we emit a warning? -- Joel