| OLD | NEW |
| 1 /* BFD backend for MIPS BSD (a.out) binaries. | 1 /* BFD backend for MIPS BSD (a.out) binaries. |
| 2 Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, | 2 Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, |
| 3 2005, 2007, 2009, 2011 Free Software Foundation, Inc. | 3 2005, 2007, 2009, 2011, 2012 Free Software Foundation, Inc. |
| 4 Written by Ralph Campbell. | 4 Written by Ralph Campbell. |
| 5 | 5 |
| 6 This file is part of BFD, the Binary File Descriptor library. | 6 This file is part of BFD, the Binary File Descriptor library. |
| 7 | 7 |
| 8 This program is free software; you can redistribute it and/or modify | 8 This program is free software; you can redistribute it and/or modify |
| 9 it under the terms of the GNU General Public License as published by | 9 it under the terms of the GNU General Public License as published by |
| 10 the Free Software Foundation; either version 3 of the License, or | 10 the Free Software Foundation; either version 3 of the License, or |
| 11 (at your option) any later version. | 11 (at your option) any later version. |
| 12 | 12 |
| 13 This program is distributed in the hope that it will be useful, | 13 This program is distributed in the hope that it will be useful, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 42 #define MY(OP) CONCAT2 (mipsbsd_,OP) | 42 #define MY(OP) CONCAT2 (mipsbsd_,OP) |
| 43 | 43 |
| 44 #include "sysdep.h" | 44 #include "sysdep.h" |
| 45 #include "bfd.h" | 45 #include "bfd.h" |
| 46 #include "libbfd.h" | 46 #include "libbfd.h" |
| 47 #include "libaout.h" | 47 #include "libaout.h" |
| 48 | 48 |
| 49 #define SET_ARCH_MACH(ABFD, EXEC) \ | 49 #define SET_ARCH_MACH(ABFD, EXEC) \ |
| 50 MY(set_arch_mach) (ABFD, N_MACHTYPE (EXEC)); \ | 50 MY(set_arch_mach) (ABFD, N_MACHTYPE (EXEC)); \ |
| 51 MY(choose_reloc_size) (ABFD); | 51 MY(choose_reloc_size) (ABFD); |
| 52 static void MY(set_arch_mach) PARAMS ((bfd *abfd, unsigned long machtype)); | 52 static void MY(set_arch_mach) (bfd *, unsigned long); |
| 53 static void MY(choose_reloc_size) PARAMS ((bfd *abfd)); | 53 static void MY(choose_reloc_size) (bfd *); |
| 54 | 54 |
| 55 #define MY_write_object_contents MY(write_object_contents) | 55 #define MY_write_object_contents MY(write_object_contents) |
| 56 static bfd_boolean MY(write_object_contents) PARAMS ((bfd *abfd)); | 56 static bfd_boolean MY(write_object_contents) (bfd *); |
| 57 | 57 |
| 58 /* We can't use MY(x) here because it leads to a recursive call to CONCAT2 | 58 /* We can't use MY(x) here because it leads to a recursive call to CONCAT2 |
| 59 when expanded inside JUMP_TABLE. */ | 59 when expanded inside JUMP_TABLE. */ |
| 60 #define MY_bfd_reloc_type_lookup mipsbsd_reloc_type_lookup | 60 #define MY_bfd_reloc_type_lookup mipsbsd_reloc_type_lookup |
| 61 #define MY_bfd_reloc_name_lookup mipsbsd_reloc_name_lookup | 61 #define MY_bfd_reloc_name_lookup mipsbsd_reloc_name_lookup |
| 62 #define MY_canonicalize_reloc mipsbsd_canonicalize_reloc | 62 #define MY_canonicalize_reloc mipsbsd_canonicalize_reloc |
| 63 | 63 |
| 64 #define MY_bfd_link_hash_table_create _bfd_generic_link_hash_table_create | 64 #define MY_bfd_link_hash_table_create _bfd_generic_link_hash_table_create |
| 65 #define MY_bfd_link_add_symbols _bfd_generic_link_add_symbols | 65 #define MY_bfd_link_add_symbols _bfd_generic_link_add_symbols |
| 66 #define MY_final_link_callback unused | 66 #define MY_final_link_callback unused |
| 67 #define MY_bfd_final_link _bfd_generic_final_link | 67 #define MY_bfd_final_link _bfd_generic_final_link |
| 68 | 68 |
| 69 #define MY_backend_data &MY(backend_data) | 69 #define MY_backend_data &MY(backend_data) |
| 70 #define MY_BFD_TARGET | 70 #define MY_BFD_TARGET |
| 71 | 71 |
| 72 #include "aout-target.h" | 72 #include "aout-target.h" |
| 73 | 73 |
| 74 static bfd_reloc_status_type mips_fix_jmp_addr | 74 static bfd_reloc_status_type mips_fix_jmp_addr |
| 75 PARAMS ((bfd *, arelent *, struct bfd_symbol *, PTR, asection *, | 75 (bfd *, arelent *, struct bfd_symbol *, void *, asection *, |
| 76 » bfd *, char **)); | 76 bfd *, char **); |
| 77 | 77 |
| 78 long MY(canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); | 78 long MY(canonicalize_reloc) (bfd *, sec_ptr, arelent **, asymbol **); |
| 79 | 79 |
| 80 static void | 80 static void |
| 81 MY(set_arch_mach) (abfd, machtype) | 81 MY(set_arch_mach) (bfd *abfd, unsigned long machtype) |
| 82 bfd *abfd; | |
| 83 unsigned long machtype; | |
| 84 { | 82 { |
| 85 enum bfd_architecture arch; | 83 enum bfd_architecture arch; |
| 86 unsigned int machine; | 84 unsigned int machine; |
| 87 | 85 |
| 88 /* Determine the architecture and machine type of the object file. */ | 86 /* Determine the architecture and machine type of the object file. */ |
| 89 switch (machtype) | 87 switch (machtype) |
| 90 { | 88 { |
| 91 case M_MIPS1: | 89 case M_MIPS1: |
| 92 arch = bfd_arch_mips; | 90 arch = bfd_arch_mips; |
| 93 machine = bfd_mach_mips3000; | 91 machine = bfd_mach_mips3000; |
| 94 break; | 92 break; |
| 95 | 93 |
| 96 case M_MIPS2: | 94 case M_MIPS2: |
| 97 arch = bfd_arch_mips; | 95 arch = bfd_arch_mips; |
| 98 machine = bfd_mach_mips4000; | 96 machine = bfd_mach_mips4000; |
| 99 break; | 97 break; |
| 100 | 98 |
| 101 default: | 99 default: |
| 102 arch = bfd_arch_obscure; | 100 arch = bfd_arch_obscure; |
| 103 machine = 0; | 101 machine = 0; |
| 104 break; | 102 break; |
| 105 } | 103 } |
| 106 | 104 |
| 107 bfd_set_arch_mach (abfd, arch, machine); | 105 bfd_set_arch_mach (abfd, arch, machine); |
| 108 } | 106 } |
| 109 | 107 |
| 110 /* Determine the size of a relocation entry, based on the architecture */ | 108 /* Determine the size of a relocation entry, based on the architecture */ |
| 111 static void | 109 static void |
| 112 MY (choose_reloc_size) (abfd) | 110 MY (choose_reloc_size) (bfd *abfd) |
| 113 bfd *abfd; | |
| 114 { | 111 { |
| 115 switch (bfd_get_arch (abfd)) | 112 switch (bfd_get_arch (abfd)) |
| 116 { | 113 { |
| 117 case bfd_arch_sparc: | 114 case bfd_arch_sparc: |
| 118 case bfd_arch_mips: | 115 case bfd_arch_mips: |
| 119 obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE; | 116 obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE; |
| 120 break; | 117 break; |
| 121 default: | 118 default: |
| 122 obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; | 119 obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; |
| 123 break; | 120 break; |
| 124 } | 121 } |
| 125 } | 122 } |
| 126 | 123 |
| 127 /* Write an object file in BSD a.out format. | 124 /* Write an object file in BSD a.out format. |
| 128 Section contents have already been written. We write the | 125 Section contents have already been written. We write the |
| 129 file header, symbols, and relocation. */ | 126 file header, symbols, and relocation. */ |
| 130 | 127 |
| 131 static bfd_boolean | 128 static bfd_boolean |
| 132 MY (write_object_contents) (abfd) | 129 MY (write_object_contents) (bfd *abfd) |
| 133 bfd *abfd; | |
| 134 { | 130 { |
| 135 struct external_exec exec_bytes; | 131 struct external_exec exec_bytes; |
| 136 struct internal_exec *execp = exec_hdr (abfd); | 132 struct internal_exec *execp = exec_hdr (abfd); |
| 137 | 133 |
| 138 /* Magic number, maestro, please! */ | 134 /* Magic number, maestro, please! */ |
| 139 switch (bfd_get_arch (abfd)) | 135 switch (bfd_get_arch (abfd)) |
| 140 { | 136 { |
| 141 case bfd_arch_m68k: | 137 case bfd_arch_m68k: |
| 142 switch (bfd_get_mach (abfd)) | 138 switch (bfd_get_mach (abfd)) |
| 143 { | 139 { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 #define MIPS_RELOC_LO16 5 | 184 #define MIPS_RELOC_LO16 5 |
| 189 | 185 |
| 190 /* This is only called when performing a BFD_RELOC_MIPS_JMP relocation. | 186 /* This is only called when performing a BFD_RELOC_MIPS_JMP relocation. |
| 191 The jump destination address is formed from the upper 4 bits of the | 187 The jump destination address is formed from the upper 4 bits of the |
| 192 "current" program counter concatenated with the jump instruction's | 188 "current" program counter concatenated with the jump instruction's |
| 193 26 bit field and two trailing zeros. | 189 26 bit field and two trailing zeros. |
| 194 If the destination address is not in the same segment as the "current" | 190 If the destination address is not in the same segment as the "current" |
| 195 program counter, then we need to signal an error. */ | 191 program counter, then we need to signal an error. */ |
| 196 | 192 |
| 197 static bfd_reloc_status_type | 193 static bfd_reloc_status_type |
| 198 mips_fix_jmp_addr (abfd, reloc_entry, symbol, data, input_section, output_bfd, | 194 mips_fix_jmp_addr (bfd *abfd ATTRIBUTE_UNUSED, |
| 199 » » error_message) | 195 » » arelent *reloc_entry, |
| 200 bfd *abfd ATTRIBUTE_UNUSED; | 196 » » struct bfd_symbol *symbol, |
| 201 arelent *reloc_entry; | 197 » » void * data ATTRIBUTE_UNUSED, |
| 202 struct bfd_symbol *symbol; | 198 » » asection *input_section, |
| 203 PTR data ATTRIBUTE_UNUSED; | 199 » » bfd *output_bfd, |
| 204 asection *input_section; | 200 » » char **error_message ATTRIBUTE_UNUSED) |
| 205 bfd *output_bfd; | |
| 206 char **error_message ATTRIBUTE_UNUSED; | |
| 207 { | 201 { |
| 208 bfd_vma relocation, pc; | 202 bfd_vma relocation, pc; |
| 209 | 203 |
| 210 /* If this is a partial relocation, just continue. */ | 204 /* If this is a partial relocation, just continue. */ |
| 211 if (output_bfd != (bfd *)NULL) | 205 if (output_bfd != (bfd *) NULL) |
| 212 return bfd_reloc_continue; | 206 return bfd_reloc_continue; |
| 213 | 207 |
| 214 /* If this is an undefined symbol, return error */ | 208 /* If this is an undefined symbol, return error */ |
| 215 if (bfd_is_und_section (symbol->section) | 209 if (bfd_is_und_section (symbol->section) |
| 216 && (symbol->flags & BSF_WEAK) == 0) | 210 && (symbol->flags & BSF_WEAK) == 0) |
| 217 return bfd_reloc_undefined; | 211 return bfd_reloc_undefined; |
| 218 | 212 |
| 219 /* Work out which section the relocation is targeted at and the | 213 /* Work out which section the relocation is targeted at and the |
| 220 initial relocation command value. */ | 214 initial relocation command value. */ |
| 221 if (bfd_is_com_section (symbol->section)) | 215 if (bfd_is_com_section (symbol->section)) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 235 | 229 |
| 236 return bfd_reloc_continue; | 230 return bfd_reloc_continue; |
| 237 } | 231 } |
| 238 | 232 |
| 239 /* This is only called when performing a BFD_RELOC_HI16_S relocation. | 233 /* This is only called when performing a BFD_RELOC_HI16_S relocation. |
| 240 We need to see if bit 15 is set in the result. If it is, we add | 234 We need to see if bit 15 is set in the result. If it is, we add |
| 241 0x10000 and continue normally. This will compensate for the sign extension | 235 0x10000 and continue normally. This will compensate for the sign extension |
| 242 when the low bits are added at run time. */ | 236 when the low bits are added at run time. */ |
| 243 | 237 |
| 244 static bfd_reloc_status_type | 238 static bfd_reloc_status_type |
| 245 mips_fix_hi16_s PARAMS ((bfd *, arelent *, asymbol *, PTR, | 239 mips_fix_hi16_s (bfd *abfd ATTRIBUTE_UNUSED, |
| 246 » » » asection *, bfd *, char **)); | 240 » » arelent *reloc_entry, |
| 247 | 241 » » asymbol *symbol, |
| 248 static bfd_reloc_status_type | 242 » » void * data ATTRIBUTE_UNUSED, |
| 249 mips_fix_hi16_s (abfd, reloc_entry, symbol, data, input_section, | 243 » » asection *input_section ATTRIBUTE_UNUSED, |
| 250 » » output_bfd, error_message) | 244 » » bfd *output_bfd, |
| 251 bfd *abfd ATTRIBUTE_UNUSED; | 245 » » char **error_message ATTRIBUTE_UNUSED) |
| 252 arelent *reloc_entry; | |
| 253 asymbol *symbol; | |
| 254 PTR data ATTRIBUTE_UNUSED; | |
| 255 asection *input_section ATTRIBUTE_UNUSED; | |
| 256 bfd *output_bfd; | |
| 257 char **error_message ATTRIBUTE_UNUSED; | |
| 258 { | 246 { |
| 259 bfd_vma relocation; | 247 bfd_vma relocation; |
| 260 | 248 |
| 261 /* If this is a partial relocation, just continue. */ | 249 /* If this is a partial relocation, just continue. */ |
| 262 if (output_bfd != (bfd *)NULL) | 250 if (output_bfd != (bfd *)NULL) |
| 263 return bfd_reloc_continue; | 251 return bfd_reloc_continue; |
| 264 | 252 |
| 265 /* If this is an undefined symbol, return error. */ | 253 /* If this is an undefined symbol, return error. */ |
| 266 if (bfd_is_und_section (symbol->section) | 254 if (bfd_is_und_section (symbol->section) |
| 267 && (symbol->flags & BSF_WEAK) == 0) | 255 && (symbol->flags & BSF_WEAK) == 0) |
| 268 return bfd_reloc_undefined; | 256 return bfd_reloc_undefined; |
| 269 | 257 |
| 270 /* Work out which section the relocation is targeted at and the | 258 /* Work out which section the relocation is targeted at and the |
| 271 initial relocation command value. */ | 259 initial relocation command value. */ |
| 272 if (bfd_is_com_section (symbol->section)) | 260 if (bfd_is_com_section (symbol->section)) |
| 273 relocation = 0; | 261 relocation = 0; |
| 274 else | 262 else |
| 275 relocation = symbol->value; | 263 relocation = symbol->value; |
| 276 | 264 |
| 277 relocation += symbol->section->output_section->vma; | 265 relocation += symbol->section->output_section->vma; |
| 278 relocation += symbol->section->output_offset; | 266 relocation += symbol->section->output_offset; |
| 279 relocation += reloc_entry->addend; | 267 relocation += reloc_entry->addend; |
| 280 | 268 |
| 281 if (relocation & 0x8000) | 269 if (relocation & 0x8000) |
| 282 reloc_entry->addend += 0x10000; | 270 reloc_entry->addend += 0x10000; |
| 283 | 271 |
| 284 return bfd_reloc_continue; | 272 return bfd_reloc_continue; |
| 285 } | 273 } |
| 286 | 274 |
| 287 static reloc_howto_type mips_howto_table_ext[] = { | 275 static reloc_howto_type mips_howto_table_ext[] = |
| 276 { |
| 288 {MIPS_RELOC_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, | 277 {MIPS_RELOC_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, |
| 289 "32", FALSE, 0, 0xffffffff, FALSE}, | 278 "32", FALSE, 0, 0xffffffff, FALSE}, |
| 290 {MIPS_RELOC_JMP, 2, 2, 26, FALSE, 0, complain_overflow_dont, | 279 {MIPS_RELOC_JMP, 2, 2, 26, FALSE, 0, complain_overflow_dont, |
| 291 mips_fix_jmp_addr, | 280 mips_fix_jmp_addr, |
| 292 "MIPS_JMP", FALSE, 0, 0x03ffffff, FALSE}, | 281 "MIPS_JMP", FALSE, 0, 0x03ffffff, FALSE}, |
| 293 {MIPS_RELOC_WDISP16, 2, 2, 16, TRUE, 0, complain_overflow_signed, 0, | 282 {MIPS_RELOC_WDISP16, 2, 2, 16, TRUE, 0, complain_overflow_signed, 0, |
| 294 "WDISP16", FALSE, 0, 0x0000ffff, FALSE}, | 283 "WDISP16", FALSE, 0, 0x0000ffff, FALSE}, |
| 295 {MIPS_RELOC_HI16, 16, 2, 16, FALSE, 0, complain_overflow_bitfield, 0, | 284 {MIPS_RELOC_HI16, 16, 2, 16, FALSE, 0, complain_overflow_bitfield, 0, |
| 296 "HI16", FALSE, 0, 0x0000ffff, FALSE}, | 285 "HI16", FALSE, 0, 0x0000ffff, FALSE}, |
| 297 {MIPS_RELOC_HI16_S, 16, 2, 16, FALSE, 0, complain_overflow_bitfield, | 286 {MIPS_RELOC_HI16_S, 16, 2, 16, FALSE, 0, complain_overflow_bitfield, |
| 298 mips_fix_hi16_s, | 287 mips_fix_hi16_s, |
| 299 "HI16_S", FALSE, 0, 0x0000ffff, FALSE}, | 288 "HI16_S", FALSE, 0, 0x0000ffff, FALSE}, |
| 300 {MIPS_RELOC_LO16, 0, 2, 16, FALSE, 0, complain_overflow_dont, 0, | 289 {MIPS_RELOC_LO16, 0, 2, 16, FALSE, 0, complain_overflow_dont, 0, |
| 301 "LO16", FALSE, 0, 0x0000ffff, FALSE}, | 290 "LO16", FALSE, 0, 0x0000ffff, FALSE}, |
| 302 }; | 291 }; |
| 303 | 292 |
| 304 static reloc_howto_type * | 293 static reloc_howto_type * |
| 305 MY(reloc_type_lookup) (bfd *abfd, bfd_reloc_code_real_type code) | 294 MY(reloc_type_lookup) (bfd *abfd, bfd_reloc_code_real_type code) |
| 306 { | 295 { |
| 307 | |
| 308 if (bfd_get_arch (abfd) != bfd_arch_mips) | 296 if (bfd_get_arch (abfd) != bfd_arch_mips) |
| 309 return 0; | 297 return NULL; |
| 310 | 298 |
| 311 switch (code) | 299 switch (code) |
| 312 { | 300 { |
| 313 case BFD_RELOC_CTOR: | 301 case BFD_RELOC_CTOR: |
| 314 case BFD_RELOC_32: | 302 case BFD_RELOC_32: |
| 315 return (&mips_howto_table_ext[MIPS_RELOC_32]); | 303 return (&mips_howto_table_ext[MIPS_RELOC_32]); |
| 316 case BFD_RELOC_MIPS_JMP: | 304 case BFD_RELOC_MIPS_JMP: |
| 317 return (&mips_howto_table_ext[MIPS_RELOC_JMP]); | 305 return (&mips_howto_table_ext[MIPS_RELOC_JMP]); |
| 318 case BFD_RELOC_16_PCREL_S2: | 306 case BFD_RELOC_16_PCREL_S2: |
| 319 return (&mips_howto_table_ext[MIPS_RELOC_WDISP16]); | 307 return (&mips_howto_table_ext[MIPS_RELOC_WDISP16]); |
| 320 case BFD_RELOC_HI16: | 308 case BFD_RELOC_HI16: |
| 321 return (&mips_howto_table_ext[MIPS_RELOC_HI16]); | 309 return (&mips_howto_table_ext[MIPS_RELOC_HI16]); |
| 322 case BFD_RELOC_HI16_S: | 310 case BFD_RELOC_HI16_S: |
| 323 return (&mips_howto_table_ext[MIPS_RELOC_HI16_S]); | 311 return (&mips_howto_table_ext[MIPS_RELOC_HI16_S]); |
| 324 case BFD_RELOC_LO16: | 312 case BFD_RELOC_LO16: |
| 325 return (&mips_howto_table_ext[MIPS_RELOC_LO16]); | 313 return (&mips_howto_table_ext[MIPS_RELOC_LO16]); |
| 326 default: | 314 default: |
| 327 return 0; | 315 return NULL; |
| 328 } | 316 } |
| 329 } | 317 } |
| 330 | 318 |
| 331 static reloc_howto_type * | 319 static reloc_howto_type * |
| 332 MY(reloc_name_lookup) (bfd *abfd ATTRIBUTE_UNUSED, | 320 MY(reloc_name_lookup) (bfd *abfd ATTRIBUTE_UNUSED, |
| 333 » » » const char *r_name) | 321 » » const char *r_name) |
| 334 { | 322 { |
| 335 unsigned int i; | 323 unsigned int i; |
| 336 | 324 |
| 337 for (i = 0; | 325 for (i = 0; |
| 338 i < sizeof (mips_howto_table_ext) / sizeof (mips_howto_table_ext[0]); | 326 i < sizeof (mips_howto_table_ext) / sizeof (mips_howto_table_ext[0]); |
| 339 i++) | 327 i++) |
| 340 if (mips_howto_table_ext[i].name != NULL | 328 if (mips_howto_table_ext[i].name != NULL |
| 341 && strcasecmp (mips_howto_table_ext[i].name, r_name) == 0) | 329 && strcasecmp (mips_howto_table_ext[i].name, r_name) == 0) |
| 342 return &mips_howto_table_ext[i]; | 330 return &mips_howto_table_ext[i]; |
| 343 | 331 |
| 344 return NULL; | 332 return NULL; |
| 345 } | 333 } |
| 346 | 334 |
| 347 /* This is just like the standard aoutx.h version but we need to do our | 335 /* This is just like the standard aoutx.h version but we need to do our |
| 348 own mapping of external reloc type values to howto entries. */ | 336 own mapping of external reloc type values to howto entries. */ |
| 349 long | 337 long |
| 350 MY(canonicalize_reloc) (abfd, section, relptr, symbols) | 338 MY(canonicalize_reloc) (bfd *abfd, |
| 351 bfd *abfd; | 339 » » » sec_ptr section, |
| 352 sec_ptr section; | 340 » » » arelent **relptr, |
| 353 arelent **relptr; | 341 » » » asymbol **symbols) |
| 354 asymbol **symbols; | |
| 355 { | 342 { |
| 356 arelent *tblptr = section->relocation; | 343 arelent *tblptr = section->relocation; |
| 357 unsigned int count, c; | 344 unsigned int count, c; |
| 358 extern reloc_howto_type NAME(aout,ext_howto_table)[]; | 345 extern reloc_howto_type NAME(aout,ext_howto_table)[]; |
| 359 | 346 |
| 360 /* If we have already read in the relocation table, return the values. */ | 347 /* If we have already read in the relocation table, return the values. */ |
| 361 if (section->flags & SEC_CONSTRUCTOR) | 348 if (section->flags & SEC_CONSTRUCTOR) |
| 362 { | 349 { |
| 363 arelent_chain *chain = section->constructor_chain; | 350 arelent_chain *chain = section->constructor_chain; |
| 364 | 351 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 388 { | 375 { |
| 389 c = tblptr->howto - NAME(aout,ext_howto_table); | 376 c = tblptr->howto - NAME(aout,ext_howto_table); |
| 390 tblptr->howto = &mips_howto_table_ext[c]; | 377 tblptr->howto = &mips_howto_table_ext[c]; |
| 391 | 378 |
| 392 *relptr++ = tblptr++; | 379 *relptr++ = tblptr++; |
| 393 } | 380 } |
| 394 *relptr = 0; | 381 *relptr = 0; |
| 395 return section->reloc_count; | 382 return section->reloc_count; |
| 396 } | 383 } |
| 397 | 384 |
| 398 static const struct aout_backend_data MY(backend_data) = { | 385 static const struct aout_backend_data MY(backend_data) = |
| 386 { |
| 399 0, /* zmagic contiguous */ | 387 0, /* zmagic contiguous */ |
| 400 1, /* text incl header */ | 388 1, /* text incl header */ |
| 401 0, /* entry is text address */ | 389 0, /* entry is text address */ |
| 402 0, /* exec_hdr_flags */ | 390 0, /* exec_hdr_flags */ |
| 403 TARGET_PAGE_SIZE, /* text vma */ | 391 TARGET_PAGE_SIZE, /* text vma */ |
| 404 MY_set_sizes, | 392 MY_set_sizes, |
| 405 0, /* text size includes exec header */ | 393 0, /* text size includes exec header */ |
| 406 0, /* add_dynamic_symbols */ | 394 0, /* add_dynamic_symbols */ |
| 407 0, /* add_one_symbol */ | 395 0, /* add_one_symbol */ |
| 408 0, /* link_dynamic_object */ | 396 0, /* link_dynamic_object */ |
| 409 0, /* write_dynamic_symbol */ | 397 0, /* write_dynamic_symbol */ |
| 410 0, /* check_dynamic_reloc */ | 398 0, /* check_dynamic_reloc */ |
| 411 0 /* finish_dynamic_link */ | 399 0 /* finish_dynamic_link */ |
| 412 }; | 400 }; |
| 413 | 401 |
| 414 extern const bfd_target aout_mips_big_vec; | 402 extern const bfd_target aout_mips_big_vec; |
| 415 | 403 |
| 416 const bfd_target aout_mips_little_vec = | 404 const bfd_target aout_mips_little_vec = |
| 417 { | 405 { |
| 418 "a.out-mips-little", /* name */ | 406 "a.out-mips-little", /* name */ |
| 419 bfd_target_aout_flavour, | 407 bfd_target_aout_flavour, |
| 420 BFD_ENDIAN_LITTLE, /* target byte order (little) */ | 408 BFD_ENDIAN_LITTLE, /* target byte order (little) */ |
| 421 BFD_ENDIAN_LITTLE, /* target headers byte order (little) */ | 409 BFD_ENDIAN_LITTLE, /* target headers byte order (little) */ |
| 422 (HAS_RELOC | EXEC_P | /* object flags */ | 410 (HAS_RELOC | EXEC_P | /* object flags */ |
| 423 HAS_LINENO | HAS_DEBUG | | 411 HAS_LINENO | HAS_DEBUG | |
| 424 HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), | 412 HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), |
| 425 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), | 413 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), |
| 426 MY_symbol_leading_char, | 414 MY_symbol_leading_char, |
| 427 ' ', /* ar_pad_char */ | 415 ' ', /* ar_pad_char */ |
| (...skipping 17 matching lines...) Expand all Loading... |
| 445 BFD_JUMP_TABLE_CORE (MY), | 433 BFD_JUMP_TABLE_CORE (MY), |
| 446 BFD_JUMP_TABLE_ARCHIVE (MY), | 434 BFD_JUMP_TABLE_ARCHIVE (MY), |
| 447 BFD_JUMP_TABLE_SYMBOLS (MY), | 435 BFD_JUMP_TABLE_SYMBOLS (MY), |
| 448 BFD_JUMP_TABLE_RELOCS (MY), | 436 BFD_JUMP_TABLE_RELOCS (MY), |
| 449 BFD_JUMP_TABLE_WRITE (MY), | 437 BFD_JUMP_TABLE_WRITE (MY), |
| 450 BFD_JUMP_TABLE_LINK (MY), | 438 BFD_JUMP_TABLE_LINK (MY), |
| 451 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), | 439 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), |
| 452 | 440 |
| 453 & aout_mips_big_vec, | 441 & aout_mips_big_vec, |
| 454 | 442 |
| 455 (PTR) MY_backend_data | 443 MY_backend_data |
| 456 }; | 444 }; |
| 457 | 445 |
| 458 const bfd_target aout_mips_big_vec = | 446 const bfd_target aout_mips_big_vec = |
| 459 { | 447 { |
| 460 "a.out-mips-big", /* name */ | 448 "a.out-mips-big", /* name */ |
| 461 bfd_target_aout_flavour, | 449 bfd_target_aout_flavour, |
| 462 BFD_ENDIAN_BIG, /* target byte order (big) */ | 450 BFD_ENDIAN_BIG, /* target byte order (big) */ |
| 463 BFD_ENDIAN_BIG, /* target headers byte order (big) */ | 451 BFD_ENDIAN_BIG, /* target headers byte order (big) */ |
| 464 (HAS_RELOC | EXEC_P | /* object flags */ | 452 (HAS_RELOC | EXEC_P | /* object flags */ |
| 465 HAS_LINENO | HAS_DEBUG | | 453 HAS_LINENO | HAS_DEBUG | |
| (...skipping 21 matching lines...) Expand all Loading... |
| 487 BFD_JUMP_TABLE_CORE (MY), | 475 BFD_JUMP_TABLE_CORE (MY), |
| 488 BFD_JUMP_TABLE_ARCHIVE (MY), | 476 BFD_JUMP_TABLE_ARCHIVE (MY), |
| 489 BFD_JUMP_TABLE_SYMBOLS (MY), | 477 BFD_JUMP_TABLE_SYMBOLS (MY), |
| 490 BFD_JUMP_TABLE_RELOCS (MY), | 478 BFD_JUMP_TABLE_RELOCS (MY), |
| 491 BFD_JUMP_TABLE_WRITE (MY), | 479 BFD_JUMP_TABLE_WRITE (MY), |
| 492 BFD_JUMP_TABLE_LINK (MY), | 480 BFD_JUMP_TABLE_LINK (MY), |
| 493 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), | 481 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), |
| 494 | 482 |
| 495 & aout_mips_little_vec, | 483 & aout_mips_little_vec, |
| 496 | 484 |
| 497 (PTR) MY_backend_data | 485 MY_backend_data |
| 498 }; | 486 }; |
| OLD | NEW |