Lines Matching refs:toc
139 /* TOC base pointers offset from start of TOC. */
952 /* 16 bit TOC-relative relocation. */
954 /* R_PPC64_TOC16 47 half16* S + A - .TOC. */
969 /* 16 bit TOC-relative relocation without overflow. */
971 /* R_PPC64_TOC16_LO 48 half16 #lo (S + A - .TOC.) */
986 /* 16 bit TOC-relative relocation, high 16 bits. */
988 /* R_PPC64_TOC16_HI 49 half16 #hi (S + A - .TOC.) */
1003 /* 16 bit TOC-relative relocation, high 16 bits, plus 1 if the
1007 /* R_PPC64_TOC16_HA 50 half16 #ha (S + A - .TOC.) */
1022 /* 64-bit relocation; insert value of TOC base (.TOC.). */
1024 /* R_PPC64_TOC 51 doubleword64 .TOC. */
1687 to the first entry relative to the TOC base (r2). */
1749 first entry relative to the TOC base (r2). */
1810 the offset to the entry relative to the TOC base (r2). */
1871 offset to the entry relative to the TOC base (r2). */
2649 /* Subtract the TOC base address. */
2672 /* Subtract the TOC base address. */
2737 automatic multiple TOC/GOT sections, where the TOC base can vary
2738 from one input file to another. After partitioning into TOC groups
2798 /* Nonzero if this bfd has small toc/got relocs, ie. that expect
2802 /* Set if toc/got ha relocs detected not using r2, or lo reloc
2941 { STRING_COMMA_LEN (".toc"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
2969 /* An array for toc sections, indexed by offset/8. */
2972 /* Specifies the relocation symbol index used at a given toc offset. */
2977 } toc;
3557 (b) is the tricky one since you need to known the toc
3631 . .quad .TOC.@tocbase
3650 . addis 11,2,Lfoo@toc@ha # is slightly optimized, but
3651 . addi 11,11,Lfoo@toc@l # this is the general idea
3747 . addis %r11,%r2,xxx@toc@ha
3748 . ld %r12,xxx@toc@l(%r11)
3755 "addi %r11,%r11,xxx@toc@l" will be inserted before the "mtctr".
3757 . addis %r11,%r2,xxx@toc@ha
3758 . ld %r12,xxx+0@toc@l(%r11)
3760 . ld %r2,xxx+8@toc@l(%r11)
3761 . ld %r11,xxx+16@toc@l(%r11)
3765 code to adjust the value and save r2 to support multiple toc sections.
3774 . addis %r11,%r2,xxx@toc@ha
3775 . ld %r12,xxx@toc@l(%r11)
3877 /* Whether global opd/toc sym has been adjusted or not.
3879 should be set for all globals defined in any opd/toc section. */
3885 /* Contexts in which symbol is used in the GOT (or TOC).
3898 #define TLS_EXPLICIT 32 /* Marks TOC section TLS relocs. */
3929 /* Along with elf_gp, specifies the TOC pointer used in this group. */
3933 /* Temp used when calculating TOC pointers. */
3975 /* Support for multiple toc sections. */
4003 /* Nonzero if this section has any toc or got relocs. */
4007 the toc or got. */
4339 the start of the output TOC section. */
5046 && strcmp (eh->elf.root.root.string, ".TOC.") == 0)
5092 toc adjusting stubs when calling functions defined there. */
5616 ppc64_sec->u.toc.symndx = bfd_zalloc (abfd, amt);
5617 if (ppc64_sec->u.toc.symndx == NULL)
5620 ppc64_sec->u.toc.add = bfd_zalloc (abfd, amt);
5621 if (ppc64_sec->u.toc.add == NULL)
5627 ppc64_sec->u.toc.symndx[rel->r_offset / 8] = r_symndx;
5628 ppc64_sec->u.toc.add[rel->r_offset / 8] = rel->r_addend;
5633 ppc64_sec->u.toc.symndx[rel->r_offset / 8 + 1] = -1;
5635 ppc64_sec->u.toc.symndx[rel->r_offset / 8 + 1] = -2;
6927 /* Make .TOC. defined so as to prevent it being made dynamic.
7285 error, 2 on a toc GD type suitable for optimization, 3 on a toc LD
7313 /* Look inside a TOC section too. */
7323 r_symndx = ppc64_elf_section_data (sec)->u.toc.symndx[off / 8];
7324 next_r = ppc64_elf_section_data (sec)->u.toc.symndx[off / 8 + 1];
7328 *toc_addend = ppc64_elf_section_data (sec)->u.toc.add[off / 8];
8150 /* Make two passes over the relocs. On the first pass, mark toc
8162 asection *toc = bfd_get_section_by_name (ibfd, ".toc");
8333 if (sym_sec == NULL || sym_sec != toc)
8336 /* Mark this toc entry as referenced by a TLS
8341 toc_ref = bfd_zmalloc (toc->output_section->rawsize / 8);
8352 BFD_ASSERT (value < toc->size
8353 && toc->output_offset % 8 == 0);
8354 toc_ref_index = (value + toc->output_offset) / 8;
8373 || sec != toc
8375 || !toc_ref[(rel->r_offset + toc->output_offset) / 8])
8388 || sec != toc
8390 || !toc_ref[(rel->r_offset + toc->output_offset) / 8])
8433 /* Check for toc tls entries. */
8566 the values of any global symbols in a toc section that has been
8567 edited. Globals in toc sections should be a rarity, so this function
8568 sets a flag if any are found in toc sections other than the one just
8573 asection *toc;
8595 if (eh->elf.root.u.def.section == toc_inf->toc)
8597 if (eh->elf.root.u.def.value > toc_inf->toc->rawsize)
8598 i = toc_inf->toc->rawsize >> 3;
8605 (_("%s defined on removed toc entry"), eh->elf.root.root.string);
8615 else if (strcmp (eh->elf.root.u.def.section->name, ".toc") == 0)
8621 /* Return TRUE iff INSN is one we expect on a _LO variety toc/got reloc. */
8647 /* Examine all relocs referencing .toc sections in order to remove
8648 unused .toc entries. */
8661 asection *toc, *sec;
8672 toc = bfd_get_section_by_name (ibfd, ".toc");
8673 if (toc == NULL
8674 || toc->size == 0
8675 || toc->sec_info_type == SEC_INFO_TYPE_JUST_SYMS
8676 || discarded_section (toc))
8699 /* Run through the relocs to see which toc entries might be
8730 if (sym_sec != toc)
8739 if (val >= toc->size)
8742 /* Anything in the toc ought to be aligned to 8 bytes.
8749 skip = bfd_zmalloc (sizeof (*skip) * (toc->size + 15) / 8);
8765 . addis rx,2,addr@toc@ha
8766 . addi ry,rx,addr@toc@l
8767 toc pointer. This then means
8768 that the word storing "addr" in the toc is no longer needed. */
8771 && toc->output_section->rawsize < (bfd_vma) 1 << 31
8772 && toc->reloc_count != 0)
8774 /* Read toc relocs. */
8775 toc_relocs = _bfd_elf_link_read_relocs (ibfd, toc, NULL, NULL,
8780 for (rel = toc_relocs; rel < toc_relocs + toc->reloc_count; ++rel)
8820 /* We don't yet know the exact toc pointer value, but we
8821 know it will be somewhere in the toc section. Don't
8822 optimize if the difference from any possible toc
8824 addr = toc->output_section->vma + TOC_BASE_OFF;
8828 addr = toc->output_section->vma + toc->output_section->rawsize;
8834 skip = bfd_zmalloc (sizeof (*skip) * (toc->size + 15) / 8);
8847 used = bfd_zmalloc (sizeof (*used) * (toc->size + 7) / 8);
8859 && elf_section_data (toc)->relocs != toc_relocs)
8866 /* Now check all kept sections that might reference the toc.
8867 Check the toc itself last. */
8868 for (sec = (ibfd->sections == toc && toc->next ? toc->next
8871 sec = (sec == toc ? NULL
8872 : sec->next == NULL ? toc
8873 : sec->next == toc && toc->next ? toc->next
8893 /* Mark toc entries referenced as used. */
8957 (_("%P: %H: toc optimization is not supported for"
8971 /* In case we're taking addresses of toc entries. */
8987 if (sym_sec != toc)
8996 if (val >= toc->size)
9029 if (sec != toc)
9031 /* For the toc section, we only mark as used if this
9050 /* Merge the used and skip arrays. Assume that TOC
9054 drop < skip + (toc->size + 7) / 8;
9082 /* Shuffle the toc contents, and at the same time convert the
9084 if (!bfd_malloc_and_get_section (ibfd, toc, &contents))
9087 elf_section_data (toc)->this_hdr.contents = contents;
9090 src < contents + toc->size;
9102 toc->rawsize = toc->size;
9103 toc->size = src - contents - off;
9105 /* Adjust addends for relocs against the toc section sym,
9147 if (sym_sec != toc)
9161 if (val > toc->rawsize)
9162 val = toc->rawsize;
9186 "optimized away TOC entry\n"),
9208 /* We shouldn't have local or global symbols defined in the TOC,
9215 && bfd_section_from_elf_index (ibfd, sym->st_shndx) == toc)
9219 if (sym->st_value > toc->rawsize)
9220 i = toc->rawsize >> 3;
9228 (_("%s defined on removed toc entry"),
9240 /* Adjust any global syms defined in this toc input section. */
9243 toc_inf.toc = toc;
9250 if (toc->reloc_count != 0)
9256 /* Remove unused toc relocs, and adjust those we keep. */
9258 toc_relocs = _bfd_elf_link_read_relocs (ibfd, toc, NULL, NULL,
9264 for (rel = toc_relocs; rel < toc_relocs + toc->reloc_count; ++rel)
9273 else if (!dec_dynrel_count (rel->r_info, toc, info,
9277 elf_section_data (toc)->relocs = toc_relocs;
9278 toc->reloc_count = wrel - toc_relocs;
9279 rel_hdr = _bfd_elf_single_rel_hdr (toc);
9281 rel_hdr->sh_size = toc->reloc_count * sz;
9285 && elf_section_data (toc)->relocs != toc_relocs)
9302 /* Return true iff input section I references the TOC using
9347 /* This function merges got entries in the same toc group. */
10150 stale zero toc entry. To avoid this we need some sort of acquire
10152 toc word seem to appear to depend on the load of the function entry
10480 /* Support linking -R objects. Get the toc pointer from the
10491 info->callbacks->einfo (_("%P: cannot find opd entry toc for `%T'\n"),
11182 /* The linker repeatedly calls this function for each TOC input section
11183 and linker generated GOT section. Group input bfds such that the toc
11197 /* Keep track of the first .toc or .got section for this input bfd. */
11218 /* toc_curr is the base address of this toc group. Set elf_gp
11220 output toc base plus 0x8000. Making the input elf_gp an
11221 offset allows us to move the toc as a whole without
11227 file .toc and .got together. */
11238 a toc group, and toc_curr is used to track the old elf_gp.
11305 /* Merge global sym got entries within a toc group. */
11462 /* Set up for second pass over toc sections to recalculate elf_gp
11477 /* After the second pass, toc_curr tracks the TOC offset used
11482 /* No toc references were found in ISEC. If the code in ISEC makes no
11483 calls, then there's no need to use toc adjusting stubs when branching
11498 /* We know none of our code bearing sections will need toc stubs. */
11617 /* If the called function uses the toc, we need a stub. */
11639 tested, we can't say for sure that no toc adjusting stubs
11644 /* Branches to another section that itself doesn't have any TOC
11727 valid toc pointer. Exclude .fixup for the linux kernel.
11738 /* Make all sections use the TOC assigned for this object file.
11749 /* Check that all .init and .fini sections use the same toc, if they
11750 have toc relocs. */
11780 /* Make sure the whole pasted function uses the same toc offset. */
12202 /* Check whether we need a TOC adjusting stub.
12207 fact a call needing a TOC adjustment. */
12496 /* The TOC consists of sections .got, .toc, .tocbss, .plt in that
12497 order. The TOC starts where the first of these sections starts. */
12500 s = bfd_get_section_by_name (obfd, ".toc");
12508 o references to TOC base (SYM@toc / TOC[tc0]) without a
12509 .toc directive
12511 o --gc-sections and empty TOC sections
12559 _bfd_generic_link_add_one_symbol (info, obfd, ".TOC.", BSF_GLOBAL,
12884 " toc adjust %lu\n"
12886 " long toc adj %lu\n"
12888 " plt call toc %lu\n"
12939 if (strcmp (".toc", sec->name) == 0)
13057 proper TOC base to use. */
13180 /* Check for toc tls entries. */
13207 /* R_PPC64_TLS is OK against a symbol in the TOC. */
13252 /* Check for toc tls entries. */
13616 . 0: addis 2,12,.TOC.-0b@ha
13617 . addi 2,2,.TOC.-0b@l
13619 . lis 2,.TOC.@ha
13620 . addi 2,2,.TOC.@l
13621 if .TOC. is in range. */
13693 /* Calls to functions with a different TOC, such as calls to
13694 shared objects, need to alter the TOC pointer. This is
13697 will be replaced with an instruction to restore the TOC
13758 /* Allow crt1 branch to go via a toc adjusting
13794 (_("%P: %H: call to `%T' lacks nop, can't restore toc; "
13799 (_("%P: %H: call to `%T' lacks nop, can't restore toc; "
13800 "(-mcmodel=small toc adjust stub)\n"),
14182 /* Relocation value is TOC base. */
14194 /* TOC16 relocs. We want the offset relative to the TOC base,
14195 which is the address of the start of the TOC plus 0x8000.
14196 The TOC consists of sections .got, .toc, .tocbss, and .plt,
14556 /* Multi-instruction sequences that access the TOC can be