This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] Simplify mips16 conversion to even address
- From: Fred Fish <fnf at ninemoons dot com>
- To: binutils at sources dot redhat dot com
- Cc: fnf at redhat dot com
- Date: Thu, 4 Mar 2004 21:53:58 -0700
- Subject: [PATCH] Simplify mips16 conversion to even address
- Reply-to: fnf at redhat dot com
While looking at something else I noticed some code that first checks
and address to see if it is even or odd, before forcing it to even.
That seems sort of pointless, why bother testing it, unless perhaps
I'm missing something. Here's an admittedly untested patch.
2004-03-04 Fred Fish <fnf@redhat.com>
* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Just force
mips16 symbols to be even rather than testing first for even/odd.
Index: elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.90
diff -u -p -r1.90 elfxx-mips.c
--- elfxx-mips.c 17 Feb 2004 10:19:23 -0000 1.90
+++ elfxx-mips.c 5 Mar 2004 04:53:19 -0000
@@ -1,6 +1,6 @@
/* MIPS-specific support for ELF
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003 Free Software Foundation, Inc.
+ 2003, 2004 Free Software Foundation, Inc.
Most of the information added by Ian Lance Taylor, Cygnus Support,
<ian@cygnus.com>.
@@ -6814,9 +6814,8 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd
}
/* If this is a mips16 symbol, force the value to be even. */
- if (sym->st_other == STO_MIPS16
- && (sym->st_value & 1) != 0)
- --sym->st_value;
+ if (sym->st_other == STO_MIPS16)
+ sym->st_value &= ~1;
return TRUE;
}