Lines Matching refs:HTAB
262 /* Return size of a relocation entry. HTAB is the bfd's
264 #define RELOC_SIZE(HTAB) (sizeof (ElfNN_External_Rela))
281 #define aarch64_compute_jump_table_size(htab) \
282 (((htab)->root.srelplt == NULL) ? 0 \
283 : (htab)->root.srelplt->reloc_count * GOT_ENTRY_SIZE)
2792 elfNN_aarch64_get_local_sym_hash (struct elf_aarch64_link_hash_table *htab,
2804 slot = htab_find_slot_with_hash (htab->loc_hash_table, &e, h,
2817 objalloc_alloc ((struct objalloc *) htab->loc_hash_memory,
3074 struct elf_aarch64_link_hash_table *htab)
3089 id_sec = htab->stub_group[input_section->id].link_sec;
3104 stub_entry = aarch64_stub_hash_lookup (&htab->stub_hash_table,
3120 struct elf_aarch64_link_hash_table *htab)
3128 s_name = bfd_alloc (htab->stub_bfd, len);
3134 return (*htab->add_stub_section) (s_name, section);
3145 struct elf_aarch64_link_hash_table *htab)
3147 if (htab->stub_group[link_section->id].stub_sec == NULL)
3148 htab->stub_group[link_section->id].stub_sec
3149 = _bfd_aarch64_create_stub_section (link_section, htab);
3150 return htab->stub_group[link_section->id].stub_sec;
3159 struct elf_aarch64_link_hash_table *htab)
3161 asection *link_sec = htab->stub_group[section->id].link_sec;
3162 return _bfd_aarch64_get_stub_for_link_section (link_sec, htab);
3173 struct elf_aarch64_link_hash_table *htab)
3179 link_sec = htab->stub_group[section->id].link_sec;
3180 stub_sec = _bfd_aarch64_create_or_find_stub_sec (section, htab);
3183 stub_entry = aarch64_stub_hash_lookup (&htab->stub_hash_table, stub_name,
3206 struct elf_aarch64_link_hash_table *htab)
3213 if (htab->fix_erratum_843419 & ERRAT_ADRP)
3214 stub_sec = _bfd_aarch64_get_stub_for_link_section (link_section, htab);
3215 stub_entry = aarch64_stub_hash_lookup (&htab->stub_hash_table, stub_name,
3248 struct elf_aarch64_link_hash_table *htab;
3254 htab = elf_aarch64_hash_table (info);
3268 if (htab->has_double_stub)
3293 if (htab->has_double_stub)
3400 struct elf_aarch64_link_hash_table *htab;
3405 htab = (struct elf_aarch64_link_hash_table *) in_arg;
3423 if (htab->fix_erratum_843419 == ERRAT_ADR)
3463 struct elf_aarch64_link_hash_table *htab =
3466 if (!is_elf_hash_table (&htab->root.root))
3481 htab->bfd_count = bfd_count;
3484 htab->stub_group = bfd_zmalloc (amt);
3485 if (htab->stub_group == NULL)
3498 htab->top_index = top_index;
3501 htab->input_list = input_list;
3523 #define PREV_SEC(sec) (htab->stub_group[(sec)->id].link_sec)
3533 struct elf_aarch64_link_hash_table *htab =
3536 if (isec->output_section->index <= htab->top_index)
3538 asection **list = htab->input_list + isec->output_section->index;
3559 group_sections (struct elf_aarch64_link_hash_table *htab,
3563 asection **list = htab->input_list;
3620 htab->stub_group[head->id].link_sec = curr;
3639 htab->stub_group[head->id].link_sec = curr;
3645 while (list++ != htab->input_list + htab->top_index);
3647 free (htab->input_list);
3988 struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
3991 if (htab == NULL)
4046 htab);
4148 _bfd_aarch64_resize_stubs (struct elf_aarch64_link_hash_table *htab)
4154 for (section = htab->stub_bfd->sections;
4166 bfd_hash_traverse (&htab->stub_hash_table, aarch64_size_one_stub, htab);
4168 for (section = htab->stub_bfd->sections;
4184 if (htab->fix_erratum_843419 & ERRAT_ADRP)
4221 struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
4228 stub_entry = aarch64_stub_hash_lookup (&htab->stub_hash_table, stub_name,
4247 stub_entry = _bfd_aarch64_add_stub_entry_after (stub_name, section, htab);
4278 struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
4280 if (htab == NULL)
4357 struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
4565 id_sec = htab->stub_group[section->id].link_sec;
4574 aarch64_stub_hash_lookup (&htab->stub_hash_table,
4589 id_sec_bti = htab->stub_group[sym_sec->id].link_sec;
4596 aarch64_stub_hash_lookup (&htab->stub_hash_table,
4607 (stub_name, section, htab);
4623 stub_entry->output_name = bfd_alloc (htab->stub_bfd, len);
4637 id_sec_bti = htab->stub_group[sym_sec->id].link_sec;
4651 htab->has_double_stub = true;
4662 aarch64_stub_hash_lookup (&htab->stub_hash_table,
4671 sym_sec, htab);
4688 stub_entry_bti->output_name = bfd_alloc (htab->stub_bfd,
4735 struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
4744 htab->stub_bfd = stub_bfd;
4745 htab->add_stub_section = add_stub_section;
4746 htab->layout_sections_again = layout_sections_again;
4760 group_sections (htab, stub_group_size, stubs_always_before_branch);
4762 (*htab->layout_sections_again) ();
4764 if (htab->fix_erratum_835769)
4780 _bfd_aarch64_resize_stubs (htab);
4781 (*htab->layout_sections_again) ();
4784 if (htab->fix_erratum_843419 != ERRAT_NONE)
4805 _bfd_aarch64_resize_stubs (htab);
4806 (*htab->layout_sections_again) ();
4819 _bfd_aarch64_resize_stubs (htab);
4820 (*htab->layout_sections_again) ();
4835 struct elf_aarch64_link_hash_table *htab;
4837 htab = elf_aarch64_hash_table (info);
4839 for (stub_sec = htab->stub_bfd->sections;
4850 stub_sec->contents = bfd_zalloc (htab->stub_bfd, size);
4863 table = &htab->stub_hash_table;
5303 struct elf_link_hash_table *htab = elf_hash_table (info);
5306 BFD_ASSERT (htab->tls_sec != NULL);
5309 htab->tls_sec->alignment_power);
5310 return htab->tls_sec->vma - base;
5477 struct elf_aarch64_link_hash_table *htab;
5488 htab = elf_aarch64_hash_table (info);
5494 BFD_ASSERT (((htab->fix_erratum_843419 & ERRAT_ADRP) && stub_entry->stub_sec)
5495 || (htab->fix_erratum_843419 & ERRAT_ADR));
5519 if ((htab->fix_erratum_843419 & ERRAT_ADR)
5528 else if (htab->fix_erratum_843419 & ERRAT_ADRP)
7140 * RELOC_SIZE (htab);
7239 * RELOC_SIZE (htab);
7604 struct elf_aarch64_link_hash_table *htab;
7690 htab = elf_aarch64_hash_table (info);
7697 s = htab->root.sdynrelro;
7698 srel = htab->root.sreldynrelro;
7702 s = htab->root.sdynbss;
7703 srel = htab->root.srelbss;
7707 srel->size += RELOC_SIZE (htab);
7740 struct elf_link_hash_table *htab = elf_hash_table (info);
7743 if (htab->sgot != NULL)
7756 htab->srelgot = s;
7762 htab->sgot = s;
7763 htab->sgot->size += GOT_ENTRY_SIZE;
7784 htab->sgotplt = s;
7805 struct elf_aarch64_link_hash_table *htab;
7812 htab = elf_aarch64_hash_table (info);
7840 isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
7848 h = elfNN_aarch64_get_local_sym_hash (htab, abfd, rel,
7883 if (htab->root.dynobj == NULL)
7884 htab->root.dynobj = abfd;
7886 if (! aarch64_elf_create_got_section (htab->root.dynobj, info))
7889 BFD_ASSERT (h == htab->root.hgot);
7915 if (htab->root.dynobj == NULL)
7916 htab->root.dynobj = abfd;
7917 if (!_bfd_elf_create_ifunc_sections (htab->root.dynobj, info))
8042 if (htab->root.dynobj == NULL)
8043 htab->root.dynobj = abfd;
8046 (sec, htab->root.dynobj, LOG_FILE_ALIGN, abfd, /*rela? */ true);
8067 isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
8087 bfd_zalloc (htab->root.dynobj, amt));
8192 if (htab->root.dynobj == NULL)
8193 htab->root.dynobj = abfd;
8194 if (! aarch64_elf_create_got_section (htab->root.dynobj, info))
8310 struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
8312 if (htab->root.dynsym != NULL
8313 && htab->root.dynsym->contents != NULL)
8324 (htab->root.dynsym->contents
8605 struct elf_aarch64_link_hash_table *htab;
8612 htab = elf_aarch64_hash_table (info);
8619 if (htab->stub_bfd && htab->stub_bfd->sections)
8623 for (stub_sec = htab->stub_bfd->sections;
8639 bfd_hash_traverse (&htab->stub_hash_table, aarch64_map_one_stub,
8645 if (!htab->root.splt || htab->root.splt->size == 0)
8649 (output_bfd, htab->root.splt->output_section);
8650 osi.sec = htab->root.splt;
8697 struct elf_aarch64_link_hash_table *htab;
8717 htab = elf_aarch64_hash_table (info);
8724 else if (htab->root.dynamic_sections_created && h->plt.refcount > 0)
8737 asection *s = htab->root.splt;
8742 s->size += htab->plt_header_size;
8760 s->size += htab->plt_entry_size;
8764 htab->root.sgotplt->size += GOT_ENTRY_SIZE;
8767 htab->root.srelplt->size += RELOC_SIZE (htab);
8782 htab->root.srelplt->reloc_count++;
8787 htab->variant_pcs = 1;
8812 dyn = htab->root.dynamic_sections_created;
8828 h->got.offset = htab->root.sgot->size;
8829 htab->root.sgot->size += GOT_ENTRY_SIZE;
8838 htab->root.srelgot->size += RELOC_SIZE (htab);
8847 (htab->root.sgotplt->size
8848 - aarch64_compute_jump_table_size (htab));
8849 htab->root.sgotplt->size += GOT_ENTRY_SIZE * 2;
8855 h->got.offset = htab->root.sgot->size;
8856 htab->root.sgot->size += GOT_ENTRY_SIZE * 2;
8861 h->got.offset = htab->root.sgot->size;
8862 htab->root.sgot->size += GOT_ENTRY_SIZE;
8874 htab->root.srelplt->size += RELOC_SIZE (htab);
8880 htab->root.tlsdesc_plt = (bfd_vma) - 1;
8884 htab->root.srelgot->size += RELOC_SIZE (htab) * 2;
8887 htab->root.srelgot->size += RELOC_SIZE (htab);
8971 || (htab->root.dynamic_sections_created
9003 sreloc->size += p->count * RELOC_SIZE (htab);
9017 struct elf_aarch64_link_hash_table *htab;
9035 htab = elf_aarch64_hash_table (info);
9043 htab->plt_entry_size,
9044 htab->plt_header_size,
9074 record_relr (struct elf_aarch64_link_hash_table *htab, asection *sec,
9078 BFD_ASSERT (sreloc->size >= RELOC_SIZE (htab));
9079 sreloc->size -= RELOC_SIZE (htab);
9085 if (htab->relr_count >= htab->relr_alloc)
9087 if (htab->relr_alloc == 0)
9088 htab->relr_alloc = 4096;
9090 htab->relr_alloc *= 2;
9091 htab->relr = bfd_realloc (htab->relr,
9092 htab->relr_alloc * sizeof (*htab->relr));
9093 if (htab->relr == NULL)
9096 htab->relr[htab->relr_count].sec = sec;
9097 htab->relr[htab->relr_count].off = off;
9098 htab->relr_count++;
9121 struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
9133 if (!record_relr (htab, htab->root.sgot, h->got.offset,
9134 htab->root.srelgot))
9148 struct elf_aarch64_link_hash_table *htab;
9158 htab = elf_aarch64_hash_table (info);
9170 if (!record_relr (htab, htab->root.sgot, off, htab->root.srelgot))
9190 struct elf_aarch64_link_hash_table *htab;
9206 htab = elf_aarch64_hash_table (info);
9236 isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
9278 if (!record_relr (htab, sec, rel->r_offset, sreloc))
9293 /* Produce a malloc'd sorted array of reloc addresses in htab->relr_sorted.
9298 struct elf_aarch64_link_hash_table *htab)
9300 if (htab->relr_count == 0)
9303 bfd_vma *addr = htab->relr_sorted;
9306 addr = bfd_malloc (htab->relr_count * sizeof (*addr));
9309 htab->relr_sorted = addr;
9312 for (bfd_size_type i = 0; i < htab->relr_count; i++)
9315 htab->relr[i].sec,
9316 htab->relr[i].off);
9317 addr[i] = htab->relr[i].sec->output_section->vma
9318 + htab->relr[i].sec->output_offset
9321 qsort (addr, htab->relr_count, sizeof (*addr), cmp_relr_addr);
9337 struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
9338 asection *srelrdyn = htab->root.srelrdyn;
9341 if (!sort_relr (info, htab))
9343 bfd_vma *addr = htab->relr_sorted;
9348 for (bfd_size_type i = 0; i < htab->relr_count; )
9357 while (i < htab->relr_count
9372 if (htab->relr_layout_iter++ > 5 && srelrdyn->size < oldsize)
9386 struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
9387 asection *srelrdyn = htab->root.srelrdyn;
9388 bfd *dynobj = htab->root.dynobj;
9395 bfd_vma *addr = htab->relr_sorted;
9397 for (bfd_size_type i = 0; i < htab->relr_count; )
9407 while (i < htab->relr_count)
9423 htab->relr_sorted = NULL;
9440 struct elf_aarch64_link_hash_table *htab;
9446 htab = elf_aarch64_hash_table ((info));
9447 dynobj = htab->root.dynobj;
9452 if (htab->root.dynamic_sections_created)
9493 srel->size += p->count * RELOC_SIZE (htab);
9505 srel = htab->root.srelgot;
9516 (htab->root.sgotplt->size
9517 - aarch64_compute_jump_table_size (htab));
9518 htab->root.sgotplt->size += GOT_ENTRY_SIZE * 2;
9524 locals[i].got_offset = htab->root.sgot->size;
9525 htab->root.sgot->size += GOT_ENTRY_SIZE * 2;
9531 locals[i].got_offset = htab->root.sgot->size;
9532 htab->root.sgot->size += GOT_ENTRY_SIZE;
9543 htab->root.srelplt->size += RELOC_SIZE (htab);
9545 htab->root.tlsdesc_plt = (bfd_vma) - 1;
9549 htab->root.srelgot->size += RELOC_SIZE (htab) * 2;
9553 htab->root.srelgot->size += RELOC_SIZE (htab);
9566 elf_link_hash_traverse (&htab->root, elfNN_aarch64_allocate_dynrelocs,
9571 elf_link_hash_traverse (&htab->root, elfNN_aarch64_allocate_ifunc_dynrelocs,
9575 htab_traverse (htab->loc_hash_table,
9585 if (htab->root.srelplt)
9586 htab->sgotplt_jump_table_size = aarch64_compute_jump_table_size (htab);
9588 if (htab->root.tlsdesc_plt)
9590 if (htab->root.splt->size == 0)
9591 htab->root.splt->size += htab->plt_header_size;
9596 htab->root.tlsdesc_plt = 0;
9599 htab->root.tlsdesc_plt = htab->root.splt->size;
9600 htab->root.splt->size += htab->tlsdesc_plt_entry_size;
9602 htab->root.tlsdesc_got = htab->root.sgot->size;
9603 htab->root.sgot->size += GOT_ENTRY_SIZE;
9612 elf_link_hash_traverse (&htab->root, record_relr_dyn_got_relocs, info);
9630 if (htab->fix_erratum_835769 || htab->fix_erratum_843419)
9646 if (s == htab->root.splt
9647 || s == htab->root.sgot
9648 || s == htab->root.sgotplt
9649 || s == htab->root.iplt
9650 || s == htab->root.igotplt
9651 || s == htab->root.sdynbss
9652 || s == htab->root.sdynrelro)
9659 if (s->size != 0 && s != htab->root.srelplt)
9664 if (s != htab->root.srelplt)
9667 else if (s == htab->root.srelrdyn)
9671 if (htab->relr_count == 0)
9714 if (htab->root.dynamic_sections_created)
9727 if (htab->root.splt->size != 0)
9729 if (htab->variant_pcs
9768 *htab, bfd *output_bfd,
9782 if (htab->root.splt != NULL)
9784 plt = htab->root.splt;
9785 gotplt = htab->root.sgotplt;
9786 relplt = htab->root.srelplt;
9790 plt = htab->root.iplt;
9791 gotplt = htab->root.igotplt;
9792 relplt = htab->root.irelplt;
9806 if (plt == htab->root.splt)
9808 plt_index = (h->plt.offset - htab->plt_header_size) / htab->plt_entry_size;
9813 plt_index = h->plt.offset / htab->plt_entry_size;
9824 memcpy (plt_entry, htab->plt_entry, htab->plt_entry_size);
9879 loc = relplt->contents + plt_index * RELOC_SIZE (htab);
9935 struct elf_aarch64_link_hash_table *htab;
9936 htab = elf_aarch64_hash_table (info);
9947 if (htab->root.splt != NULL)
9949 plt = htab->root.splt;
9950 gotplt = htab->root.sgotplt;
9951 relplt = htab->root.srelplt;
9955 plt = htab->root.iplt;
9956 gotplt = htab->root.igotplt;
9957 relplt = htab->root.irelplt;
9971 elfNN_aarch64_create_small_pltn_entry (h, htab, output_bfd, info);
10001 if (htab->root.sgot == NULL || htab->root.srelgot == NULL)
10004 rela.r_offset = (htab->root.sgot->output_section->vma
10005 + htab->root.sgot->output_offset
10026 plt = htab->root.splt ? htab->root.splt : htab->root.iplt;
10030 htab->root.sgot->contents
10053 htab->root.sgot->contents + h->got.offset);
10058 loc = htab->root.srelgot->contents;
10059 loc += htab->root.srelgot->reloc_count++ * RELOC_SIZE (htab);
10074 || htab->root.srelbss == NULL)
10082 if (h->root.u.def.section == htab->root.sdynrelro)
10083 s = htab->root.sreldynrelro;
10085 s = htab->root.srelbss;
10086 loc = s->contents + s->reloc_count++ * RELOC_SIZE (htab);
10118 *htab)
10138 memcpy (htab->root.splt->contents, htab->plt0_entry,
10139 htab->plt_header_size);
10144 elf_section_data (htab->root.splt->output_section)->this_hdr.sh_entsize = 0;
10146 plt_got_2nd_ent = (htab->root.sgotplt->output_section->vma
10147 + htab->root.sgotplt->output_offset
10150 plt_base = htab->root.splt->output_section->vma +
10151 htab->root.splt->output_offset;
10155 bfd_byte *plt0_entry = htab->root.splt->contents;
10178 struct elf_aarch64_link_hash_table *htab;
10182 htab = elf_aarch64_hash_table (info);
10183 dynobj = htab->root.dynobj;
10186 if (htab->root.dynamic_sections_created)
10190 if (sdyn == NULL || htab->root.sgot == NULL)
10208 s = htab->root.sgotplt;
10213 s = htab->root.srelplt;
10218 s = htab->root.srelplt;
10223 s = htab->root.splt;
10225 + htab->root.tlsdesc_plt;
10229 s = htab->root.sgot;
10230 BFD_ASSERT (htab->root.tlsdesc_got != (bfd_vma)-1);
10232 + htab->root.tlsdesc_got;
10242 if (htab->root.splt && htab->root.splt->size > 0)
10244 elfNN_aarch64_init_small_plt0_entry (output_bfd, htab);
10246 if (htab->root.tlsdesc_plt && !(info->flags & DF_BIND_NOW))
10248 BFD_ASSERT (htab->root.tlsdesc_got != (bfd_vma)-1);
10250 htab->root.sgot->contents + htab->root.tlsdesc_got);
10253 htab->tlsdesc_plt_entry_size = PLT_TLSDESC_ENTRY_SIZE;
10262 memcpy (htab->root.splt->contents + htab->root.tlsdesc_plt,
10263 entry, htab->tlsdesc_plt_entry_size);
10267 htab->root.splt->output_section->vma
10268 + htab->root.splt->output_offset
10269 + htab->root.tlsdesc_plt + 4;
10274 htab->root.sgot->output_section->vma
10275 + htab->root.sgot->output_offset;
10278 htab->root.sgotplt->output_section->vma
10279 + htab->root.sgotplt->output_offset;
10281 bfd_vma dt_tlsdesc_got = got_addr + htab->root.tlsdesc_got;
10284 htab->root.splt->contents + htab->root.tlsdesc_plt;
10324 if (htab->root.sgotplt)
10326 if (bfd_is_abs_section (htab->root.sgotplt->output_section))
10329 (_("discarded output section: `%pA'"), htab->root.sgotplt);
10334 if (htab->root.sgotplt->size > 0)
10336 bfd_put_NN (output_bfd, (bfd_vma) 0, htab->root.sgotplt->contents);
10341 htab->root.sgotplt->contents + GOT_ENTRY_SIZE);
10344 htab->root.sgotplt->contents + GOT_ENTRY_SIZE * 2);
10347 if (htab->root.sgot)
10349 if (htab->root.sgot->size > 0)
10353 bfd_put_NN (output_bfd, addr, htab->root.sgot->contents);
10357 elf_section_data (htab->root.sgotplt->output_section)->
10361 if (htab->root.sgot && htab->root.sgot->size > 0)
10362 elf_section_data (htab->root.sgot->output_section)->this_hdr.sh_entsize
10366 htab_traverse (htab->loc_hash_table,