From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20567 invoked by alias); 13 Jan 2012 08:17:33 -0000 Received: (qmail 20556 invoked by uid 22791); 13 Jan 2012 08:17:31 -0000 X-SWARE-Spam-Status: No, hits=0.3 required=5.0 tests=AWL,BAYES_50,KAM_STOCKGEN X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 Jan 2012 08:17:12 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 1A5C5CB2D1F; Fri, 13 Jan 2012 09:17:12 +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 icbXCiThTA7p; Fri, 13 Jan 2012 09:17:12 +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 07A81CB2D1B; Fri, 13 Jan 2012 09:17:11 +0100 (CET) Subject: Re: [Patch mach-o/bfd/gas] handle ABS indirect_symbols. Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Tristan Gingold In-Reply-To: <79D2A42E-1056-4ED2-B0C2-7E097C3844AE@sandoe-acoustics.co.uk> Date: Fri, 13 Jan 2012 08:17:00 -0000 Cc: binutils Development Content-Transfer-Encoding: quoted-printable Message-Id: <370D64BD-03BF-4AC7-8BE4-37EC42266768@adacore.com> References: <79D2A42E-1056-4ED2-B0C2-7E097C3844AE@sandoe-acoustics.co.uk> To: Iain Sandoe X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00171.txt.bz2 On Jan 12, 2012, at 7:28 PM, Iain Sandoe wrote: > a minor update to handle ABS symbols in the indirect symbol table. > tests attached >=20 > OK? Ok. Thanks, Tristan. > Iain >=20 > bfd: >=20 > * mach-o.c (bfd_mach_o_build_dysymtab_command): Handle ABS symbols. >=20 > gas: >=20 > * config/obj-macho.c (obj_mach_o_set_indirect_symbols): Handle ABS symbo= ls. >=20 > bfd/mach-o.c | 3 +++ > gas/config/obj-macho.c | 10 +++++++--- > 2 files changed, 10 insertions(+), 3 deletions(-) >=20 > diff --git a/bfd/mach-o.c b/bfd/mach-o.c > index c519663..0846fe6 100644 > --- a/bfd/mach-o.c > +++ b/bfd/mach-o.c > @@ -2199,6 +2199,9 @@ bfd_mach_o_build_dysymtab_command (bfd *abfd, > { > if (isyms[j] =3D=3D NULL) > dsym->indirect_syms[n] =3D BFD_MACH_O_INDIRECT_SYM_LOCAL; > + else if (isyms[j]->symbol.section =3D=3D bfd_abs_section_ptr) > + dsym->indirect_syms[n] =3D BFD_MACH_O_INDIRECT_SYM_LOCAL > + | BFD_MACH_O_INDIRECT_SYM_ABS; > else > dsym->indirect_syms[n] =3D isyms[j]->symbol.udata.i; > } > diff --git a/gas/config/obj-macho.c b/gas/config/obj-macho.c > index 61e6771..c381dbe 100644 > --- a/gas/config/obj-macho.c > +++ b/gas/config/obj-macho.c > @@ -1545,14 +1545,18 @@ obj_mach_o_set_indirect_symbols (bfd *abfd, asect= ion *sec, >=20=09 > for (isym =3D list, n =3D 0; isym !=3D NULL; isym =3D isym->next, = n++) > { > + sym =3D (bfd_mach_o_asymbol *)symbol_get_bfdsym (isym->sym); > /* Array is init to NULL & NULL signals a local symbol > If the section is lazy-bound, we need to keep the > - reference to the symbol, since dyld can override. */ > - if (S_IS_LOCAL (isym->sym) && ! lazy) > + reference to the symbol, since dyld can override. > +=09=09 > + Absolute symbols are handled specially. */ > + if (sym->symbol.section =3D=3D bfd_abs_section_ptr) > + ms->indirect_syms[n] =3D sym; > + else if (S_IS_LOCAL (isym->sym) && ! lazy) > ; > else > { > - sym =3D (bfd_mach_o_asymbol *)symbol_get_bfdsym (isym->sym); > if (sym =3D=3D NULL) > ; > /* If the symbols is external ... */ >=20 >=20 > <12011218-dysym-abs-test.txt> >=20 >=20