Lines Matching defs:finfo

7450   struct elf_final_link_info *finfo;
7527 struct elf_final_link_info *finfo,
7556 asection *sec = finfo->sections [i];
7569 global_entry = bfd_link_hash_lookup (finfo->info->hash, name,
7638 struct elf_final_link_info *finfo,
7698 if (!resolve_section (symbuf, finfo->output_bfd->sections, result)
7699 && !resolve_symbol (symbuf, input_bfd, finfo, result,
7708 if (!resolve_symbol (symbuf, input_bfd, finfo, result,
7710 && !resolve_section (symbuf, finfo->output_bfd->sections,
7729 if (!eval_symbol (&a, symp, input_bfd, finfo, dot, \
7746 if (!eval_symbol (&a, symp, input_bfd, finfo, dot, \
7750 if (!eval_symbol (&b, symp, input_bfd, finfo, dot, \
8348 elf_link_flush_output_syms (struct elf_final_link_info *finfo,
8351 if (finfo->symbuf_count > 0)
8357 hdr = &elf_tdata (finfo->output_bfd)->symtab_hdr;
8359 amt = finfo->symbuf_count * bed->s->sizeof_sym;
8360 if (bfd_seek (finfo->output_bfd, pos, SEEK_SET) != 0
8361 || bfd_bwrite (finfo->symbuf, amt, finfo->output_bfd) != amt)
8365 finfo->symbuf_count = 0;
8374 elf_link_output_sym (struct elf_final_link_info *finfo,
8387 bed = get_elf_backend_data (finfo->output_bfd);
8391 int ret = (*output_symbol_hook) (finfo->info, name, elfsym, input_sec, h);
8402 elfsym->st_name = (unsigned long) _bfd_stringtab_add (finfo->symstrtab,
8408 if (finfo->symbuf_count >= finfo->symbuf_size)
8410 if (! elf_link_flush_output_syms (finfo, bed))
8414 dest = finfo->symbuf + finfo->symbuf_count * bed->s->sizeof_sym;
8415 destshndx = finfo->symshndxbuf;
8418 if (bfd_get_symcount (finfo->output_bfd) >= finfo->shndxbuf_size)
8422 amt = finfo->shndxbuf_size * sizeof (Elf_External_Sym_Shndx);
8427 finfo->symshndxbuf = destshndx;
8429 finfo->shndxbuf_size *= 2;
8431 destshndx += bfd_get_symcount (finfo->output_bfd);
8434 bed->s->swap_symbol_out (finfo->output_bfd, elfsym, dest, destshndx);
8435 finfo->symbuf_count += 1;
8436 bfd_get_symcount (finfo->output_bfd) += 1;
8623 struct elf_final_link_info *finfo = eoinfo->finfo;
8650 bed = get_elf_backend_data (finfo->output_bfd);
8669 && (!h->ref_regular || finfo->info->gc_sections)
8670 && ! elf_link_check_versioned_symbol (finfo->info, bed, h)
8671 && finfo->info->unresolved_syms_in_shared_libs != RM_IGNORE)
8673 if (! (finfo->info->callbacks->undefined_symbol
8674 (finfo->info, h->root.root.string,
8676 NULL, 0, finfo->info->unresolved_syms_in_shared_libs == RM_GENERATE_ERROR)))
8687 if (! finfo->info->relocatable
8688 && (! finfo->info->shared)
8693 && ! elf_link_check_versioned_symbol (finfo->info, bed, h))
8704 def_bfd = finfo->output_bfd;
8707 (*_bfd_error_handler) (msg, finfo->output_bfd, def_bfd,
8726 else if (finfo->info->strip == strip_all)
8728 else if (finfo->info->strip == strip_some
8729 && bfd_hash_lookup (finfo->info->keep_hash,
8732 else if (finfo->info->strip_discarded
8792 _bfd_elf_section_from_bfd_section (finfo->output_bfd,
8798 finfo->output_bfd, input_sec->output_section, input_sec);
8808 if (! finfo->info->relocatable)
8813 asection *tls_sec = elf_hash_table (finfo->info)->tls_sec;
8819 BFD_ASSERT (finfo->info->gc_sections
8858 && !finfo->info->relocatable)
8861 && ((finfo->info->shared
8865 && elf_hash_table (finfo->info)->dynamic_sections_created))
8868 (finfo->output_bfd, finfo->info, h, &sym)))
8911 if (! finfo->info->relocatable
8925 (*_bfd_error_handler) (msg, finfo->output_bfd, h->root.root.string);
8935 && elf_hash_table (finfo->info)->dynamic_sections_created)
8940 esym = finfo->dynsym_sec->contents + h->dynindx * bed->s->sizeof_sym;
8941 if (! check_dynsym (finfo->output_bfd, &sym))
8946 bed->s->swap_symbol_out (finfo->output_bfd, &sym, esym, 0);
8948 if (finfo->hash_sec != NULL)
8956 bucketcount = elf_hash_table (finfo->info)->bucketcount;
8960 = elf_section_data (finfo->hash_sec)->this_hdr.sh_entsize;
8961 bucketpos = ((bfd_byte *) finfo->hash_sec->contents
8963 chain = bfd_get (8 * hash_entry_size, finfo->output_bfd, bucketpos);
8964 bfd_put (8 * hash_entry_size, finfo->output_bfd, h->dynindx, bucketpos);
8965 bfd_put (8 * hash_entry_size, finfo->output_bfd, chain,
8966 ((bfd_byte *) finfo->hash_sec->contents
8970 if (finfo->symver_sec != NULL && finfo->symver_sec->contents != NULL)
8988 if (finfo->info->create_default_symver)
8995 eversym = (Elf_External_Versym *) finfo->symver_sec->contents;
8997 _bfd_elf_swap_versym_out (finfo->output_bfd, &iversym, eversym);
9006 indx = bfd_get_symcount (finfo->output_bfd);
9007 ret = elf_link_output_sym (finfo, h->root.root.string, &sym, input_sec, h);
9121 elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
9139 output_bfd = finfo->output_bfd;
9166 finfo->internal_syms,
9167 finfo->external_syms,
9168 finfo->locsym_shndx);
9177 for (isym = isymbuf, pindex = finfo->indices, ppsection = finfo->sections;
9225 if (ppsection == finfo->sections)
9238 if (finfo->info->strip == strip_all)
9246 if (finfo->info->discard == discard_all)
9264 if ((finfo->info->strip == strip_some
9265 && (bfd_hash_lookup (finfo->info->keep_hash, name, FALSE, FALSE)
9267 || (((finfo->info->discard == discard_sec_merge
9268 && (isec->flags & SEC_MERGE) && ! finfo->info->relocatable)
9269 || finfo->info->discard == discard_l)
9289 if (! finfo->info->relocatable)
9295 BFD_ASSERT (elf_hash_table (finfo->info)->tls_sec != NULL);
9296 osym.st_value -= elf_hash_table (finfo->info)->tls_sec->vma;
9301 ret = elf_link_output_sym (finfo, name, &osym, isec, NULL);
9320 if (finfo->info->relocatable
9330 && finfo->sections[symndx] == NULL))
9343 asection *sec = finfo->sections[symndx]->output_section;
9348 if (finfo->indices[symndx] == -1)
9352 asection *sec = finfo->sections[symndx]->output_section;
9371 ret = elf_link_output_sym (finfo, name, &sym, o, NULL);
9375 finfo->indices[symndx] = indx;
9380 = finfo->indices[symndx];
9403 contents = finfo->contents;
9419 = _bfd_elf_link_read_relocs (input_bfd, o, finfo->external_relocs,
9420 finfo->internal_relocs, FALSE);
9461 && finfo->sections[r_symndx] == NULL))
9499 ps = &finfo->sections[r_symndx];
9505 && !finfo->info->relocatable)
9521 if (!eval_symbol (&val, &sym_name, input_bfd, finfo, dot,
9539 (*finfo->info->callbacks->einfo)
9555 finfo->info);
9586 ret = (*relocate_section) (output_bfd, finfo->info,
9590 finfo->sections);
9595 || finfo->info->relocatable
9596 || finfo->info->emitrelocations)
9626 if (!finfo->info->relocatable)
9648 finfo->info, o,
9666 if (!finfo->info->relocatable)
9677 && finfo->sections[r_symndx] == NULL))
9710 sec = finfo->sections[r_symndx];
9750 htab = elf_hash_table (finfo->info);
9774 if (finfo->indices[r_symndx] == -1)
9781 if (finfo->info->strip == strip_all)
9805 if (! finfo->info->relocatable)
9812 BFD_ASSERT (elf_hash_table (finfo->info)
9814 sym.st_value -= (elf_hash_table (finfo->info)
9820 ret = elf_link_output_sym (finfo, name, &sym, sec,
9825 finfo->indices[r_symndx] = indx;
9830 r_symndx = finfo->indices[r_symndx];
9865 && (*bed->elf_backend_write_section) (output_bfd, finfo->info, o,
9875 &elf_hash_table (finfo->info)->stab_info,
9886 if (! _bfd_elf_write_section_eh_frame (output_bfd, finfo->info,
10248 struct elf_final_link_info finfo;
10285 finfo.info = info;
10286 finfo.output_bfd = abfd;
10287 finfo.symstrtab = _bfd_elf_stringtab_init ();
10288 if (finfo.symstrtab == NULL)
10293 finfo.dynsym_sec = NULL;
10294 finfo.hash_sec = NULL;
10295 finfo.symver_sec = NULL;
10299 finfo.dynsym_sec = bfd_get_section_by_name (dynobj, ".dynsym");
10300 finfo.hash_sec = bfd_get_section_by_name (dynobj, ".hash");
10301 BFD_ASSERT (finfo.dynsym_sec != NULL);
10302 finfo.symver_sec = bfd_get_section_by_name (dynobj, ".gnu.version");
10306 finfo.contents = NULL;
10307 finfo.external_relocs = NULL;
10308 finfo.internal_relocs = NULL;
10309 finfo.external_syms = NULL;
10310 finfo.locsym_shndx = NULL;
10311 finfo.internal_syms = NULL;
10312 finfo.indices = NULL;
10313 finfo.sections = NULL;
10314 finfo.symbuf = NULL;
10315 finfo.symshndxbuf = NULL;
10316 finfo.symbuf_count = 0;
10317 finfo.shndxbuf_size = 0;
10539 finfo.symbuf_size = 20;
10541 finfo.symbuf_size = max_sym_count;
10542 amt = finfo.symbuf_size;
10544 finfo.symbuf = (bfd_byte *) bfd_malloc (amt);
10545 if (finfo.symbuf == NULL)
10551 finfo.shndxbuf_size = amt;
10553 finfo.symshndxbuf = (Elf_External_Sym_Shndx *) bfd_zmalloc (amt);
10554 if (finfo.symshndxbuf == NULL)
10568 if (elf_link_output_sym (&finfo, NULL, &elfsym, bfd_und_section_ptr,
10594 if (elf_link_output_sym (&finfo, NULL, &elfsym, o, NULL) != 1)
10604 finfo.contents = (bfd_byte *) bfd_malloc (max_contents_size);
10605 if (finfo.contents == NULL)
10611 finfo.external_relocs = bfd_malloc (max_external_reloc_size);
10612 if (finfo.external_relocs == NULL)
10620 finfo.internal_relocs = (Elf_Internal_Rela *) bfd_malloc (amt);
10621 if (finfo.internal_relocs == NULL)
10628 finfo.external_syms = (bfd_byte *) bfd_malloc (amt);
10629 if (finfo.external_syms == NULL)
10633 finfo.internal_syms = (Elf_Internal_Sym *) bfd_malloc (amt);
10634 if (finfo.internal_syms == NULL)
10638 finfo.indices = (long int *) bfd_malloc (amt);
10639 if (finfo.indices == NULL)
10643 finfo.sections = (asection **) bfd_malloc (amt);
10644 if (finfo.sections == NULL)
10651 finfo.locsym_shndx = (Elf_External_Sym_Shndx *) bfd_malloc (amt);
10652 if (finfo.locsym_shndx == NULL)
10726 if (! elf_link_input_bfd (&finfo, sub))
10764 eoinfo.finfo = &finfo;
10780 (abfd, info, &finfo, (out_sym_func) elf_link_output_sym)))
10793 && finfo.dynsym_sec->output_section != bfd_abs_section_ptr)
10796 bfd_byte *dynsym = finfo.dynsym_sec->contents;
10867 elf_section_data (finfo.dynsym_sec->output_section)->this_hdr.sh_info =
10874 eoinfo.finfo = &finfo;
10889 (abfd, info, &finfo, (out_sym_func) elf_link_output_sym)))
10894 if (! elf_link_flush_output_syms (&finfo, bed))
10913 || (bfd_bwrite (finfo.symshndxbuf, amt, abfd) != amt))
10925 symstrtab_hdr->sh_size = _bfd_stringtab_size (finfo.symstrtab);
10938 || ! _bfd_stringtab_emit (abfd, finfo.symstrtab))
11223 if (finfo.symstrtab != NULL)
11224 _bfd_stringtab_free (finfo.symstrtab);
11225 if (finfo.contents != NULL)
11226 free (finfo.contents);
11227 if (finfo.external_relocs != NULL)
11228 free (finfo.external_relocs);
11229 if (finfo.internal_relocs != NULL)
11230 free (finfo.internal_relocs);
11231 if (finfo.external_syms != NULL)
11232 free (finfo.external_syms);
11233 if (finfo.locsym_shndx != NULL)
11234 free (finfo.locsym_shndx);
11235 if (finfo.internal_syms != NULL)
11236 free (finfo.internal_syms);
11237 if (finfo.indices != NULL)
11238 free (finfo.indices);
11239 if (finfo.sections != NULL)
11240 free (finfo.sections);
11241 if (finfo.symbuf != NULL)
11242 free (finfo.symbuf);
11243 if (finfo.symshndxbuf != NULL)
11244 free (finfo.symshndxbuf);
11269 if (finfo.symstrtab != NULL)
11270 _bfd_stringtab_free (finfo.symstrtab);
11271 if (finfo.contents != NULL)
11272 free (finfo.contents);
11273 if (finfo.external_relocs != NULL)
11274 free (finfo.external_relocs);
11275 if (finfo.internal_relocs != NULL)
11276 free (finfo.internal_relocs);
11277 if (finfo.external_syms != NULL)
11278 free (finfo.external_syms);
11279 if (finfo.locsym_shndx != NULL)
11280 free (finfo.locsym_shndx);
11281 if (finfo.internal_syms != NULL)
11282 free (finfo.internal_syms);
11283 if (finfo.indices != NULL)
11284 free (finfo.indices);
11285 if (finfo.sections != NULL)
11286 free (finfo.sections);
11287 if (finfo.symbuf != NULL)
11288 free (finfo.symbuf);
11289 if (finfo.symshndxbuf != NULL)
11290 free (finfo.symshndxbuf);