/[gcl]/gcl/binutils/bfd/mipsbsd.c
ViewVC logotype

Diff of /gcl/binutils/bfd/mipsbsd.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by camm, Fri Aug 9 05:35:37 2002 UTC revision 1.2 by camm, Fri Sep 9 23:32:14 2005 UTC
# Line 1  Line 1 
1  /* BFD backend for MIPS BSD (a.out) binaries.  /* BFD backend for MIPS BSD (a.out) binaries.
2     Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001     Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003
3     Free Software Foundation, Inc.     Free Software Foundation, Inc.
4     Written by Ralph Campbell.     Written by Ralph Campbell.
5    
# Line 19  You should have received a copy of the G Line 19  You should have received a copy of the G
19  along with this program; if not, write to the Free Software  along with this program; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
21    
 #define BYTES_IN_WORD 4  
22  /* #define ENTRY_CAN_BE_ZERO */  /* #define ENTRY_CAN_BE_ZERO */
23  #define N_HEADER_IN_TEXT(x) 1  #define N_HEADER_IN_TEXT(x) 1
24  #define N_SHARED_LIB(x) 0  #define N_SHARED_LIB(x) 0
# Line 53  static void MY(set_arch_mach) PARAMS ((b Line 52  static void MY(set_arch_mach) PARAMS ((b
52  static void MY(choose_reloc_size) PARAMS ((bfd *abfd));  static void MY(choose_reloc_size) PARAMS ((bfd *abfd));
53    
54  #define MY_write_object_contents MY(write_object_contents)  #define MY_write_object_contents MY(write_object_contents)
55  static boolean MY(write_object_contents) PARAMS ((bfd *abfd));  static bfd_boolean MY(write_object_contents) PARAMS ((bfd *abfd));
56    
57  /* We can't use MY(x) here because it leads to a recursive call to CONCAT2  /* We can't use MY(x) here because it leads to a recursive call to CONCAT2
58     when expanded inside JUMP_TABLE.  */     when expanded inside JUMP_TABLE.  */
# Line 71  static boolean MY(write_object_contents) Line 70  static boolean MY(write_object_contents)
70  #include "aout-target.h"  #include "aout-target.h"
71    
72  static bfd_reloc_status_type mips_fix_jmp_addr  static bfd_reloc_status_type mips_fix_jmp_addr
73    PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *,    PARAMS ((bfd *, arelent *, struct bfd_symbol *, PTR, asection *,
74             bfd *, char **));             bfd *, char **));
75  static reloc_howto_type *MY(reloc_howto_type_lookup)  static reloc_howto_type *MY(reloc_howto_type_lookup)
76    PARAMS ((bfd *, bfd_reloc_code_real_type));    PARAMS ((bfd *, bfd_reloc_code_real_type));
# Line 91  MY(set_arch_mach) (abfd, machtype) Line 90  MY(set_arch_mach) (abfd, machtype)
90      {      {
91      case M_MIPS1:      case M_MIPS1:
92        arch = bfd_arch_mips;        arch = bfd_arch_mips;
93        machine = 3000;        machine = bfd_mach_mips3000;
94        break;        break;
95    
96      case M_MIPS2:      case M_MIPS2:
97        arch = bfd_arch_mips;        arch = bfd_arch_mips;
98        machine = 4000;        machine = bfd_mach_mips4000;
99        break;        break;
100    
101      default:      default:
# Line 130  MY (choose_reloc_size) (abfd) Line 129  MY (choose_reloc_size) (abfd)
129    Section contents have already been written.  We write the    Section contents have already been written.  We write the
130    file header, symbols, and relocation.  */    file header, symbols, and relocation.  */
131    
132  static boolean  static bfd_boolean
133  MY (write_object_contents) (abfd)  MY (write_object_contents) (abfd)
134       bfd *abfd;       bfd *abfd;
135  {  {
# Line 164  MY (write_object_contents) (abfd) Line 163  MY (write_object_contents) (abfd)
163      case bfd_arch_mips:      case bfd_arch_mips:
164        switch (bfd_get_mach (abfd))        switch (bfd_get_mach (abfd))
165          {          {
166          case 4000:          case bfd_mach_mips4000:
167          case 6000:          case bfd_mach_mips6000:
168            N_SET_MACHTYPE (*execp, M_MIPS2);            N_SET_MACHTYPE (*execp, M_MIPS2);
169            break;            break;
170          default:          default:
# Line 181  MY (write_object_contents) (abfd) Line 180  MY (write_object_contents) (abfd)
180    
181    WRITE_HEADERS (abfd, execp);    WRITE_HEADERS (abfd, execp);
182    
183    return true;    return TRUE;
184  }  }
185    
186  /* MIPS relocation types.  */  /* MIPS relocation types.  */
# Line 204  mips_fix_jmp_addr (abfd, reloc_entry, sy Line 203  mips_fix_jmp_addr (abfd, reloc_entry, sy
203                     error_message)                     error_message)
204       bfd *abfd ATTRIBUTE_UNUSED;       bfd *abfd ATTRIBUTE_UNUSED;
205       arelent *reloc_entry;       arelent *reloc_entry;
206       struct symbol_cache_entry *symbol;       struct bfd_symbol *symbol;
207       PTR data ATTRIBUTE_UNUSED;       PTR data ATTRIBUTE_UNUSED;
208       asection *input_section;       asection *input_section;
209       bfd *output_bfd;       bfd *output_bfd;
# Line 221  mips_fix_jmp_addr (abfd, reloc_entry, sy Line 220  mips_fix_jmp_addr (abfd, reloc_entry, sy
220        && (symbol->flags & BSF_WEAK) == 0)        && (symbol->flags & BSF_WEAK) == 0)
221      return bfd_reloc_undefined;      return bfd_reloc_undefined;
222    
223    /* Work out which section the relocation is targetted at and the    /* Work out which section the relocation is targeted at and the
224       initial relocation command value.  */       initial relocation command value.  */
225    if (bfd_is_com_section (symbol->section))    if (bfd_is_com_section (symbol->section))
226      relocation = 0;      relocation = 0;
# Line 272  mips_fix_hi16_s (abfd, reloc_entry, symb Line 271  mips_fix_hi16_s (abfd, reloc_entry, symb
271        && (symbol->flags & BSF_WEAK) == 0)        && (symbol->flags & BSF_WEAK) == 0)
272      return bfd_reloc_undefined;      return bfd_reloc_undefined;
273    
274    /* Work out which section the relocation is targetted at and the    /* Work out which section the relocation is targeted at and the
275       initial relocation command value.  */       initial relocation command value.  */
276    if (bfd_is_com_section (symbol->section))    if (bfd_is_com_section (symbol->section))
277      relocation = 0;      relocation = 0;
# Line 290  mips_fix_hi16_s (abfd, reloc_entry, symb Line 289  mips_fix_hi16_s (abfd, reloc_entry, symb
289  }  }
290    
291  static reloc_howto_type mips_howto_table_ext[] = {  static reloc_howto_type mips_howto_table_ext[] = {
292    {MIPS_RELOC_32,      0, 2, 32, false, 0,  complain_overflow_bitfield, 0,    {MIPS_RELOC_32,      0, 2, 32, FALSE, 0,  complain_overflow_bitfield, 0,
293          "32",       false, 0, 0xffffffff, false},          "32",       FALSE, 0, 0xffffffff, FALSE},
294    {MIPS_RELOC_JMP,     2, 2, 26, false, 0, complain_overflow_dont,    {MIPS_RELOC_JMP,     2, 2, 26, FALSE, 0, complain_overflow_dont,
295          mips_fix_jmp_addr,          mips_fix_jmp_addr,
296          "MIPS_JMP", false, 0, 0x03ffffff, false},          "MIPS_JMP", FALSE, 0, 0x03ffffff, FALSE},
297    {MIPS_RELOC_WDISP16, 2, 2, 16, true,  0, complain_overflow_signed, 0,    {MIPS_RELOC_WDISP16, 2, 2, 16, TRUE,  0, complain_overflow_signed, 0,
298          "WDISP16",  false, 0, 0x0000ffff, false},          "WDISP16",  FALSE, 0, 0x0000ffff, FALSE},
299    {MIPS_RELOC_HI16,   16, 2, 16, false, 0, complain_overflow_bitfield, 0,    {MIPS_RELOC_HI16,   16, 2, 16, FALSE, 0, complain_overflow_bitfield, 0,
300          "HI16",     false, 0, 0x0000ffff, false},          "HI16",     FALSE, 0, 0x0000ffff, FALSE},
301    {MIPS_RELOC_HI16_S, 16, 2, 16, false, 0, complain_overflow_bitfield,    {MIPS_RELOC_HI16_S, 16, 2, 16, FALSE, 0, complain_overflow_bitfield,
302          mips_fix_hi16_s,          mips_fix_hi16_s,
303          "HI16_S",   false, 0, 0x0000ffff, false},          "HI16_S",   FALSE, 0, 0x0000ffff, FALSE},
304    {MIPS_RELOC_LO16,    0, 2, 16, false, 0, complain_overflow_dont, 0,    {MIPS_RELOC_LO16,    0, 2, 16, FALSE, 0, complain_overflow_dont, 0,
305          "LO16",     false, 0, 0x0000ffff, false},          "LO16",     FALSE, 0, 0x0000ffff, FALSE},
306  };  };
307    
308  static reloc_howto_type *  static reloc_howto_type *

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26