OLD | NEW |
1 /* BFD back-end for RISC iX (Acorn, arm) binaries. | 1 /* BFD back-end for RISC iX (Acorn, arm) binaries. |
2 Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, | 2 Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, |
3 2005, 2007, 2010 Free Software Foundation, Inc. | 3 2005, 2007, 2010, 2012 Free Software Foundation, Inc. |
4 Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) | 4 Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) |
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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 asection *input_section, | 200 asection *input_section, |
201 bfd *output_bfd, | 201 bfd *output_bfd, |
202 char **error_message ATTRIBUTE_UNUSED) | 202 char **error_message ATTRIBUTE_UNUSED) |
203 { | 203 { |
204 bfd_vma relocation; | 204 bfd_vma relocation; |
205 bfd_size_type addr = reloc_entry->address; | 205 bfd_size_type addr = reloc_entry->address; |
206 long target = bfd_get_32 (abfd, (bfd_byte *) data + addr); | 206 long target = bfd_get_32 (abfd, (bfd_byte *) data + addr); |
207 bfd_reloc_status_type flag = bfd_reloc_ok; | 207 bfd_reloc_status_type flag = bfd_reloc_ok; |
208 | 208 |
209 /* If this is an undefined symbol, return error. */ | 209 /* If this is an undefined symbol, return error. */ |
210 if (symbol->section == &bfd_und_section | 210 if (bfd_is_und_section (symbol->section) |
211 && (symbol->flags & BSF_WEAK) == 0) | 211 && (symbol->flags & BSF_WEAK) == 0) |
212 return output_bfd ? bfd_reloc_continue : bfd_reloc_undefined; | 212 return output_bfd ? bfd_reloc_continue : bfd_reloc_undefined; |
213 | 213 |
214 /* If the sections are different, and we are doing a partial relocation, | 214 /* If the sections are different, and we are doing a partial relocation, |
215 just ignore it for now. */ | 215 just ignore it for now. */ |
216 if (symbol->section->name != input_section->name | 216 if (symbol->section->name != input_section->name |
217 && output_bfd != NULL) | 217 && output_bfd != NULL) |
218 return bfd_reloc_continue; | 218 return bfd_reloc_continue; |
219 | 219 |
220 relocation = (target & 0x00ffffff) << 2; | 220 relocation = (target & 0x00ffffff) << 2; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 /* Name was clobbered by aout_write_syms to be symbol index. */ | 334 /* Name was clobbered by aout_write_syms to be symbol index. */ |
335 | 335 |
336 /* If this relocation is relative to a symbol then set the | 336 /* If this relocation is relative to a symbol then set the |
337 r_index to the symbols index, and the r_extern bit. | 337 r_index to the symbols index, and the r_extern bit. |
338 | 338 |
339 Absolute symbols can come in in two ways, either as an offset | 339 Absolute symbols can come in in two ways, either as an offset |
340 from the abs section, or as a symbol which has an abs value. | 340 from the abs section, or as a symbol which has an abs value. |
341 check for that here. */ | 341 check for that here. */ |
342 | 342 |
343 if (bfd_is_com_section (output_section) | 343 if (bfd_is_com_section (output_section) |
344 || output_section == & bfd_abs_section | 344 || bfd_is_abs_section (output_section) |
345 || output_section == & bfd_und_section) | 345 || bfd_is_und_section (output_section)) |
346 { | 346 { |
347 if (bfd_abs_section.symbol == sym) | 347 if (bfd_abs_section_ptr->symbol == sym) |
348 { | 348 { |
349 /* Whoops, looked like an abs symbol, but is really an offset | 349 /* Whoops, looked like an abs symbol, but is really an offset |
350 from the abs section. */ | 350 from the abs section. */ |
351 r_index = 0; | 351 r_index = 0; |
352 r_extern = 0; | 352 r_extern = 0; |
353 } | 353 } |
354 else | 354 else |
355 { | 355 { |
356 /* Fill in symbol. */ | 356 /* Fill in symbol. */ |
357 r_extern = 1; | 357 r_extern = 1; |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 #endif | 647 #endif |
648 | 648 |
649 NAME (aout, swap_exec_header_in) (abfd, & exec_bytes, & exec); | 649 NAME (aout, swap_exec_header_in) (abfd, & exec_bytes, & exec); |
650 | 650 |
651 target = riscix_some_aout_object_p (abfd, & exec, MY (callback)); | 651 target = riscix_some_aout_object_p (abfd, & exec, MY (callback)); |
652 | 652 |
653 return target; | 653 return target; |
654 } | 654 } |
655 | 655 |
656 #include "aout-target.h" | 656 #include "aout-target.h" |
OLD | NEW |