From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16140 invoked by alias); 17 Feb 2010 08:51:45 -0000 Received: (qmail 16130 invoked by uid 22791); 17 Feb 2010 08:51:44 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Feb 2010 08:51:40 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 4AC10CB029D; Wed, 17 Feb 2010 09:51:38 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tJWmlZnzR2UB; Wed, 17 Feb 2010 09:51:38 +0100 (CET) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 37956CB021B; Wed, 17 Feb 2010 09:51:38 +0100 (CET) Subject: Re: [patch] build_section_addr_info* SEC_ALLOC/SEC_LOAD unification Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Tristan Gingold In-Reply-To: <20100213223425.GA27252@host0.dyn.jankratochvil.net> Date: Wed, 17 Feb 2010 08:51:00 -0000 Cc: gdb-patches@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: <95C3C0FF-7DC2-4AFB-9398-D675ED67821E@adacore.com> References: <20100213223425.GA27252@host0.dyn.jankratochvil.net> To: Jan Kratochvil X-IsSubscribed: yes 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-02/txt/msg00411.txt.bz2 On Feb 13, 2010, at 11:34 PM, Jan Kratochvil wrote: > Hi Tristan, >=20 > http://sourceware.org/ml/gdb-patches/2010-01/msg00111.html > http://sourceware.org/ml/gdb-cvs/2010-01/msg00051.html > 3bfec189bb0fa1a2a44f1645dd68a9572e7a841c > 2010-01-07 Tristan Gingold >=20 > * symfile.c (build_section_addr_info_from_objfile): New function. > (symbol_file_add_separate): Don't use offsets from objfile but > built an addr info. >=20 > this new function creates the address information for _all_ the sections = while > former build_section_addr_info_from_section_table creates it only if sect= ion > is SEC_ALLOC or SEC_LOAD. >=20 > While I have no countercase I do not see a reason for such difference, do= you? No. I think I simply removed this line inadvertently. Thanks for catching this, Tristan. > My previous unchecked-in patch had implemented this function on top of > build_section_addr_info_from_section_table and thus conforming to this > SEC_ALLOC or SEC_LOAD conditional: > [patch 06/15] PIE: Fix displacement of separate debug info files > http://sourceware.org/ml/gdb-patches/2009-11/msg00173.html >=20 >=20 > No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu. >=20 >=20 > Thanks, > Jan >=20 >=20 > 2010-02-13 Jan Kratochvil >=20 > * symfile.c (build_section_addr_info_from_objfile): Include sections > only if they are SEC_ALLOC or SEC_LOAD. >=20 > --- a/gdb/symfile.c > +++ b/gdb/symfile.c > @@ -371,16 +371,16 @@ build_section_addr_info_from_objfile (const struct = objfile *objfile) > mask =3D ((CORE_ADDR) 1 << addr_bit) - 1; >=20 > sap =3D alloc_section_addr_info (objfile->num_sections); > - for (i =3D 0, sec =3D objfile->obfd->sections; > - i < objfile->num_sections; > - i++, sec =3D sec->next) > - { > - gdb_assert (sec !=3D NULL); > - sap->other[i].addr =3D (bfd_get_section_vma (objfile->obfd, sec) > - + objfile->section_offsets->offsets[i]) & ma= sk; > - sap->other[i].name =3D xstrdup (bfd_get_section_name (objfile->obf= d, sec)); > - sap->other[i].sectindex =3D sec->index; > - } > + for (i =3D 0, sec =3D objfile->obfd->sections; sec !=3D NULL; sec =3D = sec->next) > + if (bfd_get_section_flags (objfile->obfd, sec) & (SEC_ALLOC | SEC_LO= AD)) > + { > + sap->other[i].addr =3D (bfd_get_section_vma (objfile->obfd, sec) > + + objfile->section_offsets->offsets[i]) & mask; > + sap->other[i].name =3D xstrdup (bfd_get_section_name (objfile->obfd, > + sec)); > + sap->other[i].sectindex =3D sec->index; > + i++; > + } > return sap; > } >=20 >=20