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)
2803 elfNN_aarch64_get_local_sym_hash (struct elf_aarch64_link_hash_table *htab,
2815 slot = htab_find_slot_with_hash (htab->loc_hash_table, &e, h,
2828 objalloc_alloc ((struct objalloc *) htab->loc_hash_memory,
3086 htab)
3101 id_sec = htab->stub_group[input_section->id].link_sec;
3116 stub_entry = aarch64_stub_hash_lookup (&htab->stub_hash_table,
3132 struct elf_aarch64_link_hash_table *htab)
3140 s_name = bfd_alloc (htab->stub_bfd, len);
3146 return (*htab->add_stub_section) (s_name, section);
3157 struct elf_aarch64_link_hash_table *htab)
3159 if (htab->stub_group[link_section->id].stub_sec == NULL)
3160 htab->stub_group[link_section->id].stub_sec
3161 = _bfd_aarch64_create_stub_section (link_section, htab);
3162 return htab->stub_group[link_section->id].stub_sec;
3171 struct elf_aarch64_link_hash_table *htab)
3173 asection *link_sec = htab->stub_group[section->id].link_sec;
3174 return _bfd_aarch64_get_stub_for_link_section (link_sec, htab);
3185 struct elf_aarch64_link_hash_table *htab)
3191 link_sec = htab->stub_group[section->id].link_sec;
3192 stub_sec = _bfd_aarch64_create_or_find_stub_sec (section, htab);
3195 stub_entry = aarch64_stub_hash_lookup (&htab->stub_hash_table, stub_name,
3218 struct elf_aarch64_link_hash_table *htab)
3225 if (htab->fix_erratum_843419 & ERRAT_ADRP)
3226 stub_sec = _bfd_aarch64_get_stub_for_link_section (link_section, htab);
3227 stub_entry = aarch64_stub_hash_lookup (&htab->stub_hash_table, stub_name,
3260 struct elf_aarch64_link_hash_table *htab;
3266 htab = elf_aarch64_hash_table (info);
3280 if (htab->has_double_stub)
3305 if (htab->has_double_stub)
3412 struct elf_aarch64_link_hash_table *htab;
3417 htab = (struct elf_aarch64_link_hash_table *) in_arg;
3435 if (htab->fix_erratum_843419 == ERRAT_ADR)
3475 struct elf_aarch64_link_hash_table *htab =
3478 if (!is_elf_hash_table (&htab->root.root))
3493 htab->bfd_count = bfd_count;
3496 htab->stub_group = bfd_zmalloc (amt);
3497 if (htab->stub_group == NULL)
3510 htab->top_index = top_index;
3513 htab->input_list = input_list;
3535 #define PREV_SEC(sec) (htab->stub_group[(sec)->id].link_sec)
3545 struct elf_aarch64_link_hash_table *htab =
3548 if (isec->output_section->index <= htab->top_index)
3550 asection **list = htab->input_list + isec->output_section->index;
3571 group_sections (struct elf_aarch64_link_hash_table *htab,
3575 asection **list = htab->input_list;
3632 htab->stub_group[head->id].link_sec = curr;
3651 htab->stub_group[head->id].link_sec = curr;
3657 while (list++ != htab->input_list + htab->top_index);
3659 free (htab->input_list);
4000 struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
4003 if (htab == NULL)
4058 htab);
4160 _bfd_aarch64_resize_stubs (struct elf_aarch64_link_hash_table *htab)
4166 for (section = htab->stub_bfd->sections;
4178 bfd_hash_traverse (&htab->stub_hash_table, aarch64_size_one_stub, htab);
4180 for (section = htab->stub_bfd->sections;
4196 if (htab->fix_erratum_843419 & ERRAT_ADRP)
4233 struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
4240 stub_entry = aarch64_stub_hash_lookup (&htab->stub_hash_table, stub_name,
4259 stub_entry = _bfd_aarch64_add_stub_entry_after (stub_name, section, htab);
4290 struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
4292 if (htab == NULL)
4369 struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
4577 id_sec = htab->stub_group[section->id].link_sec;
4586 aarch64_stub_hash_lookup (&htab->stub_hash_table,
4601 id_sec_bti = htab->stub_group[sym_sec->id].link_sec;
4608 aarch64_stub_hash_lookup (&htab->stub_hash_table,
4619 (stub_name, section, htab);
4635 stub_entry->output_name = bfd_alloc (htab->stub_bfd, len);
4649 id_sec_bti = htab->stub_group[sym_sec->id].link_sec;
4663 htab->has_double_stub = true;
4674 aarch64_stub_hash_lookup (&htab->stub_hash_table,
4683 sym_sec, htab);
4700 stub_entry_bti->output_name = bfd_alloc (htab->stub_bfd,
4747 struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
4756 htab->stub_bfd = stub_bfd;
4757 htab->add_stub_section = add_stub_section;
4758 htab->layout_sections_again = layout_sections_again;
4772 group_sections (htab, stub_group_size, stubs_always_before_branch);
4774 (*htab->layout_sections_again) ();
4776 if (htab->fix_erratum_835769)
4792 _bfd_aarch64_resize_stubs (htab);
4793 (*htab->layout_sections_again) ();
4796 if (htab->fix_erratum_843419 != ERRAT_NONE)
4817 _bfd_aarch64_resize_stubs (htab);
4818 (*htab->layout_sections_again) ();
4831 _bfd_aarch64_resize_stubs (htab);
4832 (*htab->layout_sections_again) ();
4847 struct elf_aarch64_link_hash_table *htab;
4849 htab = elf_aarch64_hash_table (info);
4851 for (stub_sec = htab->stub_bfd->sections;
4862 stub_sec->contents = bfd_zalloc (htab->stub_bfd, size);
4876 table = &htab->stub_hash_table;
5335 struct elf_link_hash_table *htab = elf_hash_table (info);
5338 BFD_ASSERT (htab->tls_sec != NULL);
5341 htab->tls_sec->alignment_power);
5342 return htab->tls_sec->vma - base;
5509 struct elf_aarch64_link_hash_table *htab;
5520 htab = elf_aarch64_hash_table (info);
5526 BFD_ASSERT (((htab->fix_erratum_843419 & ERRAT_ADRP) && stub_entry->stub_sec)
5527 || (htab->fix_erratum_843419 & ERRAT_ADR));
5551 if ((htab->fix_erratum_843419 & ERRAT_ADR)
5560 else if (htab->fix_erratum_843419 & ERRAT_ADRP)
7173 * RELOC_SIZE (htab);
7272 * RELOC_SIZE (htab);
7637 struct elf_aarch64_link_hash_table *htab;
7723 htab = elf_aarch64_hash_table (info);
7730 s = htab->root.sdynrelro;
7731 srel = htab->root.sreldynrelro;
7735 s = htab->root.sdynbss;
7736 srel = htab->root.srelbss;
7740 srel->size += RELOC_SIZE (htab);
7773 struct elf_link_hash_table *htab = elf_hash_table (info);
7776 if (htab->sgot != NULL)
7789 htab->srelgot = s;
7795 htab->sgot = s;
7796 htab->sgot->size += GOT_ENTRY_SIZE;
7817 htab->sgotplt = s;
7838 struct elf_aarch64_link_hash_table *htab;
7845 htab = elf_aarch64_hash_table (info);
7873 isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
7881 h = elfNN_aarch64_get_local_sym_hash (htab, abfd, rel,
7916 if (htab->root.dynobj == NULL)
7917 htab->root.dynobj = abfd;
7919 if (! aarch64_elf_create_got_section (htab->root.dynobj, info))
7922 BFD_ASSERT (h == htab->root.hgot);
7948 if (htab->root.dynobj == NULL)
7949 htab->root.dynobj = abfd;
7950 if (!_bfd_elf_create_ifunc_sections (htab->root.dynobj, info))
8075 if (htab->root.dynobj == NULL)
8076 htab->root.dynobj = abfd;
8079 (sec, htab->root.dynobj, LOG_FILE_ALIGN, abfd, /*rela? */ true);
8100 isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
8120 bfd_zalloc (htab->root.dynobj, amt));
8225 if (htab->root.dynobj == NULL)
8226 htab->root.dynobj = abfd;
8227 if (! aarch64_elf_create_got_section (htab->root.dynobj, info))
8343 struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
8345 if (htab->root.dynsym != NULL
8346 && htab->root.dynsym->contents != NULL)
8357 (htab->root.dynsym->contents
8637 struct elf_aarch64_link_hash_table *htab;
8644 htab = elf_aarch64_hash_table (info);
8651 if (htab->stub_bfd && htab->stub_bfd->sections)
8655 for (stub_sec = htab->stub_bfd->sections;
8671 bfd_hash_traverse (&htab->stub_hash_table, aarch64_map_one_stub,
8677 if (!htab->root.splt || htab->root.splt->size == 0)
8681 (output_bfd, htab->root.splt->output_section);
8682 osi.sec = htab->root.splt;
8729 struct elf_aarch64_link_hash_table *htab;
8749 htab = elf_aarch64_hash_table (info);
8756 else if (htab->root.dynamic_sections_created && h->plt.refcount > 0)
8769 asection *s = htab->root.splt;
8774 s->size += htab->plt_header_size;
8792 s->size += htab->plt_entry_size;
8796 htab->root.sgotplt->size += GOT_ENTRY_SIZE;
8799 htab->root.srelplt->size += RELOC_SIZE (htab);
8814 htab->root.srelplt->reloc_count++;
8819 htab->variant_pcs = 1;
8844 dyn = htab->root.dynamic_sections_created;
8860 h->got.offset = htab->root.sgot->size;
8861 htab->root.sgot->size += GOT_ENTRY_SIZE;
8870 htab->root.srelgot->size += RELOC_SIZE (htab);
8879 (htab->root.sgotplt->size
8880 - aarch64_compute_jump_table_size (htab));
8881 htab->root.sgotplt->size += GOT_ENTRY_SIZE * 2;
8887 h->got.offset = htab->root.sgot->size;
8888 htab->root.sgot->size += GOT_ENTRY_SIZE * 2;
8893 h->got.offset = htab->root.sgot->size;
8894 htab->root.sgot->size += GOT_ENTRY_SIZE;
8906 htab->root.srelplt->size += RELOC_SIZE (htab);
8912 htab->root.tlsdesc_plt = (bfd_vma) - 1;
8916 htab->root.srelgot->size += RELOC_SIZE (htab) * 2;
8919 htab->root.srelgot->size += RELOC_SIZE (htab);
9003 || (htab->root.dynamic_sections_created
9035 sreloc->size += p->count * RELOC_SIZE (htab);
9049 struct elf_aarch64_link_hash_table *htab;
9067 htab = elf_aarch64_hash_table (info);
9075 htab->plt_entry_size,
9076 htab->plt_header_size,
9106 record_relr (struct elf_aarch64_link_hash_table *htab, asection *sec,
9110 BFD_ASSERT (sreloc->size >= RELOC_SIZE (htab));
9111 sreloc->size -= RELOC_SIZE (htab);
9117 if (htab->relr_count >= htab->relr_alloc)
9119 if (htab->relr_alloc == 0)
9120 htab->relr_alloc = 4096;
9122 htab->relr_alloc *= 2;
9123 htab->relr = bfd_realloc (htab->relr,
9124 htab->relr_alloc * sizeof (*htab->relr));
9125 if (htab->relr == NULL)
9128 htab->relr[htab->relr_count].sec = sec;
9129 htab->relr[htab->relr_count].off = off;
9130 htab->relr_count++;
9153 struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
9165 if (!record_relr (htab, htab->root.sgot, h->got.offset,
9166 htab->root.srelgot))
9180 struct elf_aarch64_link_hash_table *htab;
9190 htab = elf_aarch64_hash_table (info);
9202 if (!record_relr (htab, htab->root.sgot, off, htab->root.srelgot))
9222 struct elf_aarch64_link_hash_table *htab;
9238 htab = elf_aarch64_hash_table (info);
9268 isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
9310 if (!record_relr (htab, sec, rel->r_offset, sreloc))
9325 /* Produce a malloc'd sorted array of reloc addresses in htab->relr_sorted.
9330 struct elf_aarch64_link_hash_table *htab)
9332 if (htab->relr_count == 0)
9335 bfd_vma *addr = htab->relr_sorted;
9338 addr = bfd_malloc (htab->relr_count * sizeof (*addr));
9341 htab->relr_sorted = addr;
9344 for (bfd_size_type i = 0; i < htab->relr_count; i++)
9347 htab->relr[i].sec,
9348 htab->relr[i].off);
9349 addr[i] = htab->relr[i].sec->output_section->vma
9350 + htab->relr[i].sec->output_offset
9353 qsort (addr, htab->relr_count, sizeof (*addr), cmp_relr_addr);
9369 struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
9370 asection *srelrdyn = htab->root.srelrdyn;
9373 if (!sort_relr (info, htab))
9375 bfd_vma *addr = htab->relr_sorted;
9380 for (bfd_size_type i = 0; i < htab->relr_count; )
9389 while (i < htab->relr_count
9404 if (htab->relr_layout_iter++ > 5 && srelrdyn->size < oldsize)
9418 struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info);
9419 asection *srelrdyn = htab->root.srelrdyn;
9420 bfd *dynobj = htab->root.dynobj;
9428 bfd_vma *addr = htab->relr_sorted;
9430 for (bfd_size_type i = 0; i < htab->relr_count; )
9440 while (i < htab->relr_count)
9456 htab->relr_sorted = NULL;
9473 struct elf_aarch64_link_hash_table *htab;
9479 htab = elf_aarch64_hash_table ((info));
9480 dynobj = htab->root.dynobj;
9485 if (htab->root.dynamic_sections_created)
9527 srel->size += p->count * RELOC_SIZE (htab);
9539 srel = htab->root.srelgot;
9550 (htab->root.sgotplt->size
9551 - aarch64_compute_jump_table_size (htab));
9552 htab->root.sgotplt->size += GOT_ENTRY_SIZE * 2;
9558 locals[i].got_offset = htab->root.sgot->size;
9559 htab->root.sgot->size += GOT_ENTRY_SIZE * 2;
9565 locals[i].got_offset = htab->root.sgot->size;
9566 htab->root.sgot->size += GOT_ENTRY_SIZE;
9577 htab->root.srelplt->size += RELOC_SIZE (htab);
9579 htab->root.tlsdesc_plt = (bfd_vma) - 1;
9583 htab->root.srelgot->size += RELOC_SIZE (htab) * 2;
9587 htab->root.srelgot->size += RELOC_SIZE (htab);
9600 elf_link_hash_traverse (&htab->root, elfNN_aarch64_allocate_dynrelocs,
9605 elf_link_hash_traverse (&htab->root, elfNN_aarch64_allocate_ifunc_dynrelocs,
9609 htab_traverse (htab->loc_hash_table,
9619 if (htab->root.srelplt)
9620 htab->sgotplt_jump_table_size = aarch64_compute_jump_table_size (htab);
9622 if (htab->root.tlsdesc_plt)
9624 if (htab->root.splt->size == 0)
9625 htab->root.splt->size += htab->plt_header_size;
9630 htab->root.tlsdesc_plt = 0;
9633 htab->root.tlsdesc_plt = htab->root.splt->size;
9634 htab->root.splt->size += htab->tlsdesc_plt_entry_size;
9636 htab->root.tlsdesc_got = htab->root.sgot->size;
9637 htab->root.sgot->size += GOT_ENTRY_SIZE;
9646 elf_link_hash_traverse (&htab->root, record_relr_dyn_got_relocs, info);
9664 if (htab->fix_erratum_835769 || htab->fix_erratum_843419)
9680 if (s == htab->root.splt
9681 || s == htab->root.sgot
9682 || s == htab->root.sgotplt
9683 || s == htab->root.iplt
9684 || s == htab->root.igotplt
9685 || s == htab->root.sdynbss
9686 || s == htab->root.sdynrelro)
9693 if (s->size != 0 && s != htab->root.srelplt)
9698 if (s != htab->root.srelplt)
9701 else if (s == htab->root.srelrdyn)
9705 if (htab->relr_count == 0)
9749 if (htab->root.dynamic_sections_created)
9762 if (htab->root.splt->size != 0)
9764 if (htab->variant_pcs
9785 && htab->memtag_opts.memtag_mode != AARCH64_MEMTAG_MODE_NONE
9787 htab->memtag_opts.memtag_mode == AARCH64_MEMTAG_MODE_ASYNC))
9791 && htab->memtag_opts.memtag_stack == 1
9793 htab->memtag_opts.memtag_stack == 1))
9816 *htab, bfd *output_bfd,
9830 if (htab->root.splt != NULL)
9832 plt = htab->root.splt;
9833 gotplt = htab->root.sgotplt;
9834 relplt = htab->root.srelplt;
9838 plt = htab->root.iplt;
9839 gotplt = htab->root.igotplt;
9840 relplt = htab->root.irelplt;
9854 if (plt == htab->root.splt)
9856 plt_index = (h->plt.offset - htab->plt_header_size) / htab->plt_entry_size;
9861 plt_index = h->plt.offset / htab->plt_entry_size;
9872 memcpy (plt_entry, htab->plt_entry, htab->plt_entry_size);
9876 plt_entry += htab->plt_entry_delta;
9925 loc = relplt->contents + plt_index * RELOC_SIZE (htab);
9981 struct elf_aarch64_link_hash_table *htab;
9982 htab = elf_aarch64_hash_table (info);
9993 if (htab->root.splt != NULL)
9995 plt = htab->root.splt;
9996 gotplt = htab->root.sgotplt;
9997 relplt = htab->root.srelplt;
10001 plt = htab->root.iplt;
10002 gotplt = htab->root.igotplt;
10003 relplt = htab->root.irelplt;
10017 elfNN_aarch64_create_small_pltn_entry (h, htab, output_bfd, info);
10047 if (htab->root.sgot == NULL || htab->root.srelgot == NULL)
10050 rela.r_offset = (htab->root.sgot->output_section->vma
10051 + htab->root.sgot->output_offset
10072 plt = htab->root.splt ? htab->root.splt : htab->root.iplt;
10076 htab->root.sgot->contents
10099 htab->root.sgot->contents + h->got.offset);
10104 loc = htab->root.srelgot->contents;
10105 loc += htab->root.srelgot->reloc_count++ * RELOC_SIZE (htab);
10120 || htab->root.srelbss == NULL)
10128 if (h->root.u.def.section == htab->root.sdynrelro)
10129 s = htab->root.sreldynrelro;
10131 s = htab->root.srelbss;
10132 loc = s->contents + s->reloc_count++ * RELOC_SIZE (htab);
10164 *htab)
10184 memcpy (htab->root.splt->contents, htab->plt0_entry,
10185 htab->plt_header_size);
10190 elf_section_data (htab->root.splt->output_section)->this_hdr.sh_entsize = 0;
10192 plt_got_2nd_ent = (htab->root.sgotplt->output_section->vma
10193 + htab->root.sgotplt->output_offset
10196 plt_base = htab->root.splt->output_section->vma +
10197 htab->root.splt->output_offset;
10201 bfd_byte *plt0_entry = htab->root.splt->contents;
10224 struct elf_aarch64_link_hash_table *htab;
10228 htab = elf_aarch64_hash_table (info);
10229 dynobj = htab->root.dynobj;
10232 if (htab->root.dynamic_sections_created)
10236 if (sdyn == NULL || htab->root.sgot == NULL)
10254 s = htab->root.sgotplt;
10259 s = htab->root.srelplt;
10264 s = htab->root.srelplt;
10269 s = htab->root.splt;
10271 + htab->root.tlsdesc_plt;
10275 s = htab->root.sgot;
10276 BFD_ASSERT (htab->root.tlsdesc_got != (bfd_vma)-1);
10278 + htab->root.tlsdesc_got;
10288 if (htab->root.splt && htab->root.splt->size > 0)
10290 elfNN_aarch64_init_small_plt0_entry (output_bfd, htab);
10292 if (htab->root.tlsdesc_plt && !(info->flags & DF_BIND_NOW))
10294 BFD_ASSERT (htab->root.tlsdesc_got != (bfd_vma)-1);
10296 htab->root.sgot->contents + htab->root.tlsdesc_got);
10299 htab->tlsdesc_plt_entry_size = PLT_TLSDESC_ENTRY_SIZE;
10308 memcpy (htab->root.splt->contents + htab->root.tlsdesc_plt,
10309 entry, htab->tlsdesc_plt_entry_size);
10313 htab->root.splt->output_section->vma
10314 + htab->root.splt->output_offset
10315 + htab->root.tlsdesc_plt + 4;
10320 htab->root.sgot->output_section->vma
10321 + htab->root.sgot->output_offset;
10324 htab->root.sgotplt->output_section->vma
10325 + htab->root.sgotplt->output_offset;
10327 bfd_vma dt_tlsdesc_got = got_addr + htab->root.tlsdesc_got;
10330 htab->root.splt->contents + htab->root.tlsdesc_plt;
10370 if (htab->root.sgotplt)
10372 if (bfd_is_abs_section (htab->root.sgotplt->output_section))
10375 (_("discarded output section: `%pA'"), htab->root.sgotplt);
10380 if (htab->root.sgotplt->size > 0)
10382 bfd_put_NN (output_bfd, (bfd_vma) 0, htab->root.sgotplt->contents);
10387 htab->root.sgotplt->contents + GOT_ENTRY_SIZE);
10390 htab->root.sgotplt->contents + GOT_ENTRY_SIZE * 2);
10393 if (htab->root.sgot)
10395 if (htab->root.sgot->size > 0)
10399 bfd_put_NN (output_bfd, addr, htab->root.sgot->contents);
10403 elf_section_data (htab->root.sgotplt->output_section)->
10407 if (htab->root.sgot && htab->root.sgot->size > 0)
10408 elf_section_data (htab->root.sgot->output_section)->this_hdr.sh_entsize
10412 htab_traverse (htab->loc_hash_table,