Home | History | Annotate | Download | only in bfd

Lines Matching full:htab

867 #define elf_x86_64_compute_jump_table_size(htab) \
868 ((htab)->elf.srelplt->reloc_count * GOT_ENTRY_SIZE)
934 elf_x86_64_get_local_sym_hash (struct elf_x86_64_link_hash_table *htab,
941 htab->r_sym (rel->r_info));
945 e.elf.dynstr_index = htab->r_sym (rel->r_info);
946 slot = htab_find_slot_with_hash (htab
959 objalloc_alloc ((struct objalloc *) htab->loc_hash_memory,
965 ret->elf.dynstr_index = htab->r_sym (rel->r_info);
977 struct elf_x86_64_link_hash_table *htab
980 if (htab->loc_hash_table)
981 htab_delete (htab->loc_hash_table);
982 if (htab->loc_hash_memory)
983 objalloc_free ((struct objalloc *) htab->loc_hash_memory);
1048 struct elf_x86_64_link_hash_table *htab;
1053 htab = elf_x86_64_hash_table (info);
1054 if (htab == NULL)
1057 htab->sdynbss = bfd_get_linker_section (dynobj, ".dynbss");
1059 htab->srelbss = bfd_get_linker_section (dynobj, ".rela.bss");
1061 if (!htab->sdynbss
1062 || (!info->shared && !htab->srelbss))
1066 && htab->plt_eh_frame == NULL
1067 && htab->elf.splt != NULL)
1072 htab->plt_eh_frame
1074 if (htab->plt_eh_frame == NULL
1075 || !bfd_set_section_alignment (dynobj, htab->plt_eh_frame, 3))
1186 struct elf_x86_64_link_hash_table *htab;
1204 htab = elf_x86_64_hash_table (info);
1291 r_symndx = htab->r_sym (rel[1].r_info);
1476 struct elf_x86_64_link_hash_table *htab;
1478 htab = elf_x86_64_hash_table (info);
1479 if (htab == NULL)
1485 isym = bfd_sym_from_r_symndx (&htab->sym_cache,
1513 struct elf_x86_64_link_hash_table *htab;
1525 htab = elf_x86_64_hash_table (info);
1526 if (htab == NULL)
1544 r_symndx = htab->r_sym (rel->r_info);
1557 htab->sym_cache,
1565 h = elf_x86_64_get_local_sym_hash (htab, abfd, rel,
1643 if (htab->plt_bnd == NULL)
1661 if (htab->elf.dynobj == NULL)
1662 htab->elf.dynobj = abfd;
1663 htab->plt_bnd
1664 = bfd_make_section_anyway_with_flags (htab->elf.dynobj,
1671 if (htab->plt_bnd == NULL
1672 || !bfd_set_section_alignment (htab->elf.dynobj,
1673 htab->plt_bnd,
1687 if (htab->elf.dynobj == NULL)
1688 htab->elf.dynobj = abfd;
1689 if (!_bfd_elf_create_ifunc_sections (htab->elf.dynobj, info))
1708 htab->tls_ld_got.refcount += 1;
1828 if (htab->elf.sgot == NULL)
1830 if (htab->elf.dynobj == NULL)
1831 htab->elf.dynobj = abfd;
1832 if (!_bfd_elf_create_got_section (htab->elf.dynobj,
1968 if (htab->elf.dynobj == NULL)
1969 htab->elf.dynobj = abfd;
1972 (sec, htab->elf.dynobj, ABI_64_P (abfd) ? 3 : 2,
1993 isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2014 bfd_alloc (htab->elf.dynobj, amt));
2083 struct elf_x86_64_link_hash_table *htab;
2092 htab = elf_x86_64_hash_table (info);
2093 if (htab == NULL)
2102 htab = elf_x86_64_hash_table (info);
2110 r_symndx = htab->r_sym (rel->r_info);
2123 isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2130 h = elf_x86_64_get_local_sym_hash (htab, abfd, rel, FALSE);
2163 if (htab->tls_ld_got.refcount > 0)
2164 htab->tls_ld_got.refcount -= 1;
2238 struct elf_x86_64_link_hash_table *htab;
2381 htab = elf_x86_64_hash_table (info);
2382 if (htab == NULL)
2392 htab->srelbss->size += bed->s->sizeof_rela;
2396 s = htab->sdynbss;
2408 struct elf_x86_64_link_hash_table *htab;
2420 htab = elf_x86_64_hash_table (info);
2421 if (htab == NULL)
2437 asection *s = htab->plt_bnd;
2452 else if (htab->elf.dynamic_sections_created
2467 asection *s = htab->elf.splt;
2468 asection *bnd_s = htab->plt_bnd;
2512 htab->elf.sgotplt->size += GOT_ENTRY_SIZE;
2515 htab->elf.srelplt->size += bed->s->sizeof_rela;
2516 htab->elf.srelplt->reloc_count++;
2558 eh->tlsdesc_got = htab->elf.sgotplt->size
2559 - elf_x86_64_compute_jump_table_size (htab);
2560 htab->elf.sgotplt->size += 2 * GOT_ENTRY_SIZE;
2566 s = htab->elf.sgot;
2572 dyn = htab->elf.dynamic_sections_created;
2578 htab->elf.srelgot->size += bed->s->sizeof_rela;
2580 htab->elf.srelgot->size += 2 * bed->s->sizeof_rela;
2586 htab->elf.srelgot->size += bed->s->sizeof_rela;
2589 htab->elf.srelplt->size += bed->s->sizeof_rela;
2590 htab->tlsdesc_plt = (bfd_vma) -1;
2654 || (htab->elf.dynamic_sections_created
2760 struct elf_x86_64_link_hash_table *htab;
2784 htab = elf_x86_64_hash_table (link_info);
2802 unsigned int r_symndx = htab->r_sym (irel->r_info);
2814 isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2825 irel->r_info = htab->r_info (r_symndx, R_X86_64_PC32);
2848 && h != htab->elf.hdynamic
2856 irel->r_info = htab->r_info (r_symndx, R_X86_64_PC32);
2902 struct elf_x86_64_link_hash_table *htab;
2909 htab = elf_x86_64_hash_table (info);
2910 if (htab == NULL)
2914 dynobj = htab->elf.dynobj;
2918 if (htab->elf.dynamic_sections_created)
2926 s->size = htab->dynamic_interpreter_size;
2927 s->contents = (unsigned char *) htab->dynamic_interpreter;
2991 s = htab->elf.sgot;
2992 srel = htab->elf.srelgot;
3001 *local_tlsdesc_gotent = htab->elf.sgotplt->size
3002 - elf_x86_64_compute_jump_table_size (htab);
3003 htab->elf.sgotplt->size += 2 * GOT_ENTRY_SIZE;
3020 htab->elf.srelplt->size
3022 htab->tlsdesc_plt = (bfd_vma) -1;
3034 if (htab->tls_ld_got.refcount > 0)
3038 htab->tls_ld_got.offset = htab->elf.sgot->size;
3039 htab->elf.sgot->size += 2 * GOT_ENTRY_SIZE;
3040 htab->elf.srelgot->size += bed->s->sizeof_rela;
3043 htab->tls_ld_got.offset = -1;
3047 elf_link_hash_traverse (&htab->elf, elf_x86_64_allocate_dynrelocs,
3051 htab_traverse (htab->loc_hash_table,
3063 if (htab->elf.srelplt)
3065 htab->sgotplt_jump_table_size
3066 = elf_x86_64_compute_jump_table_size (htab);
3067 htab->next_irelative_index = htab->elf.srelplt->reloc_count - 1;
3069 else if (htab->elf.irelplt)
3070 htab->next_irelative_index = htab->elf.irelplt->reloc_count - 1;
3072 if (htab->tlsdesc_plt)
3077 htab->tlsdesc_plt = 0;
3080 htab->tlsdesc_got = htab->elf.sgot->size;
3081 htab->elf.sgot->size += GOT_ENTRY_SIZE;
3084 if (htab->elf.splt->size == 0)
3085 htab->elf.splt->size += GET_PLT_ENTRY_SIZE (output_bfd);
3086 htab->tlsdesc_plt = htab->elf.splt->size;
3087 htab->elf.splt->size += GET_PLT_ENTRY_SIZE (output_bfd);
3091 if (htab->elf.sgotplt)
3095 if ((htab->elf.hgot == NULL
3096 || !htab->elf.hgot->ref_regular_nonweak)
3097 && (htab->elf.sgotplt->size
3099 && (htab->elf.splt == NULL
3100 || htab->elf.splt->size == 0)
3101 && (htab->elf.sgot == NULL
3102 || htab->elf.sgot->size == 0)
3103 && (htab->elf.iplt == NULL
3104 || htab->elf.iplt->size == 0)
3105 && (htab->elf.igotplt == NULL
3106 || htab->elf.igotplt->size == 0))
3107 htab->elf.sgotplt->size = 0;
3110 if (htab->plt_eh_frame != NULL
3111 && htab->elf.splt != NULL
3112 && htab->elf.splt->size != 0
3113 && !bfd_is_abs_section (htab->elf.splt->output_section)
3118 htab->plt_eh_frame->size = arch_data->eh_frame_plt_size;
3129 if (s == htab->elf.splt
3130 || s == htab->elf.sgot
3131 || s == htab->elf.sgotplt
3132 || s == htab->elf.iplt
3133 || s == htab->elf.igotplt
3134 || s == htab->plt_bnd
3135 || s == htab->plt_eh_frame
3136 || s == htab->sdynbss)
3143 if (s->size != 0 && s != htab->elf.srelplt)
3148 if (s != htab->elf.srelplt)
3186 if (htab->plt_eh_frame != NULL
3187 && htab->plt_eh_frame->contents != NULL)
3192 memcpy (htab->plt_eh_frame->contents,
3193 arch_data->eh_frame_plt, htab->plt_eh_frame->size);
3194 bfd_put_32 (dynobj, htab->elf.splt->size,
3195 htab->plt_eh_frame->contents + PLT_FDE_LEN_OFFSET);
3198 if (htab->elf.dynamic_sections_created)
3214 if (htab->elf.splt->size != 0)
3222 if (htab->tlsdesc_plt
3238 elf_link_hash_traverse (&htab->elf,
3270 struct elf_x86_64_link_hash_table *htab;
3275 htab = elf_x86_64_hash_table (info);
3276 if (htab == NULL)
3285 htab->tls_module_base = bh;
3305 struct elf_x86_64_link_hash_table *htab;
3311 htab = elf_x86_64_hash_table (info);
3312 if (htab == NULL)
3315 base = htab->tls_module_base;
3319 base->u.def.value = htab->elf.tls_size;
3341 struct elf_link_hash_table *htab = elf_hash_table (info);
3346 if (htab->tls_sec == NULL)
3350 static_tls_size = BFD_ALIGN (htab->tls_size, bed->static_tls_alignment);
3351 return address - static_tls_size - htab->tls_sec->vma;
3384 struct elf_x86_64_link_hash_table *htab;
3395 htab = elf_x86_64_hash_table (info);
3396 if (htab == NULL)
3444 r_symndx = htab->r_sym (rel->r_info);
3462 h = elf_x86_64_get_local_sym_hash (htab, input_bfd,
3525 if (htab->elf.splt != NULL)
3527 if (htab->plt_bnd != NULL)
3529 resolved_plt = htab->plt_bnd;
3534 resolved_plt = htab->elf.splt;
3540 resolved_plt = htab->elf.iplt;
3614 outrel.r_info = htab->r_info (0, R_X86_64_IRELATIVE);
3621 outrel.r_info = htab->r_info (h->dynindx, r_type);
3625 sreloc = htab->elf.irelifunc;
3645 base_got = htab->elf.sgot;
3657 if (htab->elf.splt != NULL)
3661 base_got = htab->elf.sgotplt;
3667 base_got = htab->elf.igotplt;
3716 base_got = htab->elf.sgot;
3718 if (htab->elf.sgot == NULL)
3736 base_got = htab->elf.sgotplt;
3739 dyn = htab->elf.dynamic_sections_created;
3796 s = htab->elf.srelgot;
3803 outrel.r_info = htab->r_info (0, R_X86_64_RELATIVE);
3818 relocation -= htab->elf.sgotplt->output_section->vma
3819 - htab->elf.sgotplt->output_offset;
3849 relocation -= htab->elf.sgotplt->output_section->vma
3850 + htab->elf.sgotplt->output_offset;
3856 relocation = htab->elf.sgotplt->output_section->vma
3857 + htab->elf.sgotplt->output_offset;
3867 && htab->elf.splt != NULL)
3869 if (htab->plt_bnd != NULL)
3871 resolved_plt = htab->plt_bnd;
3876 resolved_plt = htab->elf.splt;
3886 relocation -= htab->elf.sgotplt->output_section->vma
3887 + htab->elf.sgotplt->output_offset;
3901 || htab->elf.splt == NULL)
3909 if (htab->plt_bnd != NULL)
3911 resolved_plt = htab->plt_bnd;
3916 resolved_plt = htab->elf.splt;
4061 outrel.r_info = htab->r_info (h->dynindx, r_type);
4067 if (r_type == htab->pointer_r_type)
4070 outrel.r_info = htab->r_info (0, R_X86_64_RELATIVE);
4077 outrel.r_info = htab->r_info (0,
4135 asection *oi = htab->elf.text_index_section;
4141 outrel.r_info = htab->r_info (sindx, r_type);
4349 if (htab->elf.sgot == NULL)
4374 if (htab->elf.srelgot == NULL)
4381 outrel.r_info = htab->r_info (indx, R_X86_64_TLSDESC);
4382 BFD_ASSERT (htab->sgotplt_jump_table_size + offplt
4383 + 2 * GOT_ENTRY_SIZE <= htab->elf.sgotplt->size);
4384 outrel.r_offset = (htab->elf.sgotplt->output_section->vma
4385 + htab->elf.sgotplt->output_offset
4387 + htab->sgotplt_jump_table_size);
4388 sreloc = htab->elf.srelplt;
4396 sreloc = htab->elf.srelgot;
4398 outrel.r_offset = (htab->elf.sgot->output_section->vma
4399 + htab->elf.sgot->output_offset + off);
4408 bfd_put_64 (output_bfd, 0, htab->elf.sgot->contents + off);
4413 outrel.r_info = htab->r_info (indx, dr_type);
4424 htab->elf.sgot->contents + off + GOT_ENTRY_SIZE);
4429 htab->elf.sgot->contents + off + GOT_ENTRY_SIZE);
4430 outrel.r_info = htab->r_info (indx,
4452 relocation = htab->elf.sgotplt->output_section->vma
4453 + htab->elf.sgotplt->output_offset
4454 + offplt + htab->sgotplt_jump_table_size;
4456 relocation = htab
4457 + htab->elf.sgot->output_offset + off;
4505 relocation = (htab->elf.sgot->output_section->vma
4506 + htab->elf.sgot->output_offset + off
4534 htab->elf.sgot->output_section->vma
4535 + htab->elf.sgot->output_offset + off
4603 if (htab->elf.sgot == NULL)
4606 off = htab->tls_ld_got.offset;
4613 if (htab->elf.srelgot == NULL)
4616 outrel.r_offset = (htab->elf.sgot->output_section->vma
4617 + htab->elf.sgot->output_offset + off);
4620 htab->elf.sgot->contents + off);
4622 htab->elf.sgot->contents + off + GOT_ENTRY_SIZE);
4623 outrel.r_info = htab->r_info (0, R_X86_64_DTPMOD64);
4625 elf_append_rela (output_bfd, htab->elf.srelgot,
4627 htab->tls_ld_got.offset |= 1;
4629 relocation = htab->elf.sgot->output_section->vma
4630 + htab->elf.sgot->output_offset + off;
4729 struct elf_x86_64_link_hash_table *htab;
4733 htab = elf_x86_64_hash_table (info);
4734 if (htab == NULL)
4739 use_plt_bnd = htab->elf.splt != NULL && htab->plt_bnd != NULL;
4756 if (htab->elf.splt != NULL)
4758 plt = htab->elf.splt;
4759 gotplt = htab->elf.sgotplt;
4760 relplt = htab->elf.srelplt;
4764 plt = htab->elf.iplt;
4765 gotplt = htab->elf.igotplt;
4766 relplt = htab->elf.irelplt;
4791 if (plt == htab->elf.splt)
4837 memcpy (htab->plt_bnd->contents + eh->plt_bnd.offset,
4840 resolved_plt = htab->plt_bnd;
4886 rela.r_info = htab->r_info (0, R_X86_64_IRELATIVE);
4891 plt_index = htab->next_irelative_index--;
4895 rela.r_info = htab->r_info (h->dynindx, R_X86_64_JUMP_SLOT);
4897 plt_index = htab->next_jump_slot_index++;
4901 if (plt == htab->elf.splt)
4939 if (htab->elf.sgot == NULL || htab->elf.srelgot == NULL)
4942 rela.r_offset = (htab->elf.sgot->output_section->vma
4943 + htab->elf.sgot->output_offset
4969 plt = htab->elf.splt ? htab->elf.splt : htab->elf.iplt;
4973 htab->elf.sgot->contents + h->got.offset);
4983 rela.r_info = htab->r_info (0, R_X86_64_RELATIVE);
4993 htab->elf.sgot->contents + h->got.offset);
4994 rela.r_info = htab->r_info (h->dynindx, R_X86_64_GLOB_DAT);
4998 elf_append_rela (output_bfd, htab->elf.srelgot, &rela);
5010 || htab->srelbss == NULL)
5016 rela.r_info = htab->r_info (h->dynindx, R_X86_64_COPY);
5018 elf_append_rela (output_bfd, htab->srelbss, &rela);
5067 struct elf_x86_64_link_hash_table *htab;
5072 htab = elf_x86_64_hash_table (info);
5073 if (htab == NULL)
5078 abed = (htab->elf.splt != NULL && htab->plt_bnd != NULL
5082 dynobj = htab->elf.dynobj;
5085 if (htab->elf.dynamic_sections_created)
5091 if (sdyn == NULL || htab->elf.sgot == NULL)
5111 s = htab->elf.sgotplt;
5116 dyn.d_un.d_ptr = htab->elf.srelplt->output_section->vma;
5120 s = htab->elf.srelplt->output_section;
5132 if (htab->elf.srelplt != NULL)
5134 s = htab->elf.srelplt->output_section;
5140 s = htab->elf.splt;
5142 + htab->tlsdesc_plt;
5146 s = htab->elf.sgot;
5148 + htab->tlsdesc_got;
5156 if (htab->elf.splt && htab->elf.splt->size > 0)
5159 memcpy (htab->elf.splt->contents,
5164 (htab->elf.sgotplt->output_section->vma
5165 + htab->elf.sgotplt->output_offset
5167 - htab->elf.splt->output_section->vma
5168 - htab->elf.splt->output_offset
5170 htab->elf.splt->contents + abed->plt0_got1_offset);
5174 (htab->elf.sgotplt->output_section->vma
5175 + htab->elf.sgotplt->output_offset
5177 - htab->elf.splt->output_section->vma
5178 - htab->elf.splt->output_offset
5180 htab->elf.splt->contents + abed->plt0_got2_offset);
5182 elf_section_data (htab->elf.splt->output_section)
5185 if (htab->tlsdesc_plt)
5188 htab->elf.sgot->contents + htab->tlsdesc_got);
5190 memcpy (htab->elf.splt->contents + htab->tlsdesc_plt,
5196 (htab->elf.sgotplt->output_section->vma
5197 + htab->elf.sgotplt->output_offset
5199 - htab->elf.splt->output_section->vma
5200 - htab->elf.splt->output_offset
5201 - htab->tlsdesc_plt
5203 htab->elf.splt->contents
5204 + htab->tlsdesc_plt + abed->plt0_got1_offset);
5206 where TGD stands for htab->tlsdesc_got, subtracting the offset
5209 (htab->elf.sgot->output_section->vma
5210 + htab->elf.sgot->output_offset
5211 + htab->tlsdesc_got
5212 - htab->elf.splt->output_section->vma
5213 - htab->elf.splt->output_offset
5214 - htab->tlsdesc_plt
5216 htab->elf.splt->contents
5217 + htab->tlsdesc_plt + abed->plt0_got2_offset);
5222 if (htab->plt_bnd != NULL)
5223 elf_section_data (htab->plt_bnd->output_section)
5226 if (htab->elf.sgotplt)
5228 if (bfd_is_abs_section (htab->elf.sgotplt->output_section))
5231 (_("discarded output section: `%A'"), htab->elf.sgotplt);
5236 if (htab->elf.sgotplt->size > 0)
5241 bfd_put_64 (output_bfd, (bfd_vma) 0, htab->elf.sgotplt->contents);
5245 htab->elf.sgotplt->contents);
5247 bfd_put_64 (output_bfd, (bfd_vma) 0, htab->elf.sgotplt->contents + GOT_ENTRY_SIZE);
5248 bfd_put_64 (output_bfd, (bfd_vma) 0, htab->elf.sgotplt->contents + GOT_ENTRY_SIZE*2);
5251 elf_section_data (htab->elf.sgotplt->output_section)->this_hdr.sh_entsize =
5256 if (htab->plt_eh_frame != NULL
5257 && htab->plt_eh_frame->contents != NULL)
5259 if (htab->elf.splt != NULL
5260 && htab->elf.splt->size != 0
5261 && (htab->elf.splt->flags & SEC_EXCLUDE) == 0
5262 && htab->elf.splt->output_section != NULL
5263 && htab->plt_eh_frame->output_section != NULL)
5265 bfd_vma plt_start = htab->elf.splt->output_section->vma;
5266 bfd_vma eh_frame_start = htab->plt_eh_frame->output_section->vma
5267 + htab->plt_eh_frame->output_offset
5270 htab->plt_eh_frame->contents
5273 if (htab->plt_eh_frame->sec_info_type == SEC_INFO_TYPE_EH_FRAME)
5276 htab->plt_eh_frame,
5277 htab->plt_eh_frame->contents))
5282 if (htab->elf.sgot && htab->elf.sgot->size > 0)
5283 elf_section_data (htab->elf.sgot->output_section)->this_hdr.sh_entsize
5287 htab_traverse (htab->loc_hash_table,