Lines Matching refs:abfd
89 bfd * abfd; member
126 coff_swap_reloc_in (bfd * abfd, void * src, void * dst) in coff_swap_reloc_in() argument
131 reloc_dst->r_vaddr = H_GET_32 (abfd, reloc_src->r_vaddr); in coff_swap_reloc_in()
132 reloc_dst->r_symndx = H_GET_S32 (abfd, reloc_src->r_symndx); in coff_swap_reloc_in()
133 reloc_dst->r_type = H_GET_16 (abfd, reloc_src->r_type); in coff_swap_reloc_in()
135 reloc_dst->r_offset = SWAP_IN_RELOC_OFFSET (abfd, reloc_src->r_offset); in coff_swap_reloc_in()
140 coff_swap_reloc_out (bfd * abfd, void * src, void * dst) in coff_swap_reloc_out() argument
145 H_PUT_32 (abfd, reloc_src->r_vaddr, reloc_dst->r_vaddr); in coff_swap_reloc_out()
146 H_PUT_32 (abfd, reloc_src->r_symndx, reloc_dst->r_symndx); in coff_swap_reloc_out()
147 H_PUT_16 (abfd, reloc_src->r_type, reloc_dst->r_type); in coff_swap_reloc_out()
150 SWAP_OUT_RELOC_OFFSET (abfd, reloc_src->r_offset, reloc_dst->r_offset); in coff_swap_reloc_out()
153 SWAP_OUT_RELOC_EXTRA (abfd, reloc_src, reloc_dst); in coff_swap_reloc_out()
160 coff_swap_filehdr_in (bfd * abfd, void * src, void * dst) in coff_swap_filehdr_in() argument
165 filehdr_dst->f_magic = H_GET_16 (abfd, filehdr_src->f_magic); in coff_swap_filehdr_in()
166 filehdr_dst->f_nscns = H_GET_16 (abfd, filehdr_src->f_nscns); in coff_swap_filehdr_in()
167 filehdr_dst->f_timdat = H_GET_32 (abfd, filehdr_src->f_timdat); in coff_swap_filehdr_in()
168 filehdr_dst->f_nsyms = H_GET_32 (abfd, filehdr_src->f_nsyms); in coff_swap_filehdr_in()
169 filehdr_dst->f_flags = H_GET_16 (abfd, filehdr_src->f_flags); in coff_swap_filehdr_in()
170 filehdr_dst->f_symptr = H_GET_32 (abfd, filehdr_src->f_symptr); in coff_swap_filehdr_in()
180 filehdr_dst->f_opthdr = H_GET_16 (abfd, filehdr_src-> f_opthdr); in coff_swap_filehdr_in()
194 coff_swap_scnhdr_in (bfd * abfd, void * ext, void * in) in coff_swap_scnhdr_in() argument
201 scnhdr_int->s_vaddr = GET_SCNHDR_VADDR (abfd, scnhdr_ext->s_vaddr); in coff_swap_scnhdr_in()
202 scnhdr_int->s_paddr = GET_SCNHDR_PADDR (abfd, scnhdr_ext->s_paddr); in coff_swap_scnhdr_in()
203 scnhdr_int->s_size = GET_SCNHDR_SIZE (abfd, scnhdr_ext->s_size); in coff_swap_scnhdr_in()
204 scnhdr_int->s_scnptr = GET_SCNHDR_SCNPTR (abfd, scnhdr_ext->s_scnptr); in coff_swap_scnhdr_in()
205 scnhdr_int->s_relptr = GET_SCNHDR_RELPTR (abfd, scnhdr_ext->s_relptr); in coff_swap_scnhdr_in()
206 scnhdr_int->s_lnnoptr = GET_SCNHDR_LNNOPTR (abfd, scnhdr_ext->s_lnnoptr); in coff_swap_scnhdr_in()
207 scnhdr_int->s_flags = H_GET_32 (abfd, scnhdr_ext->s_flags); in coff_swap_scnhdr_in()
213 scnhdr_int->s_nlnno = (H_GET_16 (abfd, scnhdr_ext->s_nlnno) in coff_swap_scnhdr_in()
214 + (H_GET_16 (abfd, scnhdr_ext->s_nreloc) << 16)); in coff_swap_scnhdr_in()
217 scnhdr_int->s_nreloc = H_GET_16 (abfd, scnhdr_ext->s_nreloc); in coff_swap_scnhdr_in()
218 scnhdr_int->s_nlnno = H_GET_16 (abfd, scnhdr_ext->s_nlnno); in coff_swap_scnhdr_in()
223 scnhdr_int->s_vaddr += pe_data (abfd)->pe_opthdr.ImageBase; in coff_swap_scnhdr_in()
237 && (! bfd_pe_executable_p (abfd) || scnhdr_int->s_size == 0)) in coff_swap_scnhdr_in()
238 || (bfd_pe_executable_p (abfd) && scnhdr_int->s_size > scnhdr_int->s_paddr))) in coff_swap_scnhdr_in()
248 pe_mkobject (bfd * abfd) in pe_mkobject() argument
253 abfd->tdata.pe_obj_data = (struct pe_tdata *) bfd_zalloc (abfd, amt); in pe_mkobject()
255 if (abfd->tdata.pe_obj_data == 0) in pe_mkobject()
258 pe = pe_data (abfd); in pe_mkobject()
278 pe_mkobject_hook (bfd * abfd, in pe_mkobject_hook() argument
285 if (! pe_mkobject (abfd)) in pe_mkobject_hook()
288 pe = pe_data (abfd); in pe_mkobject_hook()
303 obj_raw_syment_count (abfd) = in pe_mkobject_hook()
304 obj_conv_table_size (abfd) = in pe_mkobject_hook()
313 abfd->flags |= HAS_DEBUG; in pe_mkobject_hook()
321 if (! _bfd_coff_arm_set_private_flags (abfd, internal_f->f_flags)) in pe_mkobject_hook()
322 coff_data (abfd) ->flags = 0; in pe_mkobject_hook()
329 pe_print_private_bfd_data (bfd *abfd, void * vfile) in pe_print_private_bfd_data() argument
333 if (!_bfd_XX_print_private_bfd_data_common (abfd, vfile)) in pe_print_private_bfd_data()
341 return pe_saved_coff_bfd_print_private_bfd_data (abfd, vfile); in pe_print_private_bfd_data()
464 entry->howto = bfd_reloc_type_lookup (vars->abfd, reloc); in pe_ILF_make_a_symbol_reloc()
485 coff_section_data (vars->abfd, sec)->i); in pe_ILF_make_a_reloc()
495 if (coff_section_data (vars->abfd, sec) == NULL) in pe_ILF_save_relocs()
499 coff_section_data (vars->abfd, sec)->relocs = vars->int_reltab; in pe_ILF_save_relocs()
500 coff_section_data (vars->abfd, sec)->keep_relocs = TRUE; in pe_ILF_save_relocs()
557 H_PUT_32 (vars->abfd, vars->string_ptr - vars->string_table, in pe_ILF_make_a_symbol()
559 H_PUT_16 (vars->abfd, section->target_index, esym->e_scnum); in pe_ILF_make_a_symbol()
570 sym->symbol.the_bfd = vars->abfd; in pe_ILF_make_a_symbol()
602 sec = bfd_make_section_old_way (vars->abfd, name); in pe_ILF_make_a_section()
608 bfd_set_section_flags (vars->abfd, sec, flags | extra_flags); in pe_ILF_make_a_section()
610 (void) bfd_set_section_alignment (vars->abfd, sec, 2); in pe_ILF_make_a_section()
617 bfd_set_section_size (vars->abfd, sec, (bfd_size_type) size); in pe_ILF_make_a_section()
641 coff_section_data (vars->abfd, sec)->i = vars->sym_index - 1; in pe_ILF_make_a_section()
729 pe_ILF_build_a_bfd (bfd * abfd, in pe_ILF_build_a_bfd() argument
758 abfd, import_type); in pe_ILF_build_a_bfd()
763 abfd, import_type); in pe_ILF_build_a_bfd()
777 abfd, import_name_type); in pe_ILF_build_a_bfd()
788 ptr = bfd_zalloc (abfd, (bfd_size_type) ILF_DATA_SIZE); in pe_ILF_build_a_bfd()
836 vars.abfd = abfd; in pe_ILF_build_a_bfd()
991 if ( ! bfd_set_start_address (abfd, (bfd_vma) 0) in pe_ILF_build_a_bfd()
992 || ! bfd_coff_set_arch_mach_hook (abfd, & internal_f)) in pe_ILF_build_a_bfd()
995 if (bfd_coff_mkobject_hook (abfd, (void *) & internal_f, NULL) == NULL) in pe_ILF_build_a_bfd()
998 coff_data (abfd)->pe = 1; in pe_ILF_build_a_bfd()
1002 coff_data (abfd)->flags |= F_INTERWORK | F_INTERWORK_SET; in pe_ILF_build_a_bfd()
1006 bfd_cache_close (abfd); in pe_ILF_build_a_bfd()
1008 abfd->iostream = (void *) vars.bim; in pe_ILF_build_a_bfd()
1009 abfd->flags |= BFD_IN_MEMORY /* | HAS_LOCALS */; in pe_ILF_build_a_bfd()
1010 abfd->where = 0; in pe_ILF_build_a_bfd()
1011 obj_sym_filepos (abfd) = 0; in pe_ILF_build_a_bfd()
1040 obj_symbols (abfd) = vars.sym_cache; in pe_ILF_build_a_bfd()
1041 bfd_get_symcount (abfd) = vars.sym_index; in pe_ILF_build_a_bfd()
1043 obj_raw_syments (abfd) = vars.native_syms; in pe_ILF_build_a_bfd()
1044 obj_raw_syment_count (abfd) = vars.sym_index; in pe_ILF_build_a_bfd()
1046 obj_coff_external_syms (abfd) = (void *) vars.esym_table; in pe_ILF_build_a_bfd()
1047 obj_coff_keep_syms (abfd) = TRUE; in pe_ILF_build_a_bfd()
1049 obj_convert (abfd) = vars.sym_table; in pe_ILF_build_a_bfd()
1050 obj_conv_table_size (abfd) = vars.sym_index; in pe_ILF_build_a_bfd()
1052 obj_coff_strings (abfd) = vars.string_table; in pe_ILF_build_a_bfd()
1053 obj_coff_keep_strings (abfd) = TRUE; in pe_ILF_build_a_bfd()
1055 abfd->flags |= HAS_SYMS; in pe_ILF_build_a_bfd()
1064 pe_ILF_object_p (bfd * abfd) in pe_ILF_object_p() argument
1078 if (bfd_bread (buffer, (bfd_size_type) 16, abfd) != 16) in pe_ILF_object_p()
1087 machine = H_GET_16 (abfd, ptr); in pe_ILF_object_p()
1149 if (abfd->xvec == & TARGET_LITTLE_SYM) in pe_ILF_object_p()
1161 abfd, machine); in pe_ILF_object_p()
1173 abfd, machine); in pe_ILF_object_p()
1183 size = H_GET_32 (abfd, ptr); in pe_ILF_object_p()
1189 (_("%B: size field is zero in Import Library Format header"), abfd); in pe_ILF_object_p()
1195 ordinal = H_GET_16 (abfd, ptr); in pe_ILF_object_p()
1198 types = H_GET_16 (abfd, ptr); in pe_ILF_object_p()
1202 ptr = bfd_alloc (abfd, size); in pe_ILF_object_p()
1206 if (bfd_bread (ptr, size, abfd) != size) in pe_ILF_object_p()
1208 bfd_release (abfd, ptr); in pe_ILF_object_p()
1220 (_("%B: string not null terminated in ILF object file."), abfd); in pe_ILF_object_p()
1222 bfd_release (abfd, ptr); in pe_ILF_object_p()
1227 if (! pe_ILF_build_a_bfd (abfd, magic, symbol_name, in pe_ILF_object_p()
1230 bfd_release (abfd, ptr); in pe_ILF_object_p()
1234 return abfd->xvec; in pe_ILF_object_p()
1257 pe_bfd_object_p (bfd * abfd) in pe_bfd_object_p() argument
1266 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 in pe_bfd_object_p()
1267 || bfd_bread (buffer, (bfd_size_type) 4, abfd) != 4) in pe_bfd_object_p()
1274 if (H_GET_32 (abfd, buffer) == 0xffff0000) in pe_bfd_object_p()
1275 return pe_ILF_object_p (abfd); in pe_bfd_object_p()
1277 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 in pe_bfd_object_p()
1278 || bfd_bread (&dos_hdr, (bfd_size_type) sizeof (dos_hdr), abfd) in pe_bfd_object_p()
1296 if (H_GET_16 (abfd, dos_hdr.e_magic) != DOSMAGIC) in pe_bfd_object_p()
1302 offset = H_GET_32 (abfd, dos_hdr.e_lfanew); in pe_bfd_object_p()
1303 if (bfd_seek (abfd, offset, SEEK_SET) != 0 in pe_bfd_object_p()
1304 || (bfd_bread (&image_hdr, (bfd_size_type) sizeof (image_hdr), abfd) in pe_bfd_object_p()
1312 if (H_GET_32 (abfd, image_hdr.nt_signature) != 0x4550) in pe_bfd_object_p()
1321 if (bfd_seek (abfd, (file_ptr) (offset - sizeof (dos_hdr)), SEEK_SET) != 0) in pe_bfd_object_p()
1328 target = coff_object_p (abfd); in pe_bfd_object_p()
1331 pe_data_type *pe = pe_data (abfd); in pe_bfd_object_p()
1338 if (bfd_target_efi_p (abfd->xvec)) in pe_bfd_object_p()
1339 arch = pe_arch (bfd_target_efi_arch (abfd->xvec)); in pe_bfd_object_p()
1341 arch = pe_arch (bfd_target_pei_arch (abfd->xvec)); in pe_bfd_object_p()