Lines Matching refs:finfo

5539   struct elf_final_link_info *finfo;
5802 elf_link_flush_output_syms (struct elf_final_link_info *finfo,
5805 if (finfo->symbuf_count > 0)
5811 hdr = &elf_tdata (finfo->output_bfd)->symtab_hdr;
5813 amt = finfo->symbuf_count * bed->s->sizeof_sym;
5814 if (bfd_seek (finfo->output_bfd, pos, SEEK_SET) != 0
5815 || bfd_bwrite (finfo->symbuf, amt, finfo->output_bfd) != amt)
5819 finfo->symbuf_count = 0;
5828 elf_link_output_sym (struct elf_final_link_info *finfo,
5841 bed = get_elf_backend_data (finfo->output_bfd);
5845 if (! (*output_symbol_hook) (finfo->info, name, elfsym, input_sec, h))
5855 elfsym->st_name = (unsigned long) _bfd_stringtab_add (finfo->symstrtab,
5861 if (finfo->symbuf_count >= finfo->symbuf_size)
5863 if (! elf_link_flush_output_syms (finfo, bed))
5867 dest = finfo->symbuf + finfo->symbuf_count * bed->s->sizeof_sym;
5868 destshndx = finfo->symshndxbuf;
5871 if (bfd_get_symcount (finfo->output_bfd) >= finfo->shndxbuf_size)
5875 amt = finfo->shndxbuf_size * sizeof (Elf_External_Sym_Shndx);
5876 finfo->symshndxbuf = destshndx = bfd_realloc (destshndx, amt * 2);
5880 finfo->shndxbuf_size *= 2;
5882 destshndx += bfd_get_symcount (finfo->output_bfd);
5885 bed->s->swap_symbol_out (finfo->output_bfd, elfsym, dest, destshndx);
5886 finfo->symbuf_count += 1;
5887 bfd_get_symcount (finfo->output_bfd) += 1;
6051 struct elf_final_link_info *finfo = eoinfo->finfo;
6076 bed = get_elf_backend_data (finfo->output_bfd);
6085 && ! elf_link_check_versioned_symbol (finfo->info, bed, h)
6086 && finfo->info->unresolved_syms_in_shared_libs != RM_IGNORE)
6088 if (! ((*finfo->info->callbacks->undefined_symbol)
6089 (finfo->info, h->root.root.string, h->root.u.undef.abfd,
6090 NULL, 0, finfo->info->unresolved_syms_in_shared_libs == RM_GENERATE_ERROR)))
6099 if (! finfo->info->relocatable
6100 && (! finfo->info->shared)
6105 && ! elf_link_check_versioned_symbol (finfo->info, bed, h))
6109 finfo->output_bfd, h->root.u.def.section->owner,
6130 else if (finfo->info->strip == strip_all)
6132 else if (finfo->info->strip == strip_some
6133 && bfd_hash_lookup (finfo->info->keep_hash,
6136 else if (finfo->info->strip_discarded
6183 _bfd_elf_section_from_bfd_section (finfo->output_bfd,
6189 finfo->output_bfd, input_sec->output_section, input_sec);
6198 if (! finfo->info->relocatable)
6205 BFD_ASSERT (elf_hash_table (finfo->info)->tls_sec != NULL);
6206 sym.st_value -= elf_hash_table (finfo->info)->tls_sec->vma;
6242 && ((finfo->info->shared
6246 && elf_hash_table (finfo->info)->dynamic_sections_created)
6249 (finfo->output_bfd, finfo->info, h, &sym)))
6278 if (! finfo->info->relocatable
6286 finfo->output_bfd,
6300 && elf_hash_table (finfo->info)->dynamic_sections_created)
6310 esym = finfo->dynsym_sec->contents + h->dynindx * bed->s->sizeof_sym;
6311 bed->s->swap_symbol_out (finfo->output_bfd, &sym, esym, 0);
6313 bucketcount = elf_hash_table (finfo->info)->bucketcount;
6316 = elf_section_data (finfo->hash_sec)->this_hdr.sh_entsize;
6317 bucketpos = ((bfd_byte *) finfo->hash_sec->contents
6319 chain = bfd_get (8 * hash_entry_size, finfo->output_bfd, bucketpos);
6320 bfd_put (8 * hash_entry_size, finfo->output_bfd, h->dynindx, bucketpos);
6321 bfd_put (8 * hash_entry_size, finfo->output_bfd, chain,
6322 ((bfd_byte *) finfo->hash_sec->contents
6325 if (finfo->symver_sec != NULL && finfo->symver_sec->contents != NULL)
6348 eversym = (Elf_External_Versym *) finfo->symver_sec->contents;
6350 _bfd_elf_swap_versym_out (finfo->output_bfd, &iversym, eversym);
6359 h->indx = bfd_get_symcount (finfo->output_bfd);
6361 if (! elf_link_output_sym (finfo, h->root.root.string, &sym, input_sec, h))
6457 elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
6476 output_bfd = finfo->output_bfd;
6486 emit_relocs = (finfo->info->relocatable
6487 || finfo->info->emitrelocations
6507 finfo->internal_syms,
6508 finfo->external_syms,
6509 finfo->locsym_shndx);
6518 for (isym = isymbuf, pindex = finfo->indices, ppsection = finfo->sections;
6564 if (ppsection == finfo->sections)
6577 if (finfo->info->strip == strip_all)
6585 if (finfo->info->discard == discard_all)
6596 || (! finfo->info->relocatable
6607 if ((finfo->info->strip == strip_some
6608 && (bfd_hash_lookup (finfo->info->keep_hash, name, FALSE, FALSE)
6610 || (((finfo->info->discard == discard_sec_merge
6611 && (isec->flags & SEC_MERGE) && ! finfo->info->relocatable)
6612 || finfo->info->discard == discard_l)
6636 if (! finfo->info->relocatable)
6642 BFD_ASSERT (elf_hash_table (finfo->info)->tls_sec != NULL);
6643 osym.st_value -= elf_hash_table (finfo->info)->tls_sec->vma;
6647 if (! elf_link_output_sym (finfo, name, &osym, isec, NULL))
6684 contents = finfo->contents;
6697 = _bfd_elf_link_read_relocs (input_bfd, o, finfo->external_relocs,
6698 finfo->internal_relocs, FALSE);
6739 && finfo->sections[r_symndx] == NULL))
6756 ps = &finfo->sections[r_symndx];
6832 if (! (*relocate_section) (output_bfd, finfo->info,
6836 finfo->sections))
6864 if (!finfo->info->relocatable)
6879 finfo->info, o,
6897 if (!finfo->info->relocatable)
6908 && finfo->sections[r_symndx] == NULL))
6941 sec = finfo->sections[r_symndx];
6985 if (finfo->indices[r_symndx] == -1)
6991 if (finfo->info->strip == strip_all)
7015 if (! finfo->info->relocatable)
7022 BFD_ASSERT (elf_hash_table (finfo->info)
7024 sym.st_value -= (elf_hash_table (finfo->info)
7029 finfo->indices[r_symndx]
7032 if (! elf_link_output_sym (finfo, name, &sym, sec,
7037 r_symndx = finfo->indices[r_symndx];
7046 && !(finfo->info->relocatable
7047 || finfo->info->emitrelocations))
7080 &elf_hash_table (finfo->info)->stab_info,
7091 if (! _bfd_elf_write_section_eh_frame (output_bfd, finfo->info,
7417 struct elf_final_link_info finfo;
7452 finfo.info = info;
7453 finfo.output_bfd = abfd;
7454 finfo.symstrtab = _bfd_elf_stringtab_init ();
7455 if (finfo.symstrtab == NULL)
7460 finfo.dynsym_sec = NULL;
7461 finfo.hash_sec = NULL;
7462 finfo.symver_sec = NULL;
7466 finfo.dynsym_sec = bfd_get_section_by_name (dynobj, ".dynsym");
7467 finfo.hash_sec = bfd_get_section_by_name (dynobj, ".hash");
7468 BFD_ASSERT (finfo.dynsym_sec != NULL && finfo.hash_sec != NULL);
7469 finfo.symver_sec = bfd_get_section_by_name (dynobj, ".gnu.version");
7473 finfo.contents = NULL;
7474 finfo.external_relocs = NULL;
7475 finfo.internal_relocs = NULL;
7476 finfo.external_syms = NULL;
7477 finfo.locsym_shndx = NULL;
7478 finfo.internal_syms = NULL;
7479 finfo.indices = NULL;
7480 finfo.sections = NULL;
7481 finfo.symbuf = NULL;
7482 finfo.symshndxbuf = NULL;
7483 finfo.symbuf_count = 0;
7484 finfo.shndxbuf_size = 0;
7707 finfo.symbuf_size = 20;
7709 finfo.symbuf_size = max_sym_count;
7710 amt = finfo.symbuf_size;
7712 finfo.symbuf = bfd_malloc (amt);
7713 if (finfo.symbuf == NULL)
7719 finfo.shndxbuf_size = amt;
7721 finfo.symshndxbuf = bfd_zmalloc (amt);
7722 if (finfo.symshndxbuf == NULL)
7736 if (! elf_link_output_sym (&finfo, NULL, &elfsym, bfd_und_section_ptr,
7752 if (! elf_link_output_sym (&finfo, bfd_get_filename (abfd),
7778 if (! elf_link_output_sym (&finfo, NULL, &elfsym, o, NULL))
7789 finfo.contents = bfd_malloc (max_contents_size);
7790 if (finfo.contents == NULL)
7796 finfo.external_relocs = bfd_malloc (max_external_reloc_size);
7797 if (finfo.external_relocs == NULL)
7805 finfo.internal_relocs = bfd_malloc (amt);
7806 if (finfo.internal_relocs == NULL)
7813 finfo.external_syms = bfd_malloc (amt);
7814 if (finfo.external_syms == NULL)
7818 finfo.internal_syms = bfd_malloc (amt);
7819 if (finfo.internal_syms == NULL)
7823 finfo.indices = bfd_malloc (amt);
7824 if (finfo.indices == NULL)
7828 finfo.sections = bfd_malloc (amt);
7829 if (finfo.sections == NULL)
7836 finfo.locsym_shndx = bfd_malloc (amt);
7837 if (finfo.locsym_shndx == NULL)
7907 if (! elf_link_input_bfd (&finfo, sub))
7933 eoinfo.finfo = &finfo;
7949 && finfo.dynsym_sec->output_section != bfd_abs_section_ptr)
7952 bfd_byte *dynsym = finfo.dynsym_sec->contents;
8024 elf_section_data (finfo.dynsym_sec->output_section)->this_hdr.sh_info =
8031 eoinfo.finfo = &finfo;
8046 (abfd, info, &finfo, (out_sym_func) elf_link_output_sym)))
8051 if (! elf_link_flush_output_syms (&finfo, bed))
8070 || (bfd_bwrite (finfo.symshndxbuf, amt, abfd) != amt))
8082 symstrtab_hdr->sh_size = _bfd_stringtab_size (finfo.symstrtab);
8095 || ! _bfd_stringtab_emit (abfd, finfo.symstrtab))
8352 if (finfo.symstrtab != NULL)
8353 _bfd_stringtab_free (finfo.symstrtab);
8354 if (finfo.contents != NULL)
8355 free (finfo.contents);
8356 if (finfo.external_relocs != NULL)
8357 free (finfo.external_relocs);
8358 if (finfo.internal_relocs != NULL)
8359 free (finfo.internal_relocs);
8360 if (finfo.external_syms != NULL)
8361 free (finfo.external_syms);
8362 if (finfo.locsym_shndx != NULL)
8363 free (finfo.locsym_shndx);
8364 if (finfo.internal_syms != NULL)
8365 free (finfo.internal_syms);
8366 if (finfo.indices != NULL)
8367 free (finfo.indices);
8368 if (finfo.sections != NULL)
8369 free (finfo.sections);
8370 if (finfo.symbuf != NULL)
8371 free (finfo.symbuf);
8372 if (finfo.symshndxbuf != NULL)
8373 free (finfo.symshndxbuf);
8386 if (finfo.symstrtab != NULL)
8387 _bfd_stringtab_free (finfo.symstrtab);
8388 if (finfo.contents != NULL)
8389 free (finfo.contents);
8390 if (finfo.external_relocs != NULL)
8391 free (finfo.external_relocs);
8392 if (finfo.internal_relocs != NULL)
8393 free (finfo.internal_relocs);
8394 if (finfo.external_syms != NULL)
8395 free (finfo.external_syms);
8396 if (finfo.locsym_shndx != NULL)
8397 free (finfo.locsym_shndx);
8398 if (finfo.internal_syms != NULL)
8399 free (finfo.internal_syms);
8400 if (finfo.indices != NULL)
8401 free (finfo.indices);
8402 if (finfo.sections != NULL)
8403 free (finfo.sections);
8404 if (finfo.symbuf != NULL)
8405 free (finfo.symbuf);
8406 if (finfo.symshndxbuf != NULL)
8407 free (finfo.symshndxbuf);