This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] MIPS/BFD: MICROMIPS_P helper macro
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: Richard Sandiford <rdsandiford at googlemail dot com>
- Cc: Paul Brook <paul at codesourcery dot com>, <binutils at sourceware dot org>
- Date: Mon, 18 Feb 2013 14:26:54 +0000
- Subject: [PATCH] MIPS/BFD: MICROMIPS_P helper macro
Hi,
Here's a small change to improve code readability, courtesy of Paul. It
will be of more use as further changes are made. No regressions across
the usual 25 MIPS targets. OK to apply?
2013-02-18 Paul Brook <paul@codesourcery.com>
bfd/
* elfxx-mips.c (MICROMIPS_P): New macro.
(_bfd_mips_elf_symbol_processing): Use it.
Maciej
binutils-bfd-umips-p.diff
Index: binutils-fsf-trunk-quilt/bfd/elfxx-mips.c
===================================================================
--- binutils-fsf-trunk-quilt.orig/bfd/elfxx-mips.c 2013-02-17 07:06:45.705501283 +0000
+++ binutils-fsf-trunk-quilt/bfd/elfxx-mips.c 2013-02-17 07:06:49.955493299 +0000
@@ -721,6 +721,10 @@ static bfd *reldyn_sorting_bfd;
/* Nonzero if ABFD is using NewABI conventions. */
#define NEWABI_P(abfd) (ABI_N32_P (abfd) || ABI_64_P (abfd))
+/* Nonzero if ABFD has microMIPS code. */
+#define MICROMIPS_P(abfd) \
+ ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH_ASE_MICROMIPS) != 0)
+
/* The IRIX compatibility level we are striving for. */
#define IRIX_COMPAT(abfd) \
(get_elf_backend_data (abfd)->elf_backend_mips_irix_compat (abfd))
@@ -6407,7 +6411,7 @@ _bfd_mips_elf_symbol_processing (bfd *ab
&& (asym->value & 1) != 0)
{
asym->value--;
- if (elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH_ASE_MICROMIPS)
+ if (MICROMIPS_P (abfd))
elfsym->internal_elf_sym.st_other
= ELF_ST_SET_MICROMIPS (elfsym->internal_elf_sym.st_other);
else