Lines Matching defs:flaginfo
570 struct coff_final_link_info flaginfo;
591 flaginfo.info = info;
592 flaginfo.output_bfd = abfd;
593 flaginfo.strtab = NULL;
594 flaginfo.section_info = NULL;
595 flaginfo.last_file_index = -1;
596 flaginfo.last_bf_index = -1;
597 flaginfo.internal_syms = NULL;
598 flaginfo.sec_ptrs = NULL;
599 flaginfo.sym_indices = NULL;
600 flaginfo.outsyms = NULL;
601 flaginfo.linenos = NULL;
602 flaginfo.contents = NULL;
603 flaginfo.external_relocs = NULL;
604 flaginfo.internal_relocs = NULL;
605 flaginfo.global_to_static = FALSE;
610 flaginfo.strtab = _bfd_stringtab_init ();
611 if (flaginfo.strtab == NULL)
614 if (! coff_debug_merge_hash_table_init (&flaginfo.debug_merge))
694 if (_bfd_stringtab_add (flaginfo.strtab, o->name, FALSE, FALSE)
711 flaginfo.section_info = (struct coff_link_section_info *) bfd_malloc (amt);
712 if (flaginfo.section_info == NULL)
716 flaginfo.section_info[i].relocs = NULL;
717 flaginfo.section_info[i].rel_hashes = NULL;
754 flaginfo.section_info[o->target_index].relocs =
758 flaginfo.section_info[o->target_index].rel_hashes =
760 if (flaginfo.section_info[o->target_index].relocs == NULL
761 || flaginfo.section_info[o->target_index].rel_hashes == NULL)
792 flaginfo.internal_syms = (struct internal_syment *) bfd_malloc (amt);
794 flaginfo.sec_ptrs = (asection **) bfd_malloc (amt);
796 flaginfo.sym_indices = (long int *) bfd_malloc (amt);
797 flaginfo.outsyms = (bfd_byte *) bfd_malloc ((max_sym_count + 1) * symesz);
799 flaginfo.linenos = (bfd_byte *) bfd_malloc (amt);
800 flaginfo.contents = (bfd_byte *) bfd_malloc (max_contents_size);
802 flaginfo.external_relocs = (bfd_byte *) bfd_malloc (amt);
806 flaginfo.internal_relocs = (struct internal_reloc *) bfd_malloc (amt);
808 if ((flaginfo.internal_syms == NULL && max_sym_count > 0)
809 || (flaginfo.sec_ptrs == NULL && max_sym_count > 0)
810 || (flaginfo.sym_indices == NULL && max_sym_count > 0)
811 || flaginfo.outsyms == NULL
812 || (flaginfo.linenos == NULL && max_lineno_count > 0)
813 || (flaginfo.contents == NULL && max_contents_size > 0)
814 || (flaginfo.external_relocs == NULL && max_reloc_count > 0)
816 && flaginfo.internal_relocs == NULL
841 if (! bfd_coff_link_output_has_begun (sub, & flaginfo))
843 if (! _bfd_coff_link_input_bfd (&flaginfo, sub))
851 if (! _bfd_coff_reloc_link_order (abfd, &flaginfo, o, p))
862 if (flaginfo.info->strip != strip_all && flaginfo.info->discard != discard_all)
889 if ((flaginfo.info->strip == strip_some
890 && (bfd_hash_lookup (flaginfo.info->keep_hash,
893 || (((flaginfo.info->discard == discard_sec_merge
895 && ! flaginfo.info->relocatable)
896 || flaginfo.info->discard == discard_l)
913 indx = _bfd_stringtab_add (flaginfo.strtab,
919 bfd_coff_swap_sym_out (abfd, &isym, flaginfo.outsyms);
925 if (flaginfo.last_file_index != -1)
927 flaginfo.last_file.n_value = obj_raw_syment_count (abfd);
928 bfd_coff_swap_sym_out (abfd, &flaginfo.last_file,
929 flaginfo.outsyms);
930 pos = obj_sym_filepos (abfd) + flaginfo.last_file_index
934 flaginfo.last_file_index = obj_raw_syment_count (abfd);
935 flaginfo.last_file = isym;
940 || bfd_bwrite (flaginfo.outsyms, symesz, abfd) != symesz))
948 if (! bfd_coff_final_link_postscript (abfd, & flaginfo))
953 coff_debug_merge_hash_table_free (&flaginfo.debug_merge);
956 if (flaginfo.internal_syms != NULL)
958 free (flaginfo.internal_syms);
959 flaginfo.internal_syms = NULL;
961 if (flaginfo.sec_ptrs != NULL)
963 free (flaginfo.sec_ptrs);
964 flaginfo.sec_ptrs = NULL;
966 if (flaginfo.sym_indices != NULL)
968 free (flaginfo.sym_indices);
969 flaginfo.sym_indices = NULL;
971 if (flaginfo.linenos != NULL)
973 free (flaginfo.linenos);
974 flaginfo.linenos = NULL;
976 if (flaginfo.contents != NULL)
978 free (flaginfo.contents);
979 flaginfo.contents = NULL;
981 if (flaginfo.external_relocs != NULL)
983 free (flaginfo.external_relocs);
984 flaginfo.external_relocs = NULL;
986 if (flaginfo.internal_relocs != NULL)
988 free (flaginfo.internal_relocs);
989 flaginfo.internal_relocs = NULL;
995 if (flaginfo.last_file_index != -1
996 && (unsigned int) flaginfo.last_file.n_value != obj_raw_syment_count (abfd))
1000 flaginfo.last_file.n_value = obj_raw_syment_count (abfd);
1001 bfd_coff_swap_sym_out (abfd, &flaginfo.last_file,
1002 flaginfo.outsyms);
1004 pos = obj_sym_filepos (abfd) + flaginfo.last_file_index * symesz;
1006 || bfd_bwrite (flaginfo.outsyms, symesz, abfd) != symesz)
1015 flaginfo.failed = FALSE;
1017 _bfd_coff_write_task_globals, &flaginfo);
1018 if (flaginfo.failed)
1023 flaginfo.failed = FALSE;
1024 bfd_hash_traverse (&info->hash->table, _bfd_coff_write_global_sym, &flaginfo);
1025 if (flaginfo.failed)
1029 if (flaginfo.outsyms != NULL)
1031 free (flaginfo.outsyms);
1032 flaginfo.outsyms = NULL;
1055 irel = flaginfo.section_info[o->target_index].relocs;
1057 rel_hash = flaginfo.section_info[o->target_index].rel_hashes;
1098 if (flaginfo.section_info != NULL)
1104 if (flaginfo.section_info[i].relocs != NULL)
1105 free (flaginfo.section_info[i].relocs);
1106 if (flaginfo.section_info[i].rel_hashes != NULL)
1107 free (flaginfo.section_info[i].rel_hashes);
1109 free (flaginfo.section_info);
1110 flaginfo.section_info = NULL;
1131 _bfd_stringtab_size (flaginfo.strtab) + STRING_SIZE_SIZE,
1141 if (! _bfd_stringtab_emit (abfd, flaginfo.strtab))
1147 _bfd_stringtab_free (flaginfo.strtab);
1157 coff_debug_merge_hash_table_free (&flaginfo.debug_merge);
1158 if (flaginfo.strtab != NULL)
1159 _bfd_stringtab_free (flaginfo.strtab);
1160 if (flaginfo.section_info != NULL)
1166 if (flaginfo.section_info[i].relocs != NULL)
1167 free (flaginfo.section_info[i].relocs);
1168 if (flaginfo.section_info[i].rel_hashes != NULL)
1169 free (flaginfo.section_info[i].rel_hashes);
1171 free (flaginfo.section_info);
1173 if (flaginfo.internal_syms != NULL)
1174 free (flaginfo.internal_syms);
1175 if (flaginfo.sec_ptrs != NULL)
1176 free (flaginfo.sec_ptrs);
1177 if (flaginfo.sym_indices != NULL)
1178 free (flaginfo.sym_indices);
1179 if (flaginfo.outsyms != NULL)
1180 free (flaginfo.outsyms);
1181 if (flaginfo.linenos != NULL)
1182 free (flaginfo.linenos);
1183 if (flaginfo.contents != NULL)
1184 free (flaginfo.contents);
1185 if (flaginfo.external_relocs != NULL)
1186 free (flaginfo.external_relocs);
1187 if (flaginfo.internal_relocs != NULL)
1188 free (flaginfo.internal_relocs);
1330 mark_relocs (struct coff_final_link_info *flaginfo, bfd *input_bfd)
1353 flaginfo->external_relocs,
1354 flaginfo->info->relocatable,
1355 (flaginfo->info->relocatable
1356 ? (flaginfo->section_info[ a->output_section->target_index ].relocs + a->output_section->reloc_count)
1357 : flaginfo->internal_relocs)
1371 flaginfo->sym_indices[ irel->r_symndx ] = -1;
1379 _bfd_coff_link_input_bfd (struct coff_final_link_info *flaginfo, bfd *input_bfd)
1405 output_bfd = flaginfo->output_bfd;
1414 if (! flaginfo->info->keep_memory)
1425 isymp = flaginfo->internal_syms;
1426 secpp = flaginfo->sec_ptrs;
1427 indexp = flaginfo->sym_indices;
1429 outsym = flaginfo->outsyms;
1432 && ! process_embedded_commands (output_bfd, flaginfo->info, input_bfd))
1438 if (( flaginfo->info->strip != strip_none
1439 || flaginfo->info->discard != discard_none)
1440 && flaginfo->info->relocatable)
1445 mark_relocs (flaginfo, input_bfd);
1485 if ((flaginfo->info->strip != strip_none
1486 || flaginfo->info->discard != discard_none)
1487 && flaginfo->info->relocatable)
1499 if (flaginfo->info->strip == strip_all && ! dont_skip_symbol)
1529 if (flaginfo->info->discard == discard_all && ! dont_skip_symbol)
1554 && flaginfo->info->strip == strip_debugger
1572 && (flaginfo->info->strip == strip_some
1573 || flaginfo->info->discard == discard_l))
1583 && ((flaginfo->info->strip == strip_some
1584 && (bfd_hash_lookup (flaginfo->info->keep_hash, name, FALSE,
1587 && flaginfo->info->discard == discard_l
1595 && (flaginfo->output_bfd->flags & BFD_TRADITIONAL_FORMAT) == 0
1622 mh = coff_debug_merge_hash_lookup (&flaginfo->debug_merge, name,
1699 (*epp)->tagndx = flaginfo->sym_indices[indx];
1778 indx = _bfd_stringtab_add (flaginfo->strtab, name, hash, copy);
1833 if (! obj_pe (flaginfo->output_bfd))
1848 if (flaginfo->last_file_index != -1
1849 && flaginfo->last_file.n_value != (bfd_vma) output_index)
1853 flaginfo->last_file.n_value = output_index;
1854 if ((bfd_size_type) flaginfo->last_file_index >= syment_base)
1858 &flaginfo->last_file,
1859 (flaginfo->outsyms
1860 + ((flaginfo->last_file_index
1872 &flaginfo->last_file, outsym);
1874 pos += flaginfo->last_file_index * osymesz;
1881 flaginfo->last_file_index = output_index;
1882 flaginfo->last_file = isym;
1888 if (flaginfo->info->task_link && IS_EXTERNAL (input_bfd, isym))
1934 isymp = flaginfo->internal_syms;
1935 indexp = flaginfo->sym_indices;
1937 outsym = flaginfo->outsyms;
2011 indx = _bfd_stringtab_add (flaginfo->strtab, filename,
2036 while ((flaginfo->sym_indices[indx] < 0
2037 || ((bfd_size_type) flaginfo->sym_indices[indx]
2044 indx = flaginfo->sym_indices[indx];
2054 symindx = flaginfo->sym_indices[indx];
2074 if (flaginfo->last_bf_index != -1)
2076 flaginfo->last_bf.x_sym.x_fcnary.x_fcn.x_endndx.l =
2079 if ((bfd_size_type) flaginfo->last_bf_index
2088 auxout = (flaginfo->outsyms
2089 + ((flaginfo->last_bf_index
2094 &flaginfo->last_bf,
2110 &flaginfo->last_bf,
2116 pos += flaginfo->last_bf_index * osymesz;
2125 flaginfo->last_bf_index = -1;
2131 flaginfo->last_bf = *auxp;
2132 flaginfo->last_bf_index = (((outsym - flaginfo->outsyms)
2157 if (flaginfo->info->strip == strip_none
2158 || flaginfo->info->strip == strip_some)
2184 || bfd_bread (flaginfo->linenos, linesz * o->lineno_count,
2189 eline = flaginfo->linenos;
2190 oeline = flaginfo->linenos;
2207 indx = flaginfo->sym_indices[iline.l_addr.l_symndx];
2233 (flaginfo->outsyms
2242 auxptr = (flaginfo->outsyms
2251 + eline - flaginfo->linenos);
2272 amt = oeline - flaginfo->linenos;
2274 || bfd_bwrite (flaginfo->linenos, amt, output_bfd) != amt)
2285 if (flaginfo->last_file_index != -1
2286 && (bfd_size_type) flaginfo->last_file_index >= syment_base)
2288 flaginfo->last_file.n_value = output_index;
2289 bfd_coff_swap_sym_out (output_bfd, &flaginfo->last_file,
2290 (flaginfo->outsyms
2291 + ((flaginfo->last_file_index - syment_base)
2296 if (outsym > flaginfo->outsyms)
2302 amt = outsym - flaginfo->outsyms;
2304 || bfd_bwrite (flaginfo->outsyms, amt, output_bfd) != amt)
2308 + (outsym - flaginfo->outsyms) / osymesz)
2349 contents = flaginfo->contents;
2363 (input_bfd, o, FALSE, flaginfo->external_relocs,
2364 flaginfo->info->relocatable,
2365 (flaginfo->info->relocatable
2366 ? (flaginfo->section_info[target_index].relocs
2368 : flaginfo->internal_relocs)));
2396 (*flaginfo->info->callbacks->einfo)
2404 if (! bfd_coff_relocate_section (output_bfd, flaginfo->info,
2408 flaginfo->internal_syms,
2409 flaginfo->sec_ptrs))
2412 if (flaginfo->info->relocatable)
2421 rel_hash = (flaginfo->section_info[target_index].rel_hashes
2438 if (! (*adjust_symndx) (output_bfd, flaginfo->info,
2468 indx = flaginfo->sym_indices[irel->r_symndx];
2481 is = flaginfo->internal_syms + irel->r_symndx;
2488 if (! ((*flaginfo->info->callbacks->unattached_reloc)
2489 (flaginfo->info, name, input_bfd, o,
2511 (output_bfd, &coff_hash_table (flaginfo->info)->stab_info,
2517 if (! flaginfo->info->keep_memory
2530 struct coff_final_link_info *flaginfo = (struct coff_final_link_info *) data;
2537 output_bfd = flaginfo->output_bfd;
2550 && (flaginfo->info->strip == strip_all
2551 || (flaginfo->info->strip == strip_some
2552 && (bfd_hash_lookup (flaginfo->info->keep_hash,
2583 if (! obj_pe (flaginfo->output_bfd))
2608 indx = _bfd_stringtab_add (flaginfo->strtab, h->root.root.string, hash,
2612 flaginfo->failed = TRUE;
2629 if (flaginfo->global_to_static)
2640 if (! flaginfo->info->shared
2641 && ! flaginfo->info->relocatable
2642 && IS_WEAK_EXTERNAL (flaginfo->output_bfd, isym))
2647 bfd_coff_swap_sym_out (output_bfd, &isym, flaginfo->outsyms);
2654 || bfd_bwrite (flaginfo->outsyms, symesz, output_bfd) != symesz)
2656 flaginfo->failed = TRUE;
2694 || flaginfo->info->relocatable))
2703 || flaginfo->info->relocatable))
2720 flaginfo->outsyms);
2721 if (bfd_bwrite (flaginfo->outsyms, symesz, output_bfd) != symesz)
2723 flaginfo->failed = TRUE;
2739 struct coff_final_link_info *flaginfo = (struct coff_final_link_info *) data;
2752 save_global_to_static = flaginfo->global_to_static;
2753 flaginfo->global_to_static = TRUE;
2755 flaginfo->global_to_static = save_global_to_static;
2768 struct coff_final_link_info *flaginfo,
2807 if (! ((*flaginfo->info->callbacks->reloc_overflow)
2808 (flaginfo->info, NULL,
2831 irel = (flaginfo->section_info[output_section->target_index].relocs
2833 rel_hash_ptr = (flaginfo->section_info[output_section->target_index].rel_hashes
2856 bfd_wrapped_link_hash_lookup (output_bfd, flaginfo->info,
2874 if (! ((*flaginfo->info->callbacks->unattached_reloc)
2875 (flaginfo->info, link_order->u.reloc.p->u.name, (bfd *) NULL,