Lines Matching refs:mdata

47   bfd_mach_o_data_struct *mdata = NULL;  in bfd_mach_o_version()  local
50 mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_version()
52 return mdata->header.version; in bfd_mach_o_version()
541 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_append_command() local
543 if (mdata->last_command != NULL) in bfd_mach_o_append_command()
544 mdata->last_command->next = cmd; in bfd_mach_o_append_command()
546 mdata->first_command = cmd; in bfd_mach_o_append_command()
547 mdata->last_command = cmd; in bfd_mach_o_append_command()
695 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_bfd_print_private_bfd_data() local
699 fprintf (file, _(" magic: %#lx\n"), (long) mdata->header.magic); in bfd_mach_o_bfd_print_private_bfd_data()
700 fprintf (file, _(" cputype: %#lx (%s)\n"), (long) mdata->header.cputype, in bfd_mach_o_bfd_print_private_bfd_data()
701 cputype (mdata->header.cputype)); in bfd_mach_o_bfd_print_private_bfd_data()
702 fprintf (file, _(" cpusubtype: %#lx%s\n"), (long) mdata->header.cpusubtype, in bfd_mach_o_bfd_print_private_bfd_data()
703 cpusubtype (mdata->header.cputype, mdata->header.cpusubtype, buff)); in bfd_mach_o_bfd_print_private_bfd_data()
704 fprintf (file, _(" filetype: %#lx\n"), (long) mdata->header.filetype); in bfd_mach_o_bfd_print_private_bfd_data()
705 fprintf (file, _(" ncmds: %#lx\n"), (long) mdata->header.ncmds); in bfd_mach_o_bfd_print_private_bfd_data()
706 fprintf (file, _(" sizeocmds: %#lx\n"), (long) mdata->header.sizeofcmds); in bfd_mach_o_bfd_print_private_bfd_data()
707 fprintf (file, _(" flags: %#lx\n"), (long) mdata->header.flags); in bfd_mach_o_bfd_print_private_bfd_data()
708 fprintf (file, _(" version: %x\n"), mdata->header.version); in bfd_mach_o_bfd_print_private_bfd_data()
862 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_bfd_set_private_flags() local
864 if (!mdata) in bfd_mach_o_bfd_set_private_flags()
867 mdata->header.flags = flags; in bfd_mach_o_bfd_set_private_flags()
876 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_count_symbols() local
878 if (mdata->symtab == NULL) in bfd_mach_o_count_symbols()
880 return mdata->symtab->nsyms; in bfd_mach_o_count_symbols()
894 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_canonicalize_symtab() local
896 bfd_mach_o_symtab_command *sym = mdata->symtab; in bfd_mach_o_canonicalize_symtab()
936 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_get_synthetic_symtab() local
937 bfd_mach_o_dysymtab_command *dysymtab = mdata->dysymtab; in bfd_mach_o_get_synthetic_symtab()
938 bfd_mach_o_symtab_command *symtab = mdata->symtab; in bfd_mach_o_get_synthetic_symtab()
981 for (i = 0; i < mdata->nsects; i++) in bfd_mach_o_get_synthetic_symtab()
983 bfd_mach_o_section *sec = mdata->sections[i]; in bfd_mach_o_get_synthetic_symtab()
1469 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_canonicalize_non_scattered_reloc() local
1502 if (num > mdata->nsects) in bfd_mach_o_canonicalize_non_scattered_reloc()
1510 sym = mdata->sections[num - 1]->bfdsection->symbol_ptr_ptr; in bfd_mach_o_canonicalize_non_scattered_reloc()
1516 res->addend = -mdata->sections[num - 1]->addr; in bfd_mach_o_canonicalize_non_scattered_reloc()
1544 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_pre_canonicalize_one_reloc() local
1567 for (j = 0; j < mdata->nsects; j++) in bfd_mach_o_pre_canonicalize_one_reloc()
1569 bfd_mach_o_section *sect = mdata->sections[j]; in bfd_mach_o_pre_canonicalize_one_reloc()
1691 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_get_dynamic_reloc_upper_bound() local
1693 if (mdata->dysymtab == NULL) in bfd_mach_o_get_dynamic_reloc_upper_bound()
1695 return (mdata->dysymtab->nextrel + mdata->dysymtab->nlocrel + 1) in bfd_mach_o_get_dynamic_reloc_upper_bound()
1703 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_canonicalize_dynamic_reloc() local
1704 bfd_mach_o_dysymtab_command *dysymtab = mdata->dysymtab; in bfd_mach_o_canonicalize_dynamic_reloc()
1718 if (mdata->dyn_reloc_cache == NULL) in bfd_mach_o_canonicalize_dynamic_reloc()
1762 mdata->dyn_reloc_cache = res; in bfd_mach_o_canonicalize_dynamic_reloc()
1765 res = mdata->dyn_reloc_cache; in bfd_mach_o_canonicalize_dynamic_reloc()
1985 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_write_symtab_content() local
2052 sym->stroff = mdata->filelen; in bfd_mach_o_write_symtab_content()
2053 mdata->filelen += sym->strsize; in bfd_mach_o_write_symtab_content()
2065 mdata->filelen += padlen; in bfd_mach_o_write_symtab_content()
2101 bfd_mach_o_count_indirect_symbols (bfd *abfd, bfd_mach_o_data_struct *mdata) in bfd_mach_o_count_indirect_symbols() argument
2106 for (i = 0; i < mdata->nsects; ++i) in bfd_mach_o_count_indirect_symbols()
2108 bfd_mach_o_section *sec = mdata->sections[i]; in bfd_mach_o_count_indirect_symbols()
2129 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_build_dysymtab() local
2180 cmd->nindirectsyms = bfd_mach_o_count_indirect_symbols (abfd, mdata); in bfd_mach_o_build_dysymtab()
2187 mdata->filelen = FILE_ALIGN (mdata->filelen, 2); in bfd_mach_o_build_dysymtab()
2188 cmd->indirectsymoff = mdata->filelen; in bfd_mach_o_build_dysymtab()
2191 mdata->filelen += amt; in bfd_mach_o_build_dysymtab()
2198 for (i = 0; i < mdata->nsects; ++i) in bfd_mach_o_build_dysymtab()
2200 bfd_mach_o_section *sec = mdata->sections[i]; in bfd_mach_o_build_dysymtab()
2568 bfd_mach_o_mangle_sections (bfd *abfd, bfd_mach_o_data_struct *mdata) in bfd_mach_o_mangle_sections() argument
2579 if (mdata->nsects == nsect in bfd_mach_o_mangle_sections()
2580 && (mdata->nsects == 0 || mdata->sections != NULL)) in bfd_mach_o_mangle_sections()
2591 mdata->nsects = nsect; in bfd_mach_o_mangle_sections()
2592 amt = mdata->nsects * sizeof (bfd_mach_o_section *); in bfd_mach_o_mangle_sections()
2593 mdata->sections = bfd_alloc (abfd, amt); in bfd_mach_o_mangle_sections()
2594 if (mdata->sections == NULL) in bfd_mach_o_mangle_sections()
2606 mdata->sections[target_index] = msect; in bfd_mach_o_mangle_sections()
2625 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_write_contents() local
2637 if (!bfd_mach_o_write_header (abfd, &mdata->header)) in bfd_mach_o_write_contents()
2641 for (cmd = mdata->first_command; cmd != NULL; cmd = cmd->next) in bfd_mach_o_write_contents()
2659 di->rebase_off = di->rebase_size != 0 ? mdata->filelen : 0; in bfd_mach_o_write_contents()
2660 mdata->filelen += di->rebase_size; in bfd_mach_o_write_contents()
2661 di->bind_off = di->bind_size != 0 ? mdata->filelen : 0; in bfd_mach_o_write_contents()
2662 mdata->filelen += di->bind_size; in bfd_mach_o_write_contents()
2663 di->weak_bind_off = di->weak_bind_size != 0 ? mdata->filelen : 0; in bfd_mach_o_write_contents()
2664 mdata->filelen += di->weak_bind_size; in bfd_mach_o_write_contents()
2665 di->lazy_bind_off = di->lazy_bind_size != 0 ? mdata->filelen : 0; in bfd_mach_o_write_contents()
2666 mdata->filelen += di->lazy_bind_size; in bfd_mach_o_write_contents()
2667 di->export_off = di->export_size != 0 ? mdata->filelen : 0; in bfd_mach_o_write_contents()
2668 mdata->filelen += di->export_size; in bfd_mach_o_write_contents()
2696 mdata->filelen = FILE_ALIGN (mdata->filelen, wide ? 3 : 2); in bfd_mach_o_write_contents()
2697 symtab->symoff = mdata->filelen; in bfd_mach_o_write_contents()
2700 mdata->filelen += symtab->nsyms * symlen; in bfd_mach_o_write_contents()
2718 linkedit->vmsize = mdata->filelen - linkedit->fileoff; in bfd_mach_o_write_contents()
2720 linkedit->filesize = mdata->filelen - linkedit->fileoff; in bfd_mach_o_write_contents()
2728 for (cmd = mdata->first_command; cmd != NULL; cmd = cmd->next) in bfd_mach_o_write_contents()
2829 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_build_obj_seg_command() local
2833 seg->fileoff = mdata->filelen; in bfd_mach_o_build_obj_seg_command()
2844 for (i = 0; i < mdata->nsects; ++i) in bfd_mach_o_build_obj_seg_command()
2846 bfd_mach_o_section *s = mdata->sections[i]; in bfd_mach_o_build_obj_seg_command()
2872 mdata->filelen = FILE_ALIGN (mdata->filelen, s->align); in bfd_mach_o_build_obj_seg_command()
2878 s->offset = mdata->filelen; in bfd_mach_o_build_obj_seg_command()
2882 mdata->filelen += s->size; in bfd_mach_o_build_obj_seg_command()
2896 for (i = 0; i < mdata->nsects; ++i) in bfd_mach_o_build_obj_seg_command()
2898 bfd_mach_o_section *s = mdata->sections[i]; in bfd_mach_o_build_obj_seg_command()
2912 mdata->filelen = FILE_ALIGN (mdata->filelen, 2); in bfd_mach_o_build_obj_seg_command()
2914 for (i = 0; i < mdata->nsects; ++i) in bfd_mach_o_build_obj_seg_command()
2916 bfd_mach_o_section *ms = mdata->sections[i]; in bfd_mach_o_build_obj_seg_command()
2926 sec->rel_filepos = mdata->filelen; in bfd_mach_o_build_obj_seg_command()
2928 mdata->filelen += sec->reloc_count * BFD_MACH_O_RELENT_SIZE; in bfd_mach_o_build_obj_seg_command()
2937 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_build_exec_seg_command() local
2945 seg->fileoff = mdata->filelen; in bfd_mach_o_build_exec_seg_command()
2953 for (i = 0; i < mdata->nsects; ++i) in bfd_mach_o_build_exec_seg_command()
2955 s = mdata->sections[i]; in bfd_mach_o_build_exec_seg_command()
2979 if ((mdata->filelen & pagemask) > (vma & pagemask)) in bfd_mach_o_build_exec_seg_command()
2980 mdata->filelen += pagemask + 1; in bfd_mach_o_build_exec_seg_command()
2981 seg->fileoff = mdata->filelen & ~pagemask; in bfd_mach_o_build_exec_seg_command()
2982 mdata->filelen = seg->fileoff + (vma & pagemask); in bfd_mach_o_build_exec_seg_command()
3001 mdata->filelen = FILE_ALIGN (mdata->filelen, s->align); in bfd_mach_o_build_exec_seg_command()
3003 s->offset = mdata->filelen; in bfd_mach_o_build_exec_seg_command()
3007 mdata->filelen += s->size; in bfd_mach_o_build_exec_seg_command()
3039 mdata->filelen = (mdata->filelen + pagemask) & ~pagemask; in bfd_mach_o_build_exec_seg_command()
3048 bfd_mach_o_layout_commands (bfd_mach_o_data_struct *mdata) in bfd_mach_o_layout_commands() argument
3050 unsigned wide = mach_o_wide_p (&mdata->header); in bfd_mach_o_layout_commands()
3060 mdata->header.ncmds = 0; in bfd_mach_o_layout_commands()
3062 for (cmd = mdata->first_command; cmd; cmd = cmd->next) in bfd_mach_o_layout_commands()
3064 mdata->header.ncmds++; in bfd_mach_o_layout_commands()
3118 mdata->header.sizeofcmds = offset - hdrlen; in bfd_mach_o_layout_commands()
3119 mdata->filelen = offset; in bfd_mach_o_layout_commands()
3128 bfd_mach_o_init_segment (bfd_mach_o_data_struct *mdata, in bfd_mach_o_init_segment() argument
3133 unsigned wide = mach_o_wide_p (&mdata->header); in bfd_mach_o_init_segment()
3161 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_build_commands() local
3162 unsigned wide = mach_o_wide_p (&mdata->header); in bfd_mach_o_build_commands()
3172 if (mdata->header.ncmds != 0) in bfd_mach_o_build_commands()
3176 if (mdata->header.filetype == 0) in bfd_mach_o_build_commands()
3179 mdata->header.filetype = BFD_MACH_O_MH_EXECUTE; in bfd_mach_o_build_commands()
3181 mdata->header.filetype = BFD_MACH_O_MH_DYLIB; in bfd_mach_o_build_commands()
3183 mdata->header.filetype = BFD_MACH_O_MH_OBJECT; in bfd_mach_o_build_commands()
3189 if (mdata->nsects == 0 || mdata->sections == NULL) in bfd_mach_o_build_commands()
3190 if (! bfd_mach_o_mangle_sections (abfd, mdata)) in bfd_mach_o_build_commands()
3199 if (mdata->header.filetype == BFD_MACH_O_MH_OBJECT) in bfd_mach_o_build_commands()
3203 nbr_segcmd = (mdata->nsects > 0) ? 1 : 0; in bfd_mach_o_build_commands()
3214 for (i = 0; i < mdata->nsects; i++) in bfd_mach_o_build_commands()
3216 bfd_mach_o_section *this_sect = mdata->sections[i]; in bfd_mach_o_build_commands()
3244 if (mdata->header.filetype == BFD_MACH_O_MH_EXECUTE in bfd_mach_o_build_commands()
3249 mdata->filelen = wide ? BFD_MACH_O_HEADER_64_SIZE : BFD_MACH_O_HEADER_SIZE; in bfd_mach_o_build_commands()
3256 return bfd_mach_o_layout_commands (mdata); in bfd_mach_o_build_commands()
3265 commands[nbr_commands - 1].next = mdata->first_command; in bfd_mach_o_build_commands()
3266 if (mdata->first_command == NULL) in bfd_mach_o_build_commands()
3267 mdata->last_command = &commands[nbr_commands - 1]; in bfd_mach_o_build_commands()
3268 mdata->first_command = &commands[0]; in bfd_mach_o_build_commands()
3270 if (mdata->header.filetype == BFD_MACH_O_MH_OBJECT && nbr_segcmd != 0) in bfd_mach_o_build_commands()
3273 bfd_mach_o_init_segment (mdata, &commands[0], "", mdata->nsects); in bfd_mach_o_build_commands()
3283 bfd_mach_o_init_segment (mdata, cmd, "__PAGEZERO", 0); in bfd_mach_o_build_commands()
3287 for (i = 0; i < mdata->nsects;) in bfd_mach_o_build_commands()
3289 const char *segname = mdata->sections[i]->segname; in bfd_mach_o_build_commands()
3293 for (i++; i < mdata->nsects; i++) in bfd_mach_o_build_commands()
3294 if (strcmp (mdata->sections[i]->segname, segname) == 0) in bfd_mach_o_build_commands()
3299 bfd_mach_o_init_segment (mdata, cmd, segname, nbr_sect); in bfd_mach_o_build_commands()
3304 bfd_mach_o_init_segment (mdata, cmd, "__LINKEDIT", 0); in bfd_mach_o_build_commands()
3339 if (! bfd_mach_o_layout_commands (mdata)) in bfd_mach_o_build_commands()
3344 if (mdata->header.filetype == BFD_MACH_O_MH_OBJECT) in bfd_mach_o_build_commands()
3373 commands[nbr_segcmd - 1].command.segment.fileoff = mdata->filelen; in bfd_mach_o_build_commands()
3718 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_read_symtab_symbol() local
3719 unsigned int wide = mach_o_wide_p (&mdata->header); in bfd_mach_o_read_symtab_symbol()
3787 if ((section > 0) && (section <= mdata->nsects)) in bfd_mach_o_read_symtab_symbol()
3789 s->symbol.section = mdata->sections[section - 1]->bfdsection; in bfd_mach_o_read_symtab_symbol()
3791 s->symbol.value - mdata->sections[section - 1]->addr; in bfd_mach_o_read_symtab_symbol()
3827 if ((section > 0) && (section <= mdata->nsects)) in bfd_mach_o_read_symtab_symbol()
3829 s->symbol.section = mdata->sections[section - 1]->bfdsection; in bfd_mach_o_read_symtab_symbol()
3831 s->symbol.value - mdata->sections[section - 1]->addr; in bfd_mach_o_read_symtab_symbol()
3843 s->symbol.name, section, mdata->nsects); in bfd_mach_o_read_symtab_symbol()
3873 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_read_symtab_strtab() local
3874 bfd_mach_o_symtab_command *sym = mdata->symtab; in bfd_mach_o_read_symtab_strtab()
3919 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_read_symtab_symbols() local
3920 bfd_mach_o_symtab_command *sym = mdata->symtab; in bfd_mach_o_read_symtab_symbols()
3932 unsigned int wide = mach_o_wide_p (&mdata->header); in bfd_mach_o_read_symtab_symbols()
4040 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_read_dylib() local
4075 pos = mdata->hdr_offset + cmd->name_offset; in bfd_mach_o_read_dylib()
4177 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_read_thread() local
4244 switch (mdata->header.cputype) in bfd_mach_o_read_thread()
4293 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_read_dysymtab() local
4509 if (mdata->dysymtab) in bfd_mach_o_read_dysymtab()
4511 mdata->dysymtab = cmd; in bfd_mach_o_read_dysymtab()
4521 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_read_symtab() local
4550 if (mdata->symtab) in bfd_mach_o_read_symtab()
4552 mdata->symtab = symtab; in bfd_mach_o_read_symtab()
4907 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_read_command() local
4912 if (bfd_seek (abfd, mdata->hdr_offset + command->offset, SEEK_SET) != 0 in bfd_mach_o_read_command()
5059 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_flatten_sections() local
5065 mdata->nsects = 0; in bfd_mach_o_flatten_sections()
5067 for (cmd = mdata->first_command; cmd != NULL; cmd = cmd->next) in bfd_mach_o_flatten_sections()
5074 mdata->nsects += seg->nsects; in bfd_mach_o_flatten_sections()
5079 if (_bfd_mul_overflow (mdata->nsects, sizeof (bfd_mach_o_section *), &amt)) in bfd_mach_o_flatten_sections()
5084 mdata->sections = bfd_alloc (abfd, amt); in bfd_mach_o_flatten_sections()
5085 if (mdata->sections == NULL && mdata->nsects != 0) in bfd_mach_o_flatten_sections()
5091 for (cmd = mdata->first_command; cmd != NULL; cmd = cmd->next) in bfd_mach_o_flatten_sections()
5099 BFD_ASSERT (csect + seg->nsects <= mdata->nsects); in bfd_mach_o_flatten_sections()
5102 mdata->sections[csect++] = sec; in bfd_mach_o_flatten_sections()
5111 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_scan_start_address() local
5116 for (cmd = mdata->first_command; cmd != NULL; cmd = cmd->next) in bfd_mach_o_scan_start_address()
5123 else if (cmd->type == BFD_MACH_O_LC_MAIN && mdata->nsects > 1) in bfd_mach_o_scan_start_address()
5126 bfd_mach_o_section *text_sect = mdata->sections[0]; in bfd_mach_o_scan_start_address()
5143 if ((mdata->header.cputype == BFD_MACH_O_CPU_TYPE_I386) in bfd_mach_o_scan_start_address()
5154 else if ((mdata->header.cputype == BFD_MACH_O_CPU_TYPE_POWERPC) in bfd_mach_o_scan_start_address()
5165 else if ((mdata->header.cputype == BFD_MACH_O_CPU_TYPE_POWERPC_64) in bfd_mach_o_scan_start_address()
5176 else if ((mdata->header.cputype == BFD_MACH_O_CPU_TYPE_X86_64) in bfd_mach_o_scan_start_address()
5212 bfd_mach_o_data_struct *mdata) in bfd_mach_o_scan() argument
5222 mdata->header = *header; in bfd_mach_o_scan()
5239 abfd->tdata.mach_o_data = mdata; in bfd_mach_o_scan()
5263 mdata->first_command = NULL; in bfd_mach_o_scan()
5264 mdata->last_command = NULL; in bfd_mach_o_scan()
5312 bfd_mach_o_data_struct *mdata = NULL; in bfd_mach_o_mkobject_init() local
5314 mdata = bfd_zalloc (abfd, sizeof (bfd_mach_o_data_struct)); in bfd_mach_o_mkobject_init()
5315 if (mdata == NULL) in bfd_mach_o_mkobject_init()
5317 abfd->tdata.mach_o_data = mdata; in bfd_mach_o_mkobject_init()
5319 mdata->header.magic = 0; in bfd_mach_o_mkobject_init()
5320 mdata->header.cputype = 0; in bfd_mach_o_mkobject_init()
5321 mdata->header.cpusubtype = 0; in bfd_mach_o_mkobject_init()
5322 mdata->header.filetype = 0; in bfd_mach_o_mkobject_init()
5323 mdata->header.ncmds = 0; in bfd_mach_o_mkobject_init()
5324 mdata->header.sizeofcmds = 0; in bfd_mach_o_mkobject_init()
5325 mdata->header.flags = 0; in bfd_mach_o_mkobject_init()
5326 mdata->header.byteorder = BFD_ENDIAN_UNKNOWN; in bfd_mach_o_mkobject_init()
5327 mdata->first_command = NULL; in bfd_mach_o_mkobject_init()
5328 mdata->last_command = NULL; in bfd_mach_o_mkobject_init()
5329 mdata->nsects = 0; in bfd_mach_o_mkobject_init()
5330 mdata->sections = NULL; in bfd_mach_o_mkobject_init()
5331 mdata->dyn_reloc_cache = NULL; in bfd_mach_o_mkobject_init()
5339 bfd_mach_o_data_struct *mdata; in bfd_mach_o_gen_mkobject() local
5344 mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_gen_mkobject()
5345 mdata->header.magic = BFD_MACH_O_MH_MAGIC; in bfd_mach_o_gen_mkobject()
5346 mdata->header.cputype = 0; in bfd_mach_o_gen_mkobject()
5347 mdata->header.cpusubtype = 0; in bfd_mach_o_gen_mkobject()
5348 mdata->header.byteorder = abfd->xvec->byteorder; in bfd_mach_o_gen_mkobject()
5349 mdata->header.version = 1; in bfd_mach_o_gen_mkobject()
5361 bfd_mach_o_data_struct *mdata; in bfd_mach_o_header_p() local
5417 mdata = (bfd_mach_o_data_struct *) bfd_zalloc (abfd, sizeof (*mdata)); in bfd_mach_o_header_p()
5418 if (mdata == NULL) in bfd_mach_o_header_p()
5420 mdata->hdr_offset = hdr_off; in bfd_mach_o_header_p()
5422 if (!bfd_mach_o_scan (abfd, &header, mdata)) in bfd_mach_o_header_p()
5452 bfd_mach_o_data_struct *mdata; in bfd_mach_o_get_base_address() local
5458 mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_get_base_address()
5460 for (cmd = mdata->first_command; cmd != NULL; cmd = cmd->next) in bfd_mach_o_get_base_address()
5755 struct mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_lookup_command() local
5759 BFD_ASSERT (mdata != NULL); in bfd_mach_o_lookup_command()
5763 for (cmd = mdata->first_command; cmd != NULL; cmd = cmd->next) in bfd_mach_o_lookup_command()
5877 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_core_fetch_environment() local
5878 unsigned long stackaddr = bfd_mach_o_stack_addr (mdata->header.cputype); in bfd_mach_o_core_fetch_environment()
5881 for (cmd = mdata->first_command; cmd != NULL; cmd = cmd->next) in bfd_mach_o_core_fetch_environment()
6115 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_find_nearest_line() local
6116 if (mdata == NULL) in bfd_mach_o_find_nearest_line()
6118 switch (mdata->header.filetype) in bfd_mach_o_find_nearest_line()
6126 if (mdata->dwarf2_find_line_info == NULL) in bfd_mach_o_find_nearest_line()
6128 mdata->dsym_bfd = bfd_mach_o_follow_dsym (abfd); in bfd_mach_o_find_nearest_line()
6133 if (! mdata->dsym_bfd) in bfd_mach_o_find_nearest_line()
6135 if (! _bfd_dwarf2_slurp_debug_info (abfd, mdata->dsym_bfd, in bfd_mach_o_find_nearest_line()
6137 &mdata->dwarf2_find_line_info, in bfd_mach_o_find_nearest_line()
6149 &mdata->dwarf2_find_line_info); in bfd_mach_o_find_nearest_line()
6155 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_close_and_cleanup() local
6156 if (bfd_get_format (abfd) == bfd_object && mdata != NULL) in bfd_mach_o_close_and_cleanup()
6158 _bfd_dwarf2_cleanup_debug_info (abfd, &mdata->dwarf2_find_line_info); in bfd_mach_o_close_and_cleanup()
6160 if (mdata->dsym_bfd != NULL) in bfd_mach_o_close_and_cleanup()
6162 bfd *fat_bfd = mdata->dsym_bfd->my_archive; in bfd_mach_o_close_and_cleanup()
6174 : bfd_get_filename (mdata->dsym_bfd)); in bfd_mach_o_close_and_cleanup()
6176 bfd_close (mdata->dsym_bfd); in bfd_mach_o_close_and_cleanup()
6177 mdata->dsym_bfd = NULL; in bfd_mach_o_close_and_cleanup()
6192 bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd); in bfd_mach_o_free_cached_info() local
6194 free (mdata->dyn_reloc_cache); in bfd_mach_o_free_cached_info()
6195 mdata->dyn_reloc_cache = NULL; in bfd_mach_o_free_cached_info()