X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Fcoff-rs6000.c;h=84860db39ee9c815c20c57c9cdd768be9a7ace78;hb=c7022704e9919b724a9e935b4d0bae877946c735;hp=1f976d9e2cab6c6875b131ff5a69a5230c2428bb;hpb=4b95cf5c0c75d6efc1b2f96af72317aecca079f1;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index 1f976d9e2c..84860db39e 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -1,5 +1,5 @@ /* BFD back-end for IBM RS/6000 "XCOFF" files. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2016 Free Software Foundation, Inc. Written by Metin G. Ozisik, Mimi Phuong-Thao Vo, and John Gilmore. Archive support from Damon A. Permezel. Contributed by IBM Corporation and Cygnus Support. @@ -114,6 +114,7 @@ extern int rs6000coff_core_file_failing_signal (bfd *abfd); #define bfd_pe_print_pdata NULL #endif +#include #include "coffcode.h" /* The main body of code is in coffcode.h. */ @@ -401,67 +402,6 @@ _bfd_xcoff_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, { return FALSE; } - -static const struct dwarf_debug_section xcoff_debug_sections[] = -{ - { ".dwabrev", NULL }, - { ".dwarnge", NULL }, - { NULL, NULL }, /* .debug_frame */ - { ".dwinfo", NULL }, - { ".dwline", NULL }, - { NULL, NULL }, /* .debug_loc */ - { NULL, NULL }, /* .debug_macinfo */ - { NULL, NULL }, /* .debug_macro */ - { ".dwpbnms", NULL }, - { ".dwpbtyp", NULL }, - { ".dwrnges", NULL }, - { NULL, NULL }, /* .debug_static_func */ - { NULL, NULL }, /* .debug_static_vars */ - { ".dwstr", NULL }, - { NULL, NULL }, /* .debug_types */ - /* GNU DWARF 1 extensions */ - { NULL, NULL }, /* .debug_sfnames */ - { NULL, NULL }, /* .debug_srcinfo */ - /* SGI/MIPS DWARF 2 extensions */ - { NULL, NULL }, /* .debug_funcnames */ - { NULL, NULL }, /* .debug_typenames */ - { NULL, NULL }, /* .debug_varnames */ - { NULL, NULL }, /* .debug_weaknames */ - { NULL, NULL }, -}; - -static bfd_boolean -xcoff_find_nearest_line (bfd *abfd, - asection *section, - asymbol **symbols, - bfd_vma offset, - const char **filename_ptr, - const char **functionname_ptr, - unsigned int *line_ptr) -{ - return coff_find_nearest_line_with_names (abfd, xcoff_debug_sections, - section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr); -} - -static bfd_boolean -xcoff_find_nearest_line_discriminator (bfd *abfd, - asection *section, - asymbol **symbols, - bfd_vma offset, - const char **filename_ptr, - const char **functionname_ptr, - unsigned int *line_ptr, - unsigned int *discriminator) -{ - *discriminator = 0; - return coff_find_nearest_line_with_names (abfd, xcoff_debug_sections, - section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr); -} - void _bfd_xcoff_swap_sym_in (bfd *abfd, void * ext1, void * in1) @@ -480,7 +420,7 @@ _bfd_xcoff_swap_sym_in (bfd *abfd, void * ext1, void * in1) } in->n_value = H_GET_32 (abfd, ext->e_value); - in->n_scnum = H_GET_16 (abfd, ext->e_scnum); + in->n_scnum = (short) H_GET_16 (abfd, ext->e_scnum); in->n_type = H_GET_16 (abfd, ext->e_type); in->n_sclass = H_GET_8 (abfd, ext->e_sclass); in->n_numaux = H_GET_8 (abfd, ext->e_numaux); @@ -2588,7 +2528,7 @@ _bfd_xcoff_sizeof_headers (bfd *abfd, }; struct nbr_reloc_lineno *n_rl; bfd *sub; - int max_index; + unsigned int max_index; asection *s; /* Although the number of sections is known, the maximum value of @@ -2607,7 +2547,7 @@ _bfd_xcoff_sizeof_headers (bfd *abfd, return -1; /* Sum. */ - for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + for (sub = info->input_bfds; sub != NULL; sub = sub->link.next) for (s = sub->sections; s != NULL; s = s->next) { struct nbr_reloc_lineno *e = &n_rl[s->output_section->index]; @@ -3427,15 +3367,12 @@ xcoff_ppc_relocate_section (bfd *output_bfd, { if (info->unresolved_syms_in_objects != RM_IGNORE && (h->flags & XCOFF_WAS_UNDEFINED) != 0) - { - if (! ((*info->callbacks->undefined_symbol) - (info, h->root.root.string, - input_bfd, input_section, - rel->r_vaddr - input_section->vma, - (info->unresolved_syms_in_objects - == RM_GENERATE_ERROR)))) - return FALSE; - } + (*info->callbacks->undefined_symbol) + (info, h->root.root.string, + input_bfd, input_section, + rel->r_vaddr - input_section->vma, + info->unresolved_syms_in_objects == RM_GENERATE_ERROR); + if (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) { @@ -3453,7 +3390,7 @@ xcoff_ppc_relocate_section (bfd *output_bfd, } else { - BFD_ASSERT (info->relocatable + BFD_ASSERT (bfd_link_relocatable (info) || (info->static_link && (h->flags & XCOFF_WAS_UNDEFINED) != 0) || (h->flags & XCOFF_DEF_DYNAMIC) != 0 @@ -3515,11 +3452,10 @@ xcoff_ppc_relocate_section (bfd *output_bfd, } sprintf (reloc_type_name, "0x%02x", rel->r_type); - if (! ((*info->callbacks->reloc_overflow) - (info, (h ? &h->root : NULL), name, reloc_type_name, - (bfd_vma) 0, input_bfd, input_section, - rel->r_vaddr - input_section->vma))) - return FALSE; + (*info->callbacks->reloc_overflow) + (info, (h ? &h->root : NULL), name, reloc_type_name, + (bfd_vma) 0, input_bfd, input_section, + rel->r_vaddr - input_section->vma); } /* Add RELOCATION to the right bits of VALUE_TO_RELOCATE. */ @@ -3583,7 +3519,8 @@ _bfd_xcoff_put_ldsymbol_name (bfd *abfd ATTRIBUTE_UNUSED, } static bfd_boolean -_bfd_xcoff_put_symbol_name (bfd *abfd, struct bfd_strtab_hash *strtab, +_bfd_xcoff_put_symbol_name (struct bfd_link_info *info, + struct bfd_strtab_hash *strtab, struct internal_syment *sym, const char *name) { @@ -3596,9 +3533,7 @@ _bfd_xcoff_put_symbol_name (bfd *abfd, struct bfd_strtab_hash *strtab, bfd_boolean hash; bfd_size_type indx; - hash = TRUE; - if ((abfd->flags & BFD_TRADITIONAL_FORMAT) != 0) - hash = FALSE; + hash = !info->traditional_format; indx = _bfd_stringtab_add (strtab, name, hash, FALSE); if (indx == (bfd_size_type) -1) return FALSE; @@ -3623,7 +3558,7 @@ xcoff_create_csect_from_smclas (bfd *abfd, ".sv", ".bs", ".ds", ".uc", ".ti", ".tb", NULL, ".tc0", /* 8 - 15 */ ".td", NULL, ".sv3264", NULL, ".tl", ".ul", ".te" }; - + if ((aux->x_csect.x_smclas < ARRAY_SIZE (names)) && (NULL != names[aux->x_csect.x_smclas])) { @@ -4040,13 +3975,14 @@ const struct xcoff_dwsect_name xcoff_dwsect_names[] = { #define _bfd_xcoff_make_empty_symbol coff_make_empty_symbol #define _bfd_xcoff_print_symbol coff_print_symbol #define _bfd_xcoff_get_symbol_info coff_get_symbol_info +#define _bfd_xcoff_get_symbol_version_string \ + _bfd_nosymbols_get_symbol_version_string #define _bfd_xcoff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name #define _bfd_xcoff_bfd_is_target_special_symbol \ coff_bfd_is_target_special_symbol #define _bfd_xcoff_get_lineno coff_get_lineno -#define _bfd_xcoff_find_nearest_line xcoff_find_nearest_line -#define _bfd_generic_find_nearest_line_discriminator \ - xcoff_find_nearest_line_discriminator +#define _bfd_xcoff_find_nearest_line coff_find_nearest_line +#define _bfd_xcoff_find_line coff_find_line #define _bfd_xcoff_find_inliner_info coff_find_inliner_info #define _bfd_xcoff_bfd_make_debug_symbol coff_bfd_make_debug_symbol #define _bfd_xcoff_read_minisymbols _bfd_generic_read_minisymbols @@ -4074,6 +4010,7 @@ const struct xcoff_dwsect_name xcoff_dwsect_names[] = { #define _bfd_xcoff_bfd_discard_group bfd_generic_discard_group #define _bfd_xcoff_section_already_linked _bfd_generic_section_already_linked #define _bfd_xcoff_bfd_define_common_symbol _bfd_xcoff_define_common_symbol +#define _bfd_xcoff_bfd_link_check_relocs _bfd_generic_link_check_relocs /* For dynamic symbols and relocs entry points. */ #define _bfd_xcoff_get_synthetic_symtab _bfd_nodynamic_get_synthetic_symtab @@ -4104,6 +4041,7 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = 3, /* _bfd_coff_default_section_alignment_power */ FALSE, /* _bfd_coff_force_symnames_in_strings */ 2, /* _bfd_coff_debug_string_prefix_length */ + 32768, /* _bfd_coff_max_nscns */ coff_swap_filehdr_in, coff_swap_aouthdr_in, coff_swap_scnhdr_in, @@ -4175,7 +4113,7 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = }; /* The transfer vector that leads the outside world to all of the above. */ -const bfd_target rs6000coff_vec = +const bfd_target rs6000_xcoff_vec = { "aixcoff-rs6000", bfd_target_xcoff_flavour, @@ -4284,6 +4222,7 @@ static const struct xcoff_backend_data_rec bfd_pmac_xcoff_backend_data = 3, /* _bfd_coff_default_section_alignment_power */ FALSE, /* _bfd_coff_force_symnames_in_strings */ 2, /* _bfd_coff_debug_string_prefix_length */ + 32768, /* _bfd_coff_max_nscns */ coff_swap_filehdr_in, coff_swap_aouthdr_in, coff_swap_scnhdr_in, @@ -4355,7 +4294,7 @@ static const struct xcoff_backend_data_rec bfd_pmac_xcoff_backend_data = }; /* The transfer vector that leads the outside world to all of the above. */ -const bfd_target pmac_xcoff_vec = +const bfd_target powerpc_xcoff_vec = { "xcoff-powermac", bfd_target_xcoff_flavour,