Deleted Added
full compact
1/* MIPS-specific support for ELF
2 Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
3 2003 Free Software Foundation, Inc.
3 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
4
5 Most of the information added by Ian Lance Taylor, Cygnus Support,
6 <ian@cygnus.com>.
7 N32/64 ABI support added by Mark Mitchell, CodeSourcery, LLC.
8 <mark@codesourcery.com>
9 Traditional MIPS targets support added by Koundinya.K, Dansk Data
10 Elektronik & Operations Research Group. <kk@ddeorg.soft.net>
11

--- 6 unchanged lines hidden (view full) ---

18
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
26 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
27
28/* This file handles functionality common to the different MIPS ABI's. */
29
30#include "bfd.h"
31#include "sysdep.h"
32#include "libbfd.h"
33#include "libiberty.h"
34#include "elf-bfd.h"

--- 4048 unchanged lines hidden (view full) ---

4083 return bfd_mach_mips4650;
4084
4085 case E_MIPS_MACH_5400:
4086 return bfd_mach_mips5400;
4087
4088 case E_MIPS_MACH_5500:
4089 return bfd_mach_mips5500;
4090
4091 case E_MIPS_MACH_9000:
4092 return bfd_mach_mips9000;
4093
4094 case E_MIPS_MACH_OCTEON:
4095 return bfd_mach_mips_octeon;
4096
4097 case E_MIPS_MACH_SB1:
4098 return bfd_mach_mips_sb1;
4099
4100 default:
4101 switch (flags & EF_MIPS_ARCH)
4102 {
4103 default:
4104 case E_MIPS_ARCH_1:

--- 3038 unchanged lines hidden (view full) ---

7143 case bfd_mach_mips5400:
7144 val = E_MIPS_ARCH_4 | E_MIPS_MACH_5400;
7145 break;
7146
7147 case bfd_mach_mips5500:
7148 val = E_MIPS_ARCH_4 | E_MIPS_MACH_5500;
7149 break;
7150
7151 case bfd_mach_mips9000:
7152 val = E_MIPS_ARCH_4 | E_MIPS_MACH_9000;
7153 break;
7154
7155 case bfd_mach_mips5000:
7156 case bfd_mach_mips7000:
7157 case bfd_mach_mips8000:
7158 case bfd_mach_mips10000:
7159 case bfd_mach_mips12000:
7160 val = E_MIPS_ARCH_4;
7161 break;
7162
7163 case bfd_mach_mips5:
7164 val = E_MIPS_ARCH_5;
7165 break;
7166
7167 case bfd_mach_mips_octeon:
7168 val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_OCTEON;
7169 break;
7170
7171 case bfd_mach_mips_sb1:
7172 val = E_MIPS_ARCH_64 | E_MIPS_MACH_SB1;
7173 break;
7174
7175 case bfd_mach_mipsisa32:
7176 val = E_MIPS_ARCH_32;
7177 break;
7178

--- 1686 unchanged lines hidden (view full) ---

8865 unsigned long extension, base;
8866};
8867
8868
8869/* An array describing how BFD machines relate to one another. The entries
8870 are ordered topologically with MIPS I extensions listed last. */
8871
8872static const struct mips_mach_extension mips_mach_extensions[] = {
8873 /* MIPS64r2 extensions. */
8874 { bfd_mach_mips_octeon, bfd_mach_mipsisa64r2 },
8875
8876 /* MIPS64 extensions. */
8877 { bfd_mach_mipsisa64r2, bfd_mach_mipsisa64 },
8878 { bfd_mach_mips_sb1, bfd_mach_mipsisa64 },
8879
8880 /* MIPS V extensions. */
8881 { bfd_mach_mipsisa64, bfd_mach_mips5 },
8882
8883 /* R10000 extensions. */

--- 7 unchanged lines hidden (view full) ---

8891 { bfd_mach_mips5500, bfd_mach_mips5400 },
8892 { bfd_mach_mips5400, bfd_mach_mips5000 },
8893
8894 /* MIPS IV extensions. */
8895 { bfd_mach_mips5, bfd_mach_mips8000 },
8896 { bfd_mach_mips10000, bfd_mach_mips8000 },
8897 { bfd_mach_mips5000, bfd_mach_mips8000 },
8898 { bfd_mach_mips7000, bfd_mach_mips8000 },
8899 { bfd_mach_mips9000, bfd_mach_mips8000 },
8900
8901 /* VR4100 extensions. */
8902 { bfd_mach_mips4120, bfd_mach_mips4100 },
8903 { bfd_mach_mips4111, bfd_mach_mips4100 },
8904
8905 /* MIPS III extensions. */
8906 { bfd_mach_mips8000, bfd_mach_mips4000 },
8907 { bfd_mach_mips4650, bfd_mach_mips4000 },

--- 18 unchanged lines hidden (view full) ---

8926
8927/* Return true if bfd machine EXTENSION is an extension of machine BASE. */
8928
8929static bfd_boolean
8930mips_mach_extends_p (unsigned long base, unsigned long extension)
8931{
8932 size_t i;
8933
8916 for (i = 0; extension != base && i < ARRAY_SIZE (mips_mach_extensions); i++)
8934 if (extension == base)
8935 return TRUE;
8936
8937 if (base == bfd_mach_mipsisa32
8938 && mips_mach_extends_p (bfd_mach_mipsisa64, extension))
8939 return TRUE;
8940
8941 if (base == bfd_mach_mipsisa32r2
8942 && mips_mach_extends_p (bfd_mach_mipsisa64r2, extension))
8943 return TRUE;
8944
8945 for (i = 0; i < ARRAY_SIZE (mips_mach_extensions); i++)
8946 if (extension == mips_mach_extensions[i].extension)
8918 extension = mips_mach_extensions[i].base;
8947 {
8948 extension = mips_mach_extensions[i].base;
8949 if (extension == base)
8950 return TRUE;
8951 }
8952
8920 return extension == base;
8953 return FALSE;
8954}
8955
8956
8957/* Return true if the given ELF header flags describe a 32-bit binary. */
8958
8959static bfd_boolean
8960mips_32bit_flags_p (flagword flags)
8961{

--- 306 unchanged lines hidden ---