Lines Matching refs:htab

761 #define SPARC_ELF_PUT_WORD(htab, bfd, val, ptr)	\
762 htab->put_word(bfd, val, ptr)
764 #define SPARC_ELF_R_INFO(htab, in_rel, index, type) \
765 htab->r_info(in_rel, index, type)
767 #define SPARC_ELF_R_SYMNDX(htab, r_info) \
768 htab->r_symndx(r_info)
770 #define SPARC_ELF_WORD_BYTES(htab) \
771 htab->bytes_per_word
773 #define SPARC_ELF_RELA_BYTES(htab) \
774 htab->bytes_per_rela
776 #define SPARC_ELF_DTPOFF_RELOC(htab) \
777 htab->dtpoff_reloc
779 #define SPARC_ELF_DTPMOD_RELOC(htab) \
780 htab->dtpmod_reloc
782 #define SPARC_ELF_TPOFF_RELOC(htab) \
783 htab->tpoff_reloc
785 #define SPARC_ELF_BUILD_PLT_ENTRY(htab, obfd, splt, off, max, r_off) \
786 htab->build_plt_entry (obfd, splt, off, max, r_off)
883 struct _bfd_sparc_elf_link_hash_table *htab;
888 htab = _bfd_sparc_elf_hash_table (info);
889 htab->sgot = bfd_get_section_by_name (dynobj, ".got");
890 BFD_ASSERT (htab->sgot != NULL);
892 htab->srelgot = bfd_make_section_with_flags (dynobj, ".rela.got",
899 if (htab->srelgot == NULL
900 || ! bfd_set_section_alignment (dynobj, htab->srelgot,
901 htab->word_align_power))
904 if (htab->is_vxworks)
906 htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt");
907 if (!htab->sgotplt)
922 struct _bfd_sparc_elf_link_hash_table *htab;
924 htab = _bfd_sparc_elf_hash_table (info);
925 if (!htab->sgot && !create_got_section (dynobj, info))
931 htab->splt = bfd_get_section_by_name (dynobj, ".plt");
932 htab->srelplt = bfd_get_section_by_name (dynobj, ".rela.plt");
933 htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss");
935 htab->srelbss = bfd_get_section_by_name (dynobj, ".rela.bss");
937 if (htab->is_vxworks)
939 if (!elf_vxworks_create_dynamic_sections (dynobj, info, &htab->srelplt2))
943 htab->plt_header_size
945 htab->plt_entry_size
950 htab->plt_header_size
952 htab->plt_entry_size
960 htab->build_plt_entry = sparc64_plt_entry_build;
961 htab->plt_header_size = PLT64_HEADER_SIZE;
962 htab->plt_entry_size = PLT64_ENTRY_SIZE;
966 htab->build_plt_entry = sparc32_plt_entry_build;
967 htab->plt_header_size = PLT32_HEADER_SIZE;
968 htab->plt_entry_size = PLT32_ENTRY_SIZE;
972 if (!htab->splt || !htab->srelplt || !htab->sdynbss
973 || (!info->shared && !htab->srelbss))
1079 struct _bfd_sparc_elf_link_hash_table *htab;
1092 htab = _bfd_sparc_elf_hash_table (info);
1110 r_symndx = SPARC_ELF_R_SYMNDX (htab, rel->r_info);
1161 htab->tls_ldm_got.refcount += 1;
1258 if (htab->sgot == NULL)
1260 if (htab->elf.dynobj == NULL)
1261 htab->elf.dynobj = abfd;
1262 if (!create_got_section (htab->elf.dynobj, info))
1445 if (htab->elf.dynobj == NULL)
1446 htab->elf.dynobj = abfd;
1447 dynobj = htab->elf.dynobj;
1463 htab->word_align_power))
1482 s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
1496 bfd_alloc (htab->elf.dynobj, amt));
1559 struct _bfd_sparc_elf_link_hash_table *htab;
1567 htab = _bfd_sparc_elf_hash_table (info);
1579 r_symndx = SPARC_ELF_R_SYMNDX (htab, rel->r_info);
1703 struct _bfd_sparc_elf_link_hash_table *htab;
1708 htab = _bfd_sparc_elf_hash_table (info);
1711 BFD_ASSERT (htab->elf.dynobj != NULL
1819 htab->srelbss->size += SPARC_ELF_RELA_BYTES (htab);
1823 s = htab->sdynbss;
1835 struct _bfd_sparc_elf_link_hash_table *htab;
1849 htab = _bfd_sparc_elf_hash_table (info);
1851 if (htab->elf.dynamic_sections_created
1865 asection *s = htab->splt;
1870 s->size = htab->plt_header_size;
1873 if (htab->is_vxworks && !info->shared)
1874 htab->srelplt2->size = sizeof (Elf32_External_Rela) * 2;
1879 if (s->size >= (SPARC_ELF_WORD_BYTES(htab) == 8 ?
1886 if (SPARC_ELF_WORD_BYTES(htab) == 8
1912 s->size += htab->plt_entry_size;
1915 htab->srelplt->size += SPARC_ELF_RELA_BYTES (htab);
1917 if (htab->is_vxworks)
1920 htab->sgotplt->size += 4;
1924 htab->srelplt2->size += sizeof (Elf32_External_Rela) * 3;
1961 s = htab->sgot;
1963 s->size += SPARC_ELF_WORD_BYTES (htab);
1966 s->size += SPARC_ELF_WORD_BYTES (htab);
1967 dyn = htab->elf.dynamic_sections_created;
1973 htab->srelgot->size += SPARC_ELF_RELA_BYTES (htab);
1975 htab->srelgot->size += 2 * SPARC_ELF_RELA_BYTES (htab);
1977 htab->srelgot->size += SPARC_ELF_RELA_BYTES (htab);
2038 || (htab->elf.dynamic_sections_created
2066 sreloc->size += p->count * SPARC_ELF_RELA_BYTES (htab);
2124 struct _bfd_sparc_elf_link_hash_table *htab;
2129 htab = _bfd_sparc_elf_hash_table (info);
2130 dynobj = htab->elf.dynobj;
2140 s->size = htab->dynamic_interpreter_size;
2141 s->contents = (unsigned char *) htab->dynamic_interpreter;
2176 srel->size += p->count * SPARC_ELF_RELA_BYTES (htab);
2191 s = htab->sgot;
2192 srel = htab->srelgot;
2198 s->size += SPARC_ELF_WORD_BYTES (htab);
2200 s->size += SPARC_ELF_WORD_BYTES (htab);
2204 srel->size += SPARC_ELF_RELA_BYTES (htab);
2211 if (htab->tls_ldm_got.refcount > 0)
2215 htab->tls_ldm_got.offset = htab->sgot->size;
2216 htab->sgot->size += (2 * SPARC_ELF_WORD_BYTES (htab));
2217 htab->srelgot->size += SPARC_ELF_RELA_BYTES (htab);
2220 htab->tls_ldm_got.offset = -1;
2224 elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info);
2227 && !htab->is_vxworks
2231 if (htab->splt->size > 0)
2232 htab->splt->size += 1 * SPARC_INSN_BYTES;
2239 if (htab->sgot->size >= 0x1000
2252 if (s == htab->splt
2253 || s == htab->sgot
2254 || s == htab->sdynbss
2255 || s == htab->sgotplt)
2317 if (htab->srelplt->size != 0)
2329 SPARC_ELF_RELA_BYTES (htab)))
2335 elf_link_hash_traverse (&htab->elf, readonly_dynrelocs,
2453 struct elf_link_hash_table *htab = elf_hash_table (info);
2456 if (htab->tls_sec == NULL)
2458 return address - htab->tls_size - htab->tls_sec->vma;
2473 struct _bfd_sparc_elf_link_hash_table *htab;
2484 htab = _bfd_sparc_elf_hash_table (info);
2528 r_symndx = SPARC_ELF_R_SYMNDX (htab, rel->r_info);
2581 if (htab->sgot == NULL)
2615 SPARC_ELF_PUT_WORD (htab, output_bfd, relocation,
2616 htab->sgot->contents + off);
2645 s = htab->srelgot;
2648 outrel.r_offset = (htab->sgot->output_section->vma
2649 + htab->sgot->output_offset
2651 outrel.r_info = SPARC_ELF_R_INFO (htab, NULL,
2658 SPARC_ELF_PUT_WORD (htab, output_bfd, relocation,
2659 htab->sgot->contents + off);
2663 relocation = htab->sgot->output_offset + off - got_base;
2699 if (h->plt.offset == (bfd_vma) -1 || htab->splt == NULL)
2707 relocation = (htab->splt->output_section->vma
2708 + htab->splt->output_offset
2855 outrel.r_info = SPARC_ELF_R_INFO (htab, rel, h->dynindx, r_type);
2862 outrel.r_info = SPARC_ELF_R_INFO (htab, NULL,
2873 sec = htab->splt;
2891 osec = htab->elf.text_index_section;
2917 outrel.r_info = SPARC_ELF_R_INFO (htab, rel, indx,
3003 if (htab->sgot == NULL)
3013 if (htab->srelgot == NULL)
3016 SPARC_ELF_PUT_WORD (htab, output_bfd, 0, htab->sgot->contents + off);
3017 outrel.r_offset = (htab->sgot->output_section->vma
3018 + htab->sgot->output_offset + off);
3022 dr_type = SPARC_ELF_TPOFF_RELOC (htab);
3024 dr_type = SPARC_ELF_DTPMOD_RELOC (htab);
3025 if (dr_type == SPARC_ELF_TPOFF_RELOC (htab) && indx == 0)
3029 outrel.r_info = SPARC_ELF_R_INFO (htab, NULL, indx, dr_type);
3030 sparc_elf_append_rela (output_bfd, htab->srelgot, &outrel);
3038 SPARC_ELF_PUT_WORD (htab, output_bfd,
3040 (htab->sgot->contents + off
3041 + SPARC_ELF_WORD_BYTES (htab)));
3045 SPARC_ELF_PUT_WORD (htab, output_bfd, 0,
3046 (htab->sgot->contents + off
3047 + SPARC_ELF_WORD_BYTES (htab)));
3048 outrel.r_info = SPARC_ELF_R_INFO (htab, NULL, indx,
3049 SPARC_ELF_DTPOFF_RELOC (htab));
3050 outrel.r_offset += SPARC_ELF_WORD_BYTES (htab);
3051 sparc_elf_append_rela (output_bfd, htab->srelgot,
3055 else if (dr_type == SPARC_ELF_DTPMOD_RELOC (htab))
3057 SPARC_ELF_PUT_WORD (htab, output_bfd, 0,
3058 (htab->sgot->contents + off
3059 + SPARC_ELF_WORD_BYTES (htab)));
3066 relocation = htab->sgot->output_offset + off - got_base;
3078 off = htab->tls_ldm_got.offset;
3079 htab->tls_ldm_got.offset |= 1;
3116 outrel.r_info = SPARC_ELF_R_INFO (htab, NULL, 0, r_type);
3158 && SPARC_ELF_R_SYMNDX (htab, rel[1].r_info) == r_symndx
3552 struct _bfd_sparc_elf_link_hash_table *htab;
3556 htab = _bfd_sparc_elf_hash_table (info);
3565 got_base = (htab->elf.hgot->root.u.def.value
3566 + htab->elf.hgot->root.u.def.section->output_offset
3567 + htab->elf.hgot->root.u.def.section->output_section->vma);
3572 htab->splt->contents + plt_offset);
3574 htab->splt->contents + plt_offset + 4);
3576 htab->splt->contents + plt_offset + 8);
3578 htab->splt->contents + plt_offset + 12);
3580 htab->splt->contents + plt_offset + 16);
3582 htab->splt->contents + plt_offset + 20);
3587 htab->splt->contents + plt_offset + 24);
3589 htab->splt->contents + plt_offset + 28);
3593 BFD_ASSERT (htab->sgotplt != NULL);
3595 htab->splt->output_section->vma
3596 + htab->splt->output_offset
3598 htab->sgotplt->contents + got_offset);
3603 loc = (htab->srelplt2->contents
3607 rela.r_offset = (htab->splt->output_section->vma
3608 + htab->splt->output_offset
3610 rela.r_info = ELF32_R_INFO (htab->elf.hgot->indx, R_SPARC_HI22);
3617 rela.r_info = ELF32_R_INFO (htab->elf.hgot->indx, R_SPARC_LO10);
3622 rela.r_offset = (htab->sgotplt->output_section->vma
3623 + htab->sgotplt->output_offset
3625 rela.r_info = ELF32_R_INFO (htab->elf.hplt->indx, R_SPARC_32);
3641 struct _bfd_sparc_elf_link_hash_table *htab;
3644 htab = _bfd_sparc_elf_hash_table (info);
3645 dynobj = htab->elf.dynobj;
3661 splt = htab->splt;
3662 srela = htab->srelplt;
3666 if (htab->is_vxworks)
3669 rela_index = ((h->plt.offset - htab->plt_header_size)
3670 / htab->plt_entry_size);
3682 rela.r_offset = (htab->sgotplt->output_section->vma
3683 + htab->sgotplt->output_offset
3690 rela_index = SPARC_ELF_BUILD_PLT_ENTRY (htab, output_bfd, splt,
3708 rela.r_info = SPARC_ELF_R_INFO (htab, NULL, h->dynindx, R_SPARC_JMP_SLOT);
3743 sgot = htab->sgot;
3744 srela = htab->srelgot;
3761 rela.r_info = SPARC_ELF_R_INFO (htab, NULL, 0, R_SPARC_RELATIVE);
3768 rela.r_info = SPARC_ELF_R_INFO (htab, NULL, h->dynindx, R_SPARC_GLOB_DAT);
3772 SPARC_ELF_PUT_WORD (htab, output_bfd, 0,
3792 rela.r_info = SPARC_ELF_R_INFO (htab, NULL, h->dynindx, R_SPARC_COPY);
3801 || (!htab->is_vxworks
3802 && (h == htab->elf.hgot || h == htab->elf.hplt)))
3815 struct _bfd_sparc_elf_link_hash_table *htab;
3822 htab = _bfd_sparc_elf_hash_table (info);
3835 if (htab->is_vxworks && dyn.d_tag == DT_RELASZ)
3839 if (htab->srelplt)
3841 dyn.d_un.d_val -= htab->srelplt->size;
3845 else if (htab->is_vxworks && dyn.d_tag == DT_PLTGOT)
3849 if (htab->sgotplt)
3851 dyn.d_un.d_val = (htab->sgotplt->output_section->vma
3852 + htab->sgotplt->output_offset);
3905 struct _bfd_sparc_elf_link_hash_table *htab;
3910 htab = _bfd_sparc_elf_hash_table (info);
3913 got_base = (htab->elf.hgot->root.u.def.section->output_section->vma
3914 + htab->elf.hgot->root.u.def.section->output_offset
3915 + htab->elf.hgot->root.u.def.value);
3920 htab->splt->contents);
3923 htab->splt->contents + 4);
3926 htab->splt->contents + 8);
3929 htab->splt->contents + 12);
3932 htab->splt->contents + 16);
3934 loc = htab->srelplt2->contents;
3937 rela.r_offset = (htab->splt->output_section->vma
3938 + htab->splt->output_offset);
3939 rela.r_info = ELF32_R_INFO (htab->elf.hgot->indx, R_SPARC_HI22);
3946 rela.r_info = ELF32_R_INFO (htab->elf.hgot->indx, R_SPARC_LO10);
3953 while (loc < htab->srelplt2->contents + htab->srelplt2->size)
3959 rel.r_info = ELF32_R_INFO (htab->elf.hgot->indx, R_SPARC_HI22);
3965 rel.r_info = ELF32_R_INFO (htab->elf.hgot->indx, R_SPARC_LO10);
3971 rel.r_info = ELF32_R_INFO (htab->elf.hplt->indx, R_SPARC_32);
3982 struct _bfd_sparc_elf_link_hash_table *htab;
3985 htab = _bfd_sparc_elf_hash_table (info);
3988 htab->splt->contents + i * 4);
3996 struct _bfd_sparc_elf_link_hash_table *htab;
3998 htab = _bfd_sparc_elf_hash_table (info);
3999 dynobj = htab->elf.dynobj;
4016 if (htab->is_vxworks)
4025 memset (splt->contents, 0, htab->plt_header_size);
4033 = (htab->is_vxworks || !ABI_64_P (output_bfd))
4034 ? 0 : htab->plt_entry_size;
4039 if (htab->sgot && htab->sgot->size > 0)
4045 SPARC_ELF_PUT_WORD (htab, output_bfd, val, htab->sgot->contents);
4048 if (htab->sgot)
4049 elf_section_data (htab->sgot->output_section)->this_hdr.sh_entsize =
4050 SPARC_ELF_WORD_BYTES (htab);