From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23316 invoked by alias); 5 Feb 2014 22:38:32 -0000 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 Received: (qmail 23304 invoked by uid 89); 5 Feb 2014 22:38:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Feb 2014 22:38:30 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WBB6x-0003mK-GQ from Maciej_Rozycki@mentor.com ; Wed, 05 Feb 2014 14:38:27 -0800 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 5 Feb 2014 14:38:27 -0800 Received: from [172.30.64.209] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Wed, 5 Feb 2014 22:38:25 +0000 Date: Wed, 05 Feb 2014 22:38:00 -0000 From: "Maciej W. Rozycki" To: "Moore, Catherine" CC: Richard Sandiford , "binutils@sourceware.org" Subject: RE: [Patch] Gas support for MIPS Compact EH In-Reply-To: Message-ID: References: <87k3me9jia.fsf@talisman.default> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2014-02/txt/msg00036.txt.bz2 On Tue, 4 Feb 2014, Moore, Catherine wrote: > I finally got some time to work on fixing up (with some help from Bernd) > the binutils submission for compact EH. Hopefully, the review comments > have been addressed. > > The current patch has been expanded to include all of binutils. > > As a reminder, the spec is available here: > https://github.com/MentorEmbedded/cxx-abi/blob/master/MIPSCompactEH.pdf Just a couple of minor nits I found skimming over the change. These of course by no means invalidate your excellent work! > diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c > index 34f1bf0..90688f1 100644 > --- a/gas/config/tc-mips.c > +++ b/gas/config/tc-mips.c > @@ -18249,3 +18256,13 @@ tc_mips_regname_to_dw2regnum (char *regname) > > return regnum; > } > + > +#if defined (OBJ_ELF) > +bfd_reloc_code_real_type > +mips_cfi_reloc_for_encoding (int encoding) > +{ > + if ((encoding & 0x70) == DW_EH_PE_datarel) > + return BFD_RELOC_GPREL32; > + return BFD_RELOC_32_PCREL; > +} > +#endif No need to check for OBJ_ELF anymore, we don't support non-ELF targets these days (cf. commit f3ded42a5d397a8dd1548e68a647c690088d3fbd). > diff --git a/gas/config/tc-mips.h b/gas/config/tc-mips.h > index c7eaa04..a300062 100644 > --- a/gas/config/tc-mips.h > +++ b/gas/config/tc-mips.h > @@ -190,4 +192,18 @@ extern int tc_mips_regname_to_dw2regnum (char *regname); > #define DWARF2_DEFAULT_RETURN_COLUMN 31 > #define DWARF2_CIE_DATA_ALIGNMENT (-4) > > +#if defined (OBJ_ELF) > + > +#define tc_cfi_reloc_for_encoding mips_cfi_reloc_for_encoding > +extern bfd_reloc_code_real_type mips_cfi_reloc_for_encoding (int encoding); > + > +#define tc_cfi_special_encoding(e) \ > + ((e) == (DW_EH_PE_sdata4 | DW_EH_PE_datarel | DW_EH_PE_indirect) \ > + || (e) == (DW_EH_PE_sdata4 | DW_EH_PE_pcrel)) > + > +#define tc_compact_eh_opcode_stop 0x5c > +#define tc_compact_eh_opcode_pad 0x5f > + > +#endif /* OBJ_ELF */ > + > #endif /* TC_MIPS */ Likewise. > diff --git a/ld/emultempl/mipself.em b/ld/emultempl/mipself.em > index 02043b7..252af0f 100644 > --- a/ld/emultempl/mipself.em > +++ b/ld/emultempl/mipself.em > @@ -252,11 +253,13 @@ EOF > PARSE_AND_LIST_PROLOGUE=' > #define OPTION_INSN32 301 > #define OPTION_NO_INSN32 (OPTION_INSN32 + 1) > +#define OPTION_PCREL_EH_RELOC 303 > ' (OPTION_NO_INSN32 + 1) please instead -- this allows easy option insertion and removal without the need to renumber options or leaving holes behind. Maciej