Lines Matching refs:abfd
590 styp_to_sec_flags (bfd *abfd ATTRIBUTE_UNUSED, in styp_to_sec_flags()
732 handle_COMDAT (bfd * abfd, in handle_COMDAT() argument
762 if (! _bfd_coff_get_external_symbols (abfd)) in handle_COMDAT()
765 esymstart = esym = (bfd_byte *) obj_coff_external_syms (abfd); in handle_COMDAT()
766 esymend = esym + obj_raw_syment_count (abfd) * bfd_coff_symesz (abfd); in handle_COMDAT()
774 bfd_coff_swap_sym_in (abfd, esym, & isym); in handle_COMDAT()
810 symname = _bfd_coff_internal_syment_name (abfd, &isym, buf); in handle_COMDAT()
850 abfd, symname, name); in handle_COMDAT()
855 bfd_coff_swap_aux_in (abfd, (esym + bfd_coff_symesz (abfd)), in handle_COMDAT()
943 esym += (isym.n_numaux + 1) * bfd_coff_symesz (abfd); in handle_COMDAT()
960 coff_section_data (abfd, section)->comdat in handle_COMDAT()
961 = bfd_alloc (abfd, amt); in handle_COMDAT()
962 if (coff_section_data (abfd, section)->comdat == NULL) in handle_COMDAT()
965 coff_section_data (abfd, section)->comdat->symbol = in handle_COMDAT()
966 (esym - esymstart) / bfd_coff_symesz (abfd); in handle_COMDAT()
969 newname = bfd_alloc (abfd, amt); in handle_COMDAT()
974 coff_section_data (abfd, section)->comdat->name in handle_COMDAT()
982 esym += (isym.n_numaux + 1) * bfd_coff_symesz (abfd); in handle_COMDAT()
1000 styp_to_sec_flags (bfd *abfd, in styp_to_sec_flags() argument
1062 abfd, name); in styp_to_sec_flags()
1105 sec_flags = handle_COMDAT (abfd, sec_flags, hdr, name, section); in styp_to_sec_flags()
1117 abfd, name, unhandled, flag); in styp_to_sec_flags()
1431 coff_bad_format_hook (bfd * abfd ATTRIBUTE_UNUSED, void * filehdr) in coff_bad_format_hook()
1447 if (internal_f->f_opthdr != 0 && bfd_coff_aoutsz (abfd) != internal_f->f_opthdr) in coff_bad_format_hook()
1456 ticoff0_bad_format_hook (bfd *abfd ATTRIBUTE_UNUSED, void * filehdr) in ticoff0_bad_format_hook()
1469 ticoff1_bad_format_hook (bfd *abfd ATTRIBUTE_UNUSED, void * filehdr) in ticoff1_bad_format_hook()
1484 coff_set_custom_section_alignment (bfd *abfd ATTRIBUTE_UNUSED, in coff_set_custom_section_alignment()
1494 const char *secname = bfd_get_section_name (abfd, section); in coff_set_custom_section_alignment()
1547 coff_new_section_hook (bfd * abfd, asection * section) in coff_new_section_hook() argument
1555 if (bfd_xcoff_text_align_power (abfd) != 0 in coff_new_section_hook()
1556 && strcmp (bfd_get_section_name (abfd, section), ".text") == 0) in coff_new_section_hook()
1557 section->alignment_power = bfd_xcoff_text_align_power (abfd); in coff_new_section_hook()
1558 if (bfd_xcoff_data_align_power (abfd) != 0 in coff_new_section_hook()
1559 && strcmp (bfd_get_section_name (abfd, section), ".data") == 0) in coff_new_section_hook()
1560 section->alignment_power = bfd_xcoff_data_align_power (abfd); in coff_new_section_hook()
1564 if (!_bfd_generic_new_section_hook (abfd, section)) in coff_new_section_hook()
1573 native = bfd_zalloc (abfd, amt); in coff_new_section_hook()
1588 coff_set_custom_section_alignment (abfd, section, in coff_new_section_hook()
1600 coff_set_alignment_hook (bfd * abfd ATTRIBUTE_UNUSED, in coff_set_alignment_hook()
1644 coff_set_alignment_hook (bfd * abfd ATTRIBUTE_UNUSED, in coff_set_alignment_hook()
1663 if (coff_section_data (abfd, section) == NULL) in coff_set_alignment_hook()
1666 section->used_by_bfd = bfd_zalloc (abfd, amt); in coff_set_alignment_hook()
1672 if (pei_section_data (abfd, section) == NULL) in coff_set_alignment_hook()
1675 coff_section_data (abfd, section)->tdata = bfd_zalloc (abfd, amt); in coff_set_alignment_hook()
1676 if (coff_section_data (abfd, section)->tdata == NULL) in coff_set_alignment_hook()
1680 pei_section_data (abfd, section)->virt_size = hdr->s_paddr; in coff_set_alignment_hook()
1681 pei_section_data (abfd, section)->pe_flags = hdr->s_flags; in coff_set_alignment_hook()
1690 file_ptr oldpos = bfd_tell (abfd); in coff_set_alignment_hook()
1691 bfd_size_type relsz = bfd_coff_relsz (abfd); in coff_set_alignment_hook()
1693 bfd_seek (abfd, (file_ptr) hdr->s_relptr, 0); in coff_set_alignment_hook()
1694 if (bfd_bread (& dst, relsz, abfd) != relsz) in coff_set_alignment_hook()
1697 coff_swap_reloc_in (abfd, &dst, &n); in coff_set_alignment_hook()
1698 bfd_seek (abfd, oldpos, 0); in coff_set_alignment_hook()
1705 bfd_get_filename (abfd)); in coff_set_alignment_hook()
1718 coff_set_alignment_hook (bfd *abfd, asection *section, void * scnhdr) in coff_set_alignment_hook() argument
1726 real_sec = coff_section_from_bfd_index (abfd, (int) hdr->s_nreloc); in coff_set_alignment_hook()
1733 if (!bfd_section_removed_from_list (abfd, section)) in coff_set_alignment_hook()
1735 bfd_section_list_remove (abfd, section); in coff_set_alignment_hook()
1736 --abfd->section_count; in coff_set_alignment_hook()
1752 coff_mkobject (bfd * abfd) in coff_mkobject() argument
1757 abfd->tdata.coff_obj_data = bfd_zalloc (abfd, amt); in coff_mkobject()
1758 if (abfd->tdata.coff_obj_data == NULL) in coff_mkobject()
1760 coff = coff_data (abfd); in coff_mkobject()
1777 coff_mkobject_hook (bfd * abfd, in coff_mkobject_hook() argument
1784 if (! coff_mkobject (abfd)) in coff_mkobject_hook()
1787 coff = coff_data (abfd); in coff_mkobject_hook()
1798 coff->local_symesz = bfd_coff_symesz (abfd); in coff_mkobject_hook()
1799 coff->local_auxesz = bfd_coff_auxesz (abfd); in coff_mkobject_hook()
1800 coff->local_linesz = bfd_coff_linesz (abfd); in coff_mkobject_hook()
1804 obj_raw_syment_count (abfd) = in coff_mkobject_hook()
1805 obj_conv_table_size (abfd) = in coff_mkobject_hook()
1810 abfd->flags |= DYNAMIC; in coff_mkobject_hook()
1811 if (aouthdr != NULL && internal_f->f_opthdr >= bfd_coff_aoutsz (abfd)) in coff_mkobject_hook()
1817 xcoff = xcoff_data (abfd); in coff_mkobject_hook()
1827 bfd_xcoff_text_align_power (abfd) = internal_a->o_algntext; in coff_mkobject_hook()
1828 bfd_xcoff_data_align_power (abfd) = internal_a->o_algndata; in coff_mkobject_hook()
1838 if (! _bfd_coff_arm_set_private_flags (abfd, internal_f->f_flags)) in coff_mkobject_hook()
1846 abfd->flags |= HAS_DEBUG; in coff_mkobject_hook()
1861 coff_set_arch_mach_hook (bfd *abfd, void * filehdr) in coff_set_arch_mach_hook() argument
1906 machine = bfd_arm_get_mach_from_notes (abfd, ARM_NOTE_SECTION); in coff_set_arch_mach_hook()
2055 if (xcoff_data (abfd)->cputype != -1) in coff_set_arch_mach_hook()
2056 cputype = xcoff_data (abfd)->cputype & 0xff; in coff_set_arch_mach_hook()
2063 if (obj_raw_syment_count (abfd) == 0) in coff_set_arch_mach_hook()
2069 bfd_size_type amt = bfd_coff_symesz (abfd); in coff_set_arch_mach_hook()
2072 if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0 in coff_set_arch_mach_hook()
2073 || bfd_bread (buf, amt, abfd) != amt) in coff_set_arch_mach_hook()
2078 bfd_coff_swap_sym_in (abfd, buf, & sym); in coff_set_arch_mach_hook()
2092 arch = bfd_xcoff_architecture (abfd); in coff_set_arch_mach_hook()
2093 machine = bfd_xcoff_machine (abfd); in coff_set_arch_mach_hook()
2128 abfd->flags |= BFD_IS_RELAXABLE; in coff_set_arch_mach_hook()
2137 abfd->flags |= BFD_IS_RELAXABLE; in coff_set_arch_mach_hook()
2146 abfd->flags |= BFD_IS_RELAXABLE; in coff_set_arch_mach_hook()
2155 abfd->flags |= BFD_IS_RELAXABLE; in coff_set_arch_mach_hook()
2164 abfd->flags |= BFD_IS_RELAXABLE; in coff_set_arch_mach_hook()
2261 bfd_default_set_arch_mach (abfd, arch, machine); in coff_set_arch_mach_hook()
2268 symname_in_debug_hook (bfd * abfd ATTRIBUTE_UNUSED, struct internal_syment *sym) in symname_in_debug_hook()
2289 coff_pointerize_aux_hook (bfd *abfd ATTRIBUTE_UNUSED, in coff_pointerize_aux_hook()
2323 coff_pointerize_aux_hook (bfd *abfd ATTRIBUTE_UNUSED, in coff_pointerize_aux_hook()
2347 coff_print_aux (bfd *abfd ATTRIBUTE_UNUSED, in coff_print_aux()
2436 coff_write_relocs (bfd * abfd, int first_undef) in coff_write_relocs() argument
2440 for (s = abfd->sections; s != NULL; s = s->next) in coff_write_relocs()
2463 if (bfd_seek (abfd, s->rel_filepos, SEEK_SET) != 0) in coff_write_relocs()
2467 if (obj_pe (abfd) && s->reloc_count >= 0xffff) in coff_write_relocs()
2475 coff_swap_reloc_out (abfd, &n, &dst); in coff_write_relocs()
2476 if (bfd_bwrite (& dst, (bfd_size_type) bfd_coff_relsz (abfd), in coff_write_relocs()
2477 abfd) != bfd_coff_relsz (abfd)) in coff_write_relocs()
2499 if (q->sym_ptr_ptr[0]->the_bfd != abfd) in coff_write_relocs()
2503 asymbol **outsyms = abfd->outsymbols; in coff_write_relocs()
2543 if (n.r_symndx > obj_conv_table_size (abfd)) in coff_write_relocs()
2547 abfd, n.r_symndx); in coff_write_relocs()
2563 coff_swap_reloc_out (abfd, &n, &dst); in coff_write_relocs()
2565 if (bfd_bwrite (& dst, (bfd_size_type) bfd_coff_relsz (abfd), in coff_write_relocs()
2566 abfd) != bfd_coff_relsz (abfd)) in coff_write_relocs()
2583 coff_set_flags (bfd * abfd, in coff_set_flags() argument
2587 switch (bfd_get_arch (abfd)) in coff_set_flags()
2592 switch (bfd_get_mach (abfd)) in coff_set_flags()
2599 *flagsp = bfd_get_mach (abfd) << 12; in coff_set_flags()
2611 switch (bfd_get_mach (abfd)) in coff_set_flags()
2628 switch (bfd_get_mach (abfd)) in coff_set_flags()
2655 if (!abfd->xvec ) in coff_set_flags()
2660 switch (abfd->xvec->name[4]) in coff_set_flags()
2675 TICOFF_TARGET_MACHINE_SET (flagsp, bfd_get_mach (abfd)); in coff_set_flags()
2693 if (APCS_SET (abfd)) in coff_set_flags()
2695 if (APCS_26_FLAG (abfd)) in coff_set_flags()
2698 if (APCS_FLOAT_FLAG (abfd)) in coff_set_flags()
2701 if (PIC_FLAG (abfd)) in coff_set_flags()
2704 if (INTERWORK_SET (abfd) && INTERWORK_FLAG (abfd)) in coff_set_flags()
2706 switch (bfd_get_mach (abfd)) in coff_set_flags()
2784 switch (bfd_get_mach (abfd)) in coff_set_flags()
2801 if (bfd_big_endian (abfd)) in coff_set_flags()
2843 BFD_ASSERT (bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); in coff_set_flags()
2844 *magicp = bfd_xcoff_magic_number (abfd); in coff_set_flags()
2862 if (bfd_big_endian (abfd)) in coff_set_flags()
2872 switch (bfd_get_mach (abfd)) in coff_set_flags()
2890 coff_set_arch_mach (bfd * abfd, in coff_set_arch_mach() argument
2897 if (! bfd_default_set_arch_mach (abfd, arch, machine)) in coff_set_arch_mach()
2901 && ! coff_set_flags (abfd, &dummy1, &dummy2)) in coff_set_arch_mach()
2938 coff_compute_section_file_positions (bfd * abfd) in coff_compute_section_file_positions() argument
2942 file_ptr sofar = bfd_coff_filhsz (abfd); in coff_compute_section_file_positions()
2950 if (bfd_get_symcount (abfd) > 0) in coff_compute_section_file_positions()
2957 symcount = bfd_get_symcount (abfd); in coff_compute_section_file_positions()
2958 for (symp = abfd->outsymbols, i = 0; i < symcount; symp++, i++) in coff_compute_section_file_positions()
2962 cf = coff_symbol_from (abfd, *symp); in coff_compute_section_file_positions()
2970 if (len > SYMNMLEN || bfd_coff_force_symnames_in_strings (abfd)) in coff_compute_section_file_positions()
2971 sz += len + 1 + bfd_coff_debug_string_prefix_length (abfd); in coff_compute_section_file_positions()
2978 dsec = bfd_make_section_old_way (abfd, DOT_DEBUG); in coff_compute_section_file_positions()
2990 if (coff_data (abfd)->link_info) in coff_compute_section_file_positions()
2992 page_size = pe_data (abfd)->pe_opthdr.FileAlignment; in coff_compute_section_file_positions()
3007 if (bfd_get_start_address (abfd)) in coff_compute_section_file_positions()
3010 abfd->flags |= EXEC_P; in coff_compute_section_file_positions()
3012 if (abfd->flags & EXEC_P) in coff_compute_section_file_positions()
3013 sofar += bfd_coff_aoutsz (abfd); in coff_compute_section_file_positions()
3015 else if (xcoff_data (abfd)->full_aouthdr) in coff_compute_section_file_positions()
3016 sofar += bfd_coff_aoutsz (abfd); in coff_compute_section_file_positions()
3021 sofar += abfd->section_count * bfd_coff_scnhsz (abfd); in coff_compute_section_file_positions()
3026 for (current = abfd->sections; current != NULL; current = current->next) in coff_compute_section_file_positions()
3028 sofar += bfd_coff_scnhsz (abfd); in coff_compute_section_file_positions()
3046 for (current = abfd->sections; current != NULL; current = current->next) in coff_compute_section_file_positions()
3056 for (current = abfd->sections; current != NULL; current = current->next) in coff_compute_section_file_positions()
3068 abfd->sections = NULL; in coff_compute_section_file_positions()
3069 abfd->section_last = NULL; in coff_compute_section_file_positions()
3073 bfd_section_list_append (abfd, current); in coff_compute_section_file_positions()
3101 for (current = abfd->sections; current != NULL; current = current->next) in coff_compute_section_file_positions()
3107 for (current = abfd->sections; in coff_compute_section_file_positions()
3114 if (coff_section_data (abfd, current) == NULL) in coff_compute_section_file_positions()
3118 current->used_by_bfd = bfd_zalloc (abfd, amt); in coff_compute_section_file_positions()
3122 if (pei_section_data (abfd, current) == NULL) in coff_compute_section_file_positions()
3126 coff_section_data (abfd, current)->tdata = bfd_zalloc (abfd, amt); in coff_compute_section_file_positions()
3127 if (coff_section_data (abfd, current)->tdata == NULL) in coff_compute_section_file_positions()
3130 if (pei_section_data (abfd, current)->virt_size == 0) in coff_compute_section_file_positions()
3131 pei_section_data (abfd, current)->virt_size = current->size; in coff_compute_section_file_positions()
3149 if ((abfd->flags & EXEC_P) != 0) in coff_compute_section_file_positions()
3196 if ((abfd->flags & D_PAGED) != 0 in coff_compute_section_file_positions()
3211 if ((abfd->flags & EXEC_P) == 0) in coff_compute_section_file_positions()
3234 if (pei_section_data (abfd, current)->virt_size < current->size) in coff_compute_section_file_positions()
3243 (void) bfd_set_section_vma (abfd, current, 0); in coff_compute_section_file_positions()
3259 if (bfd_seek (abfd, sofar - 1, SEEK_SET) != 0 in coff_compute_section_file_positions()
3260 || bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1) in coff_compute_section_file_positions()
3269 obj_relocbase (abfd) = sofar; in coff_compute_section_file_positions()
3270 abfd->output_has_begun = TRUE; in coff_compute_section_file_positions()
3281 coff_read_word (bfd *abfd, unsigned int *value) in coff_read_word() argument
3286 status = bfd_bread (b, (bfd_size_type) 2, abfd); in coff_read_word()
3304 coff_compute_checksum (bfd *abfd) in coff_compute_checksum() argument
3317 if (bfd_seek (abfd, filepos, SEEK_SET) != 0) in coff_compute_checksum()
3320 more_data = coff_read_word (abfd, &value); in coff_compute_checksum()
3331 coff_apply_checksum (bfd *abfd) in coff_apply_checksum() argument
3336 if (bfd_seek (abfd, 0x3c, SEEK_SET) != 0) in coff_apply_checksum()
3339 if (!coff_read_word (abfd, &peheader)) in coff_apply_checksum()
3342 if (bfd_seek (abfd, peheader + 0x58, SEEK_SET) != 0) in coff_apply_checksum()
3346 bfd_bwrite (&checksum, (bfd_size_type) 4, abfd); in coff_apply_checksum()
3348 if (bfd_seek (abfd, peheader, SEEK_SET) != 0) in coff_apply_checksum()
3351 computed = coff_compute_checksum (abfd); in coff_apply_checksum()
3355 if (bfd_seek (abfd, peheader + 0x58, SEEK_SET) != 0) in coff_apply_checksum()
3358 bfd_bwrite (&checksum, (bfd_size_type) 4, abfd); in coff_apply_checksum()
3366 coff_write_object_contents (bfd * abfd) in coff_write_object_contents() argument
3392 lnno_size = coff_count_linenumbers (abfd) * bfd_coff_linesz (abfd); in coff_write_object_contents()
3394 if (! abfd->output_has_begun) in coff_write_object_contents()
3396 if (! coff_compute_section_file_positions (abfd)) in coff_write_object_contents()
3400 reloc_base = obj_relocbase (abfd); in coff_write_object_contents()
3404 for (current = abfd->sections; current != NULL; current = in coff_write_object_contents()
3409 if (obj_pe (abfd) && current->reloc_count >= 0xffff) in coff_write_object_contents()
3415 reloc_size = reloc_count * bfd_coff_relsz (abfd); in coff_write_object_contents()
3421 for (current = abfd->sections; current != NULL; current = in coff_write_object_contents()
3428 lineno_base += current->lineno_count * bfd_coff_linesz (abfd); in coff_write_object_contents()
3436 reloc_base += current->reloc_count * bfd_coff_relsz (abfd); in coff_write_object_contents()
3439 if (obj_pe (abfd) && current->reloc_count >= 0xffff) in coff_write_object_contents()
3440 reloc_base += bfd_coff_relsz (abfd); in coff_write_object_contents()
3450 if ((abfd->flags & EXEC_P) != 0) in coff_write_object_contents()
3451 scn_base = bfd_coff_filhsz (abfd) + bfd_coff_aoutsz (abfd); in coff_write_object_contents()
3454 scn_base = bfd_coff_filhsz (abfd); in coff_write_object_contents()
3457 if (xcoff_data (abfd)->full_aouthdr) in coff_write_object_contents()
3458 scn_base += bfd_coff_aoutsz (abfd); in coff_write_object_contents()
3465 if (bfd_seek (abfd, scn_base, SEEK_SET) != 0) in coff_write_object_contents()
3469 for (current = abfd->sections; in coff_write_object_contents()
3481 pe_data (abfd)->has_reloc_section = 1; in coff_write_object_contents()
3525 if (coff_section_data (abfd, current) != NULL in coff_write_object_contents()
3526 && pei_section_data (abfd, current) != NULL) in coff_write_object_contents()
3527 section.s_paddr = pei_section_data (abfd, current)->virt_size; in coff_write_object_contents()
3600 bfd_size_type amt = bfd_coff_scnhsz (abfd); in coff_write_object_contents()
3602 if (coff_swap_scnhdr_out (abfd, §ion, &buff) == 0 in coff_write_object_contents()
3603 || bfd_bwrite (& buff, amt, abfd) != amt) in coff_write_object_contents()
3619 count = bfd_get_symcount (abfd); in coff_write_object_contents()
3620 for (i = 0, psym = abfd->outsymbols; i < count; i++, psym++) in coff_write_object_contents()
3633 csym = coff_symbol_from (abfd, *psym); in coff_write_object_contents()
3706 for (current = abfd->sections; current != NULL; current = current->next) in coff_write_object_contents()
3725 amt = bfd_coff_scnhsz (abfd); in coff_write_object_contents()
3726 if (coff_swap_scnhdr_out (abfd, &scnhdr, &buff) == 0 in coff_write_object_contents()
3727 || bfd_bwrite (& buff, amt, abfd) != amt) in coff_write_object_contents()
3745 if (abfd->flags & EXEC_P) in coff_write_object_contents()
3746 internal_f.f_opthdr = bfd_coff_aoutsz (abfd); in coff_write_object_contents()
3752 if (xcoff_data (abfd)->full_aouthdr) in coff_write_object_contents()
3753 internal_f.f_opthdr = bfd_coff_aoutsz (abfd); in coff_write_object_contents()
3764 if (abfd->flags & EXEC_P) in coff_write_object_contents()
3769 if (pe_data (abfd)->real_flags & IMAGE_FILE_LARGE_ADDRESS_AWARE) in coff_write_object_contents()
3777 if (bfd_little_endian (abfd)) in coff_write_object_contents()
3797 if ((abfd->flags & DYNAMIC) != 0) in coff_write_object_contents()
3799 if (bfd_get_section_by_name (abfd, _LOADER) != NULL) in coff_write_object_contents()
3810 coff_set_flags (abfd, &magic, &flags); in coff_write_object_contents()
3848 internal_a.magic = (abfd->flags & D_PAGED ? PAGEMAGICPEXECPAGED : in coff_write_object_contents()
3849 abfd->flags & WP_TEXT ? PAGEMAGICPEXECSWAPPED : in coff_write_object_contents()
3899 internal_a.magic = (abfd->flags & D_PAGED) ? RS6K_AOUTHDR_ZMAGIC : in coff_write_object_contents()
3900 (abfd->flags & WP_TEXT) ? RS6K_AOUTHDR_NMAGIC : in coff_write_object_contents()
3935 obj_sym_filepos (abfd) = sym_base; in coff_write_object_contents()
3937 if (bfd_get_symcount (abfd) != 0) in coff_write_object_contents()
3941 if (!coff_renumber_symbols (abfd, &firstundef)) in coff_write_object_contents()
3943 coff_mangle_symbols (abfd); in coff_write_object_contents()
3944 if (! coff_write_symbols (abfd)) in coff_write_object_contents()
3946 if (! coff_write_linenumbers (abfd)) in coff_write_object_contents()
3948 if (! coff_write_relocs (abfd, firstundef)) in coff_write_object_contents()
3952 else if (long_section_names && ! obj_coff_strings_written (abfd)) in coff_write_object_contents()
3956 if (! coff_write_symbols (abfd)) in coff_write_object_contents()
3962 else if ((abfd->flags & EXEC_P) != 0) in coff_write_object_contents()
3969 if (bfd_seek (abfd, in coff_write_object_contents()
3972 || bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1) in coff_write_object_contents()
3981 if (obj_raw_syment_count (abfd) != 0) in coff_write_object_contents()
4016 internal_a.entry = bfd_get_start_address (abfd); in coff_write_object_contents()
4017 internal_f.f_nsyms = obj_raw_syment_count (abfd); in coff_write_object_contents()
4020 if (xcoff_data (abfd)->full_aouthdr) in coff_write_object_contents()
4027 internal_a.o_snentry = xcoff_data (abfd)->snentry; in coff_write_object_contents()
4034 internal_a.o_algntext = bfd_get_section_alignment (abfd, text_sec); in coff_write_object_contents()
4044 internal_a.o_algndata = bfd_get_section_alignment (abfd, data_sec); in coff_write_object_contents()
4051 loader_sec = bfd_get_section_by_name (abfd, ".loader"); in coff_write_object_contents()
4061 toc = xcoff_data (abfd)->toc; in coff_write_object_contents()
4063 internal_a.o_sntoc = xcoff_data (abfd)->sntoc; in coff_write_object_contents()
4065 internal_a.o_modtype = xcoff_data (abfd)->modtype; in coff_write_object_contents()
4066 if (xcoff_data (abfd)->cputype != -1) in coff_write_object_contents()
4067 internal_a.o_cputype = xcoff_data (abfd)->cputype; in coff_write_object_contents()
4070 switch (bfd_get_arch (abfd)) in coff_write_object_contents()
4076 if (bfd_get_mach (abfd) == bfd_mach_ppc) in coff_write_object_contents()
4085 internal_a.o_maxstack = xcoff_data (abfd)->maxstack; in coff_write_object_contents()
4086 internal_a.o_maxdata = xcoff_data (abfd)->maxdata; in coff_write_object_contents()
4091 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) in coff_write_object_contents()
4096 bfd_size_type amount = bfd_coff_filhsz (abfd); in coff_write_object_contents()
4102 bfd_coff_swap_filehdr_out (abfd, & internal_f, buff); in coff_write_object_contents()
4103 amount = bfd_bwrite (buff, amount, abfd); in coff_write_object_contents()
4107 if (amount != bfd_coff_filhsz (abfd)) in coff_write_object_contents()
4111 if (abfd->flags & EXEC_P) in coff_write_object_contents()
4116 bfd_size_type amount = bfd_coff_aoutsz (abfd); in coff_write_object_contents()
4122 coff_swap_aouthdr_out (abfd, & internal_a, buff); in coff_write_object_contents()
4123 amount = bfd_bwrite (buff, amount, abfd); in coff_write_object_contents()
4127 if (amount != bfd_coff_aoutsz (abfd)) in coff_write_object_contents()
4131 if (! coff_apply_checksum (abfd)) in coff_write_object_contents()
4142 coff_swap_aouthdr_out (abfd, & internal_a, & buff); in coff_write_object_contents()
4143 if (xcoff_data (abfd)->full_aouthdr) in coff_write_object_contents()
4144 size = bfd_coff_aoutsz (abfd); in coff_write_object_contents()
4147 if (bfd_bwrite (& buff, (bfd_size_type) size, abfd) != size) in coff_write_object_contents()
4156 coff_set_section_contents (bfd * abfd, in coff_set_section_contents() argument
4162 if (! abfd->output_has_begun) /* Set by bfd.c handler. */ in coff_set_section_contents()
4164 if (! coff_compute_section_file_positions (abfd)) in coff_set_section_contents()
4198 rec += bfd_get_32 (abfd, rec) * 4; in coff_set_section_contents()
4210 if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0) in coff_set_section_contents()
4216 return bfd_bwrite (location, count, abfd) == count; in coff_set_section_contents()
4220 buy_and_read (bfd *abfd, file_ptr where, bfd_size_type size) in buy_and_read() argument
4222 void * area = bfd_alloc (abfd, size); in buy_and_read()
4226 if (bfd_seek (abfd, where, SEEK_SET) != 0 in buy_and_read()
4227 || bfd_bread (area, size, abfd) != size) in buy_and_read()
4256 coff_slurp_line_table (bfd *abfd, asection *asect) in coff_slurp_line_table() argument
4264 amt = (bfd_size_type) bfd_coff_linesz (abfd) * asect->lineno_count; in coff_slurp_line_table()
4265 native_lineno = (LINENO *) buy_and_read (abfd, asect->line_filepos, amt); in coff_slurp_line_table()
4269 (_("%B: warning: line number table read failed"), abfd); in coff_slurp_line_table()
4273 lineno_cache = bfd_alloc (abfd, amt); in coff_slurp_line_table()
4286 bfd_coff_swap_lineno_in (abfd, src, &dst); in coff_slurp_line_table()
4298 || (bfd_vma) symndx >= obj_raw_syment_count (abfd)) in coff_slurp_line_table()
4302 abfd, dst.l_addr.l_symndx); in coff_slurp_line_table()
4309 ((symndx + obj_raw_syments (abfd)) in coff_slurp_line_table()
4316 abfd, bfd_asymbol_name (&sym->symbol)); in coff_slurp_line_table()
4322 - bfd_section_vma (abfd, asect); in coff_slurp_line_table()
4341 coff_slurp_symbol_table (bfd * abfd) in coff_slurp_symbol_table() argument
4349 if (obj_symbols (abfd)) in coff_slurp_symbol_table()
4353 if ((native_symbols = coff_get_normalized_symtab (abfd)) == NULL) in coff_slurp_symbol_table()
4357 amt = obj_raw_syment_count (abfd); in coff_slurp_symbol_table()
4359 cached_area = bfd_alloc (abfd, amt); in coff_slurp_symbol_table()
4363 amt = obj_raw_syment_count (abfd); in coff_slurp_symbol_table()
4365 table_ptr = bfd_alloc (abfd, amt); in coff_slurp_symbol_table()
4372 unsigned int last_native_index = obj_raw_syment_count (abfd); in coff_slurp_symbol_table()
4379 dst->symbol.the_bfd = abfd; in coff_slurp_symbol_table()
4384 dst->symbol.section = coff_section_from_bfd_index (abfd, in coff_slurp_symbol_table()
4414 switch (coff_classify_symbol (abfd, &src->u.syment)) in coff_slurp_symbol_table()
4568 for (sec = abfd->sections; sec != NULL; sec = sec->next) in coff_slurp_symbol_table()
4571 + sec->lineno_count * bfd_coff_linesz (abfd)) in coff_slurp_symbol_table()
4581 / bfd_coff_linesz (abfd)); in coff_slurp_symbol_table()
4656 abfd, src->u.syment.n_sclass, in coff_slurp_symbol_table()
4673 obj_symbols (abfd) = cached_area; in coff_slurp_symbol_table()
4674 obj_raw_syments (abfd) = native_symbols; in coff_slurp_symbol_table()
4676 bfd_get_symcount (abfd) = number_of_symbols; in coff_slurp_symbol_table()
4677 obj_convert (abfd) = table_ptr; in coff_slurp_symbol_table()
4682 p = abfd->sections; in coff_slurp_symbol_table()
4685 coff_slurp_line_table (abfd, p); in coff_slurp_symbol_table()
4698 coff_classify_symbol (bfd *abfd, in coff_classify_symbol() argument
4751 sec = coff_section_from_bfd_index (abfd, syment->n_scnum); in coff_classify_symbol()
4753 && (strcmp (bfd_get_section_name (abfd, sec), in coff_classify_symbol()
4754 _bfd_coff_internal_syment_name (abfd, syment, buf)) in coff_classify_symbol()
4782 abfd, _bfd_coff_internal_syment_name (abfd, syment, buf)); in coff_classify_symbol()
4816 #define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) \ argument
4820 if (ptr && bfd_asymbol_bfd (ptr) != abfd) \
4821 coffsym = (obj_symbols (abfd) \
4824 coffsym = coff_symbol_from (abfd, ptr); \
4828 else if (ptr && bfd_asymbol_bfd (ptr) == abfd \
4837 coff_slurp_reloc_table (bfd * abfd, sec_ptr asect, asymbol ** symbols) in coff_slurp_reloc_table() argument
4851 if (!coff_slurp_symbol_table (abfd)) in coff_slurp_reloc_table()
4854 amt = (bfd_size_type) bfd_coff_relsz (abfd) * asect->reloc_count; in coff_slurp_reloc_table()
4855 native_relocs = (RELOC *) buy_and_read (abfd, asect->rel_filepos, amt); in coff_slurp_reloc_table()
4857 reloc_cache = bfd_alloc (abfd, amt); in coff_slurp_reloc_table()
4874 coff_swap_reloc_in (abfd, src, &dst); in coff_slurp_reloc_table()
4877 RELOC_PROCESSING (cache_ptr, &dst, symbols, abfd, asect); in coff_slurp_reloc_table()
4883 if (dst.r_symndx < 0 || dst.r_symndx >= obj_conv_table_size (abfd)) in coff_slurp_reloc_table()
4887 abfd, dst.r_symndx); in coff_slurp_reloc_table()
4894 + obj_convert (abfd)[dst.r_symndx]); in coff_slurp_reloc_table()
4912 CALC_ADDEND (abfd, ptr, dst, cache_ptr); in coff_slurp_reloc_table()
4925 abfd, dst.r_type, (long) dst.r_vaddr); in coff_slurp_reloc_table()
4945 coff_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, in coff_rtype_to_howto()
4969 coff_canonicalize_reloc (bfd * abfd, in coff_canonicalize_reloc() argument
4992 if (! coff_slurp_reloc_table (abfd, section, symbols)) in coff_canonicalize_reloc()
5008 dummy_reloc16_estimate (bfd *abfd ATTRIBUTE_UNUSED, in dummy_reloc16_estimate()
5027 dummy_reloc16_extra_cases (bfd *abfd ATTRIBUTE_UNUSED, in dummy_reloc16_extra_cases()
5089 coff_link_output_has_begun (bfd * abfd, in coff_link_output_has_begun() argument
5092 return abfd->output_has_begun; in coff_link_output_has_begun()
5099 coff_final_link_postscript (bfd * abfd ATTRIBUTE_UNUSED, in coff_final_link_postscript()