diff options
author | dim <dim@FreeBSD.org> | 2010-10-21 19:11:14 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2010-10-21 19:11:14 +0000 |
commit | 844d5c9852c83cc56dccdc017c27f2bfc0928f05 (patch) | |
tree | 506464413c40d2c6a4a46d04892a9415cb886522 /contrib/binutils/bfd/coff64-rs6000.c | |
parent | acc1b913a3297e19f9ffe7d2b7b8a3142926d3b4 (diff) | |
parent | 0acbbeece75076693a5c54ce4d376aa9f021b4e3 (diff) | |
download | FreeBSD-src-844d5c9852c83cc56dccdc017c27f2bfc0928f05.zip FreeBSD-src-844d5c9852c83cc56dccdc017c27f2bfc0928f05.tar.gz |
Merge ^vendor/binutils/dist@214082 into contrib/binutils.
Diffstat (limited to 'contrib/binutils/bfd/coff64-rs6000.c')
-rw-r--r-- | contrib/binutils/bfd/coff64-rs6000.c | 61 |
1 files changed, 39 insertions, 22 deletions
diff --git a/contrib/binutils/bfd/coff64-rs6000.c b/contrib/binutils/bfd/coff64-rs6000.c index ec9c695..e0aa87e 100644 --- a/contrib/binutils/bfd/coff64-rs6000.c +++ b/contrib/binutils/bfd/coff64-rs6000.c @@ -1,5 +1,5 @@ /* BFD back-end for IBM RS/6000 "XCOFF64" files. - Copyright 2000, 2001, 2002, 2003 + Copyright 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Written Clinton Popetz. Contributed by Cygnus Support. @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #include "bfd.h" #include "sysdep.h" @@ -564,7 +564,7 @@ _bfd_xcoff64_put_ldsymbol_name (abfd, ldinfo, ldsym, name) if (ldinfo->string_size + len + 3 > ldinfo->string_alc) { bfd_size_type newalc; - bfd_byte *newstrings; + char *newstrings; newalc = ldinfo->string_alc * 2; if (newalc == 0) @@ -572,8 +572,7 @@ _bfd_xcoff64_put_ldsymbol_name (abfd, ldinfo, ldsym, name) while (ldinfo->string_size + len + 3 > newalc) newalc *= 2; - newstrings = ((bfd_byte *) - bfd_realloc ((PTR) ldinfo->strings, newalc)); + newstrings = bfd_realloc (ldinfo->strings, newalc); if (newstrings == NULL) { ldinfo->failed = TRUE; @@ -845,11 +844,11 @@ xcoff64_write_object_contents (abfd) section.s_vaddr = current->vma; section.s_paddr = current->lma; - section.s_size = current->_raw_size; + section.s_size = current->size; /* If this section has no size or is unloadable then the scnptr will be 0 too. */ - if (current->_raw_size == 0 + if (current->size == 0 || (current->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0) { section.s_scnptr = 0; @@ -965,19 +964,19 @@ xcoff64_write_object_contents (abfd) if (text_sec) { - internal_a.tsize = bfd_get_section_size_before_reloc (text_sec); + internal_a.tsize = text_sec->size; internal_a.text_start = internal_a.tsize ? text_sec->vma : 0; } if (data_sec) { - internal_a.dsize = bfd_get_section_size_before_reloc (data_sec); + internal_a.dsize = data_sec->size; internal_a.data_start = internal_a.dsize ? data_sec->vma : 0; } if (bss_sec) { - internal_a.bsize = bfd_get_section_size_before_reloc (bss_sec); + internal_a.bsize = bss_sec->size; if (internal_a.bsize && bss_sec->vma < internal_a.data_start) internal_a.data_start = bss_sec->vma; } @@ -1127,8 +1126,7 @@ xcoff64_reloc_type_br (input_bfd, input_section, output_bfd, rel, sym, howto, cror. */ if (NULL != h && bfd_link_hash_defined == h->root.type - && (rel->r_vaddr - input_section->vma + 8 - <= input_section->_cooked_size)) + && rel->r_vaddr - input_section->vma + 8 <= input_section->size) { bfd_byte *pnext; unsigned long next; @@ -1301,7 +1299,7 @@ xcoff64_ppc_relocate_section (output_bfd, info, input_bfd, address = rel->r_vaddr - input_section->vma; location = contents + address; - if (address > input_section->_raw_size) + if (address > input_section->size) abort (); /* Get the value we are going to relocate. */ @@ -1336,7 +1334,7 @@ xcoff64_ppc_relocate_section (output_bfd, info, input_bfd, } else if (h != NULL) { - name = h->root.root.string; + name = NULL; } else { @@ -1347,8 +1345,9 @@ xcoff64_ppc_relocate_section (output_bfd, info, input_bfd, sprintf (reloc_type_name, "0x%02x", rel->r_type); if (! ((*info->callbacks->reloc_overflow) - (info, name, reloc_type_name, (bfd_vma) 0, input_bfd, - input_section, rel->r_vaddr - input_section->vma))) + (info, (h ? &h->root : NULL), name, reloc_type_name, + (bfd_vma) 0, input_bfd, input_section, + rel->r_vaddr - input_section->vma))) return FALSE; } @@ -1984,10 +1983,12 @@ xcoff64_archive_p (abfd) if (bfd_ardata (abfd) == (struct artdata *) NULL) goto error_ret_restore; - bfd_ardata (abfd)->cache = NULL; - bfd_ardata (abfd)->archive_head = NULL; - bfd_ardata (abfd)->symdefs = NULL; - bfd_ardata (abfd)->extended_names = NULL; + /* Already cleared by bfd_zalloc above. + bfd_ardata (abfd)->cache = NULL; + bfd_ardata (abfd)->archive_head = NULL; + bfd_ardata (abfd)->symdefs = NULL; + bfd_ardata (abfd)->extended_names = NULL; + bfd_ardata (abfd)->extended_names_size = 0; */ bfd_ardata (abfd)->first_file_filepos = bfd_scan_vma (hdr.firstmemoff, (const char **) NULL, 10); @@ -2105,8 +2106,8 @@ xcoff64_create_csect_from_smclas (abfd, aux, symbol_name) else { (*_bfd_error_handler) - (_("%s: symbol `%s' has unrecognized smclas %d"), - bfd_archive_filename (abfd), symbol_name, aux->x_csect.x_smclas); + (_("%B: symbol `%s' has unrecognized smclas %d"), + abfd, symbol_name, aux->x_csect.x_smclas); bfd_set_error (bfd_error_bad_value); } @@ -2681,8 +2682,10 @@ const bfd_target rs6000coff64_vec = /* Copy */ _bfd_xcoff_copy_private_bfd_data, ((bfd_boolean (*) (bfd *, bfd *)) bfd_true), + _bfd_generic_init_private_section_data, ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), + ((bfd_boolean (*) (bfd *, bfd *)) bfd_true), ((bfd_boolean (*) (bfd *, flagword)) bfd_true), ((bfd_boolean (*) (bfd *, void * )) bfd_true), @@ -2710,8 +2713,11 @@ const bfd_target rs6000coff64_vec = coff_print_symbol, coff_get_symbol_info, _bfd_xcoff_is_local_label_name, + coff_bfd_is_target_special_symbol, coff_get_lineno, coff_find_nearest_line, + _bfd_generic_find_line, + coff_find_inliner_info, coff_bfd_make_debug_symbol, _bfd_generic_read_minisymbols, _bfd_generic_minisymbol_to_symbol, @@ -2737,11 +2743,14 @@ const bfd_target rs6000coff64_vec = _bfd_generic_link_split_section, bfd_generic_gc_sections, bfd_generic_merge_sections, + bfd_generic_is_group_section, bfd_generic_discard_group, + _bfd_generic_section_already_linked, /* Dynamic */ _bfd_xcoff_get_dynamic_symtab_upper_bound, _bfd_xcoff_canonicalize_dynamic_symtab, + _bfd_nodynamic_get_synthetic_symtab, _bfd_xcoff_get_dynamic_reloc_upper_bound, _bfd_xcoff_canonicalize_dynamic_reloc, @@ -2924,8 +2933,10 @@ const bfd_target aix5coff64_vec = /* Copy */ _bfd_xcoff_copy_private_bfd_data, ((bfd_boolean (*) (bfd *, bfd *)) bfd_true), + _bfd_generic_init_private_section_data, ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), + ((bfd_boolean (*) (bfd *, bfd *)) bfd_true), ((bfd_boolean (*) (bfd *, flagword)) bfd_true), ((bfd_boolean (*) (bfd *, void * )) bfd_true), @@ -2953,8 +2964,11 @@ const bfd_target aix5coff64_vec = coff_print_symbol, coff_get_symbol_info, _bfd_xcoff_is_local_label_name, + coff_bfd_is_target_special_symbol, coff_get_lineno, coff_find_nearest_line, + _bfd_generic_find_line, + coff_find_inliner_info, coff_bfd_make_debug_symbol, _bfd_generic_read_minisymbols, _bfd_generic_minisymbol_to_symbol, @@ -2980,11 +2994,14 @@ const bfd_target aix5coff64_vec = _bfd_generic_link_split_section, bfd_generic_gc_sections, bfd_generic_merge_sections, + bfd_generic_is_group_section, bfd_generic_discard_group, + _bfd_generic_section_already_linked, /* Dynamic */ _bfd_xcoff_get_dynamic_symtab_upper_bound, _bfd_xcoff_canonicalize_dynamic_symtab, + _bfd_nodynamic_get_synthetic_symtab, _bfd_xcoff_get_dynamic_reloc_upper_bound, _bfd_xcoff_canonicalize_dynamic_reloc, |