This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: [Patch] Gas support for MIPS Compact EH
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: "Moore, Catherine" <Catherine_Moore at mentor dot com>
- Cc: Richard Sandiford <rdsandiford at googlemail dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Wed, 5 Feb 2014 22:38:16 +0000
- Subject: RE: [Patch] Gas support for MIPS Compact EH
- Authentication-results: sourceware.org; auth=none
- References: <FD3DCEAC5B03E9408544A1E416F11242F8FC5972 at NA-MBX-01 dot mgc dot mentorg dot com> <87k3me9jia dot fsf at talisman dot default> <FD3DCEAC5B03E9408544A1E416F11242012EAC2AE0 at NA-MBX-01 dot mgc dot mentorg dot com>
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