Lines Matching full:elfcpp
27 #include "elfcpp.h"
91 typedef Output_data_reloc<elfcpp::SHT_RELA, true, size, false> Reloc_section;
222 typename elfcpp::Elf_types<size>::Elf_Addr got_address,
223 typename elfcpp::Elf_types<size>::Elf_Addr plt_address)
230 typename elfcpp::Elf_types<size>::Elf_Addr got_address,
231 typename elfcpp::Elf_types<size>::Elf_Addr plt_address,
243 typename elfcpp::Elf_types<size>::Elf_Addr got_address,
244 typename elfcpp::Elf_types<size>::Elf_Addr plt_address,
245 typename elfcpp::Elf_types<size>::Elf_Addr got_base,
258 typename elfcpp::Elf_types<size>::Elf_Addr got_addr,
259 typename elfcpp::Elf_types<size>::Elf_Addr plt_addr)
264 typename elfcpp::Elf_types<size>::Elf_Addr got_address,
265 typename elfcpp::Elf_types<size>::Elf_Addr plt_address,
272 typename elfcpp::Elf_types<size>::Elf_Addr got_address,
273 typename elfcpp::Elf_types<size>::Elf_Addr plt_address,
274 typename elfcpp::Elf_types<size>::Elf_Addr got_base,
367 typename elfcpp::Elf_types<size>::Elf_Addr got_addr,
368 typename elfcpp::Elf_types<size>::Elf_Addr plt_addr);
372 typename elfcpp::Elf_types<size>::Elf_Addr got_address,
373 typename elfcpp::Elf_types<size>::Elf_Addr plt_address,
380 typename elfcpp::Elf_types<size>::Elf_Addr got_address,
381 typename elfcpp::Elf_types<size>::Elf_Addr plt_address,
382 typename elfcpp::Elf_types<size>::Elf_Addr got_base,
419 typedef Output_data_reloc<elfcpp::SHT_RELA, true, size, false> Reloc_section;
425 rela_irelative_(NULL), copy_relocs_(elfcpp::R_X86_64_COPY),
486 typename elfcpp::Elf_types<size>::Elf_Addr view_address,
513 typename elfcpp::Elf_types<size>::Elf_Off offset_in_output_section,
516 typename elfcpp::Elf_types<size>::Elf_Addr view_address,
536 gold_assert(r_type == elfcpp::R_X86_64_TLSDESC);
636 typename elfcpp::Elf_types<size>::Elf_Addr r_offset,
638 typename elfcpp::Elf_types<size>::Elf_Swxword r_addend,
641 typename elfcpp::Elf_types<size>::Elf_Addr address,
711 const elfcpp::Rela<size, false>& reloc, unsigned int r_type,
712 const elfcpp::Sym<size, false>& lsym,
720 const elfcpp::Rela<size, false>& reloc, unsigned int r_type,
729 const elfcpp::Rela<size, false>& reloc,
731 const elfcpp::Sym<size, false>& lsym);
739 const elfcpp::Rela<size, false>& reloc,
788 size_t relnum, const elfcpp::Rela<size, false>&,
791 unsigned char*, typename elfcpp::Elf_types<size>::Elf_Addr,
798 size_t relnum, const elfcpp::Rela<size, false>&,
801 unsigned char*, typename elfcpp::Elf_types<size>::Elf_Addr,
808 const elfcpp::Rela<size, false>&, unsigned int r_type,
809 typename elfcpp::Elf_types<size>::Elf_Addr value,
811 typename elfcpp::Elf_types<size>::Elf_Addr,
818 const elfcpp::Rela<size, false>&, unsigned int r_type,
819 typename elfcpp::Elf_types<size>::Elf_Addr value,
827 const elfcpp::Rela<size, false>&, unsigned int r_type,
828 typename elfcpp::Elf_types<size>::Elf_Addr value,
830 typename elfcpp::Elf_types<size>::Elf_Addr,
837 const elfcpp::Rela<size, false>&, unsigned int r_type,
838 typename elfcpp::Elf_types<size>::Elf_Addr value,
846 const elfcpp::Rela<size, false>&, unsigned int r_type,
847 typename elfcpp::Elf_types<size>::Elf_Addr value,
855 const elfcpp::Rela<size, false>&, unsigned int r_type,
856 typename elfcpp::Elf_types<size>::Elf_Addr value,
951 Symbol* sym, const elfcpp::Rela<size, false>& reloc)
1007 Copy_relocs<elfcpp::SHT_RELA, size, false> copy_relocs_;
1023 elfcpp::EM_X86_64, // machine_code
1036 elfcpp::SHN_UNDEF, // small_common_shndx
1037 elfcpp::SHN_X86_64_LCOMMON, // large_common_shndx
1039 elfcpp::SHF_X86_64_LARGE, // large_common_section_flags
1050 elfcpp::EM_X86_64, // machine_code
1063 elfcpp::SHN_UNDEF, // small_common_shndx
1064 elfcpp::SHN_X86_64_LCOMMON, // large_common_shndx
1066 elfcpp::SHF_X86_64_LARGE, // large_common_section_flags
1079 if ((os->flags() & elfcpp::SHF_X86_64_LARGE) != 0)
1106 layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
1107 (elfcpp::SHF_ALLOC
1108 | elfcpp::SHF_WRITE),
1112 layout->add_output_section_data(".got.plt", elfcpp::SHT_PROGBITS,
1113 (elfcpp::SHF_ALLOC
1114 | elfcpp::SHF_WRITE),
1132 0, 0, elfcpp::STT_OBJECT,
1133 elfcpp::STB_LOCAL,
1134 elfcpp::STV_HIDDEN, 0,
1140 layout->add_output_section_data(".got.plt", elfcpp::SHT_PROGBITS,
1141 (elfcpp::SHF_ALLOC
1142 | elfcpp::SHF_WRITE),
1149 layout->add_output_section_data(".got.plt", elfcpp::SHT_PROGBITS,
1150 (elfcpp::SHF_ALLOC
1151 | elfcpp::SHF_WRITE),
1169 layout->add_output_section_data(".rela.dyn", elfcpp::SHT_RELA,
1170 elfcpp::SHF_ALLOC, this->rela_dyn_,
1191 layout->add_output_section_data(".rela.dyn", elfcpp::SHT_RELA,
1192 elfcpp::SHF_ALLOC, this->rela_irelative_,
1216 elfcpp::Swap<64, false>::writeval(got_view, dynamic_addr);
1228 layout->add_output_section_data(".rela.plt", elfcpp::SHT_RELA,
1229 elfcpp::SHF_ALLOC, this->rel_,
1257 if (gsym->type() == elfcpp::STT_GNU_IFUNC
1341 elfcpp::R_X86_64_IRELATIVE,
1356 if (gsym->type() == elfcpp::STT_GNU_IFUNC
1360 rela->add_symbolless_global_addend(gsym, elfcpp::R_X86_64_IRELATIVE,
1366 this->rel_->add_global(gsym, elfcpp::R_X86_64_JUMP_SLOT, this->got_plt_,
1381 layout->add_output_section_data(".rela.plt", elfcpp::SHT_RELA,
1382 elfcpp::SHF_ALLOC, this->tlsdesc_rel_,
1404 layout->add_output_section_data(".rela.plt", elfcpp::SHT_RELA,
1405 elfcpp::SHF_ALLOC, this->irelative_rel_,
1420 elfcpp::STT_NOTYPE, elfcpp::STB_GLOBAL,
1421 elfcpp::STV_HIDDEN, 0, false, true);
1425 elfcpp::STT_NOTYPE, elfcpp::STB_GLOBAL,
1426 elfcpp::STV_HIDDEN, 0, true, true);
1439 if (gsym->type() == elfcpp::STT_GNU_IFUNC
1487 typename elfcpp::Elf_types<size>::Elf_Addr got_address,
1488 typename elfcpp::Elf_types<size>::Elf_Addr plt_address)
1492 elfcpp::Swap_unaligned<32, false>::writeval(pov + 2,
1495 elfcpp::Swap<32, false>::writeval(pov + 8,
1519 typename elfcpp::Elf_types<size>::Elf_Addr got_address,
1520 typename elfcpp::Elf_types<size>::Elf_Addr plt_address,
1533 elfcpp::Swap_unaligned<32, false>::writeval(pov + 2,
1536 elfcpp::Swap_unaligned<32, false>::writeval(pov + 7, plt_index);
1537 elfcpp::Swap<32, false>::writeval(pov + 12,
1563 typename elfcpp::Elf_types<size>::Elf_Addr got_address,
1564 typename elfcpp::Elf_types<size>::Elf_Addr plt_address,
1565 typename elfcpp::Elf_types<size>::Elf_Addr got_base,
1570 elfcpp::Swap_unaligned<32, false>::writeval(pov + 2,
1574 elfcpp::Swap_unaligned<32, false>::writeval(pov + 8,
1595 (elfcpp::DW_EH_PE_pcrel // FDE encoding.
1596 | elfcpp::DW_EH_PE_sdata4),
1597 elfcpp::DW_CFA_def_cfa, 7, 8, // DW_CFA_def_cfa: r7 (rsp) ofs 8.
1598 elfcpp::DW_CFA_offset + 16, 1,// DW_CFA_offset: r16 (rip) at cfa-8.
1599 elfcpp::DW_CFA_nop, // Align to 16 bytes.
1600 elfcpp::DW_CFA_nop
1610 elfcpp::DW_CFA_def_cfa_offset, 16, // DW_CFA_def_cfa_offset: 16.
1611 elfcpp::DW_CFA_advance_loc + 6, // Advance 6 to __PLT__ + 6.
1612 elfcpp::DW_CFA_def_cfa_offset, 24, // DW_CFA_def_cfa_offset: 24.
1613 elfcpp::DW_CFA_advance_loc + 10, // Advance 10 to __PLT__ + 16.
1614 elfcpp::DW_CFA_def_cfa_expression, // DW_CFA_def_cfa_expression.
1616 elfcpp::DW_OP_breg7, 8, // Push %rsp + 8.
1617 elfcpp::DW_OP_breg16, 0, // Push %rip.
1618 elfcpp::DW_OP_lit15, // Push 0xf.
1619 elfcpp::DW_OP_and, // & (%rip & 0xf).
1620 elfcpp::DW_OP_lit11, // Push 0xb.
1621 elfcpp::DW_OP_ge, // >= ((%rip & 0xf) >= 0xb)
1622 elfcpp::DW_OP_lit3, // Push 3.
1623 elfcpp::DW_OP_shl, // << (((%rip & 0xf) >= 0xb) << 3)
1624 elfcpp::DW_OP_plus, // + ((((%rip&0xf)>=0xb)<<3)+%rsp+8
1625 elfcpp::DW_CFA_nop, // Align to 32 bytes.
1626 elfcpp::DW_CFA_nop,
1627 elfcpp::DW_CFA_nop,
1628 elfcpp::DW_CFA_nop
1656 typename elfcpp::Elf_types<size>::Elf_Addr plt_address = this->address();
1658 typename elfcpp::Elf_types<size>::Elf_Addr got_base = this->got_->address();
1662 typename elfcpp::Elf_types<size>::Elf_Addr got_address
1690 elfcpp::Swap<64, false>::writeval(got_pov,
1728 layout->add_output_section_data(".plt", elfcpp::SHT_PROGBITS,
1729 (elfcpp::SHF_ALLOC
1730 | elfcpp::SHF_EXECINSTR),
1824 layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
1825 (elfcpp::SHF_ALLOC
1826 | elfcpp::SHF_WRITE),
1832 layout->add_output_section_data(".got.plt", elfcpp::SHT_PROGBITS,
1833 (elfcpp::SHF_ALLOC
1834 | elfcpp::SHF_WRITE),
1843 0, 0, elfcpp::STT_OBJECT,
1844 elfcpp::STB_LOCAL,
1845 elfcpp::STV_HIDDEN, 0,
1852 layout->add_output_section_data(".got.plt", elfcpp::SHT_PROGBITS,
1853 elfcpp::SHF_ALLOC | elfcpp::SHF_WRITE,
1860 layout->add_output_section_data(".got.plt", elfcpp::SHT_PROGBITS,
1861 elfcpp::SHF_ALLOC | elfcpp::SHF_WRITE,
1875 layout->add_output_section_data(".plt", elfcpp::SHT_PROGBITS,
1876 elfcpp::SHF_ALLOC | elfcpp::SHF_EXECINSTR,
1908 rela_dyn->add_local_relative(obj, r_sym, elfcpp::R_X86_64_RELATIVE,
1912 rela_dyn->add_local(obj, r_sym, elfcpp::R_X86_64_TPOFF64,
1917 rela_dyn->add_local(obj, r_sym, elfcpp::R_X86_64_DTPMOD64,
1923 // rela_dyn->add_target_specific(elfcpp::R_X86_64_TLSDESC, arg,
1952 || gsym->type() == elfcpp::STT_GNU_IFUNC)
1953 rela_dyn->add_global(gsym, elfcpp::R_X86_64_GLOB_DAT,
1956 rela_dyn->add_global_relative(gsym, elfcpp::R_X86_64_RELATIVE,
1961 rela_dyn->add_global_relative(gsym, elfcpp::R_X86_64_TPOFF64,
1966 rela_dyn->add_global_relative(gsym, elfcpp::R_X86_64_DTPMOD64,
1968 rela_dyn->add_global_relative(gsym, elfcpp::R_X86_64_DTPOFF64,
1973 rela_dyn->add_global_relative(gsym, elfcpp::R_X86_64_TLSDESC,
2032 elfcpp::STT_TLS,
2033 elfcpp::STB_LOCAL,
2034 elfcpp::STV_HIDDEN, 0,
2077 rela_dyn->add_local(object, 0, elfcpp::R_X86_64_DTPMOD64, got,
2100 case elfcpp::R_X86_64_TLSGD:
2101 case elfcpp::R_X86_64_GOTPC32_TLSDESC:
2102 case elfcpp::R_X86_64_TLSDESC_CALL:
2111 case elfcpp::R_X86_64_TLSLD:
2117 case elfcpp::R_X86_64_DTPOFF32:
2118 case elfcpp::R_X86_64_DTPOFF64:
2122 case elfcpp::R_X86_64_GOTTPOFF:
2131 case elfcpp::R_X86_64_TPOFF32:
2149 case elfcpp::R_X86_64_NONE:
2150 case elfcpp::R_X86_64_GNU_VTINHERIT:
2151 case elfcpp::R_X86_64_GNU_VTENTRY:
2152 case elfcpp::R_X86_64_GOTPC32:
2153 case elfcpp::R_X86_64_GOTPC64:
2157 case elfcpp::R_X86_64_64:
2158 case elfcpp::R_X86_64_32:
2159 case elfcpp::R_X86_64_32S:
2160 case elfcpp::R_X86_64_16:
2161 case elfcpp::R_X86_64_8:
2164 case elfcpp::R_X86_64_PC64:
2165 case elfcpp::R_X86_64_PC32:
2166 case elfcpp::R_X86_64_PC32_BND:
2167 case elfcpp::R_X86_64_PC16:
2168 case elfcpp::R_X86_64_PC8:
2169 case elfcpp::R_X86_64_GOTOFF64:
2172 case elfcpp::R_X86_64_PLT32:
2173 case elfcpp::R_X86_64_PLT32_BND:
2174 case elfcpp::R_X86_64_PLTOFF64:
2177 case elfcpp::R_X86_64_GOT64:
2178 case elfcpp::R_X86_64_GOT32:
2179 case elfcpp::R_X86_64_GOTPCREL64:
2180 case elfcpp::R_X86_64_GOTPCREL:
2181 case elfcpp::R_X86_64_GOTPLT64:
2185 case elfcpp::R_X86_64_TLSGD: // Global-dynamic
2186 case elfcpp::R_X86_64_GOTPC32_TLSDESC: // Global-dynamic (from ~oliva url)
2187 case elfcpp::R_X86_64_TLSDESC_CALL:
2188 case elfcpp::R_X86_64_TLSLD: // Local-dynamic
2189 case elfcpp::R_X86_64_DTPOFF32:
2190 case elfcpp::R_X86_64_DTPOFF64:
2191 case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
2192 case elfcpp::R_X86_64_TPOFF32: // Local-exec
2195 case elfcpp::R_X86_64_COPY:
2196 case elfcpp::R_X86_64_GLOB_DAT:
2197 case elfcpp::R_X86_64_JUMP_SLOT:
2198 case elfcpp::R_X86_64_RELATIVE:
2199 case elfcpp::R_X86_64_IRELATIVE:
2200 case elfcpp::R_X86_64_TPOFF64:
2201 case elfcpp::R_X86_64_DTPMOD64:
2202 case elfcpp::R_X86_64_TLSDESC:
2203 case elfcpp::R_X86_64_SIZE32:
2204 case elfcpp::R_X86_64_SIZE64:
2242 case elfcpp::R_X86_64_RELATIVE:
2243 case elfcpp::R_X86_64_IRELATIVE:
2244 case elfcpp::R_X86_64_GLOB_DAT:
2245 case elfcpp::R_X86_64_JUMP_SLOT:
2246 case elfcpp::R_X86_64_DTPMOD64:
2247 case elfcpp::R_X86_64_DTPOFF64:
2248 case elfcpp::R_X86_64_TPOFF64:
2249 case elfcpp::R_X86_64_64:
2250 case elfcpp::R_X86_64_COPY:
2254 case elfcpp::R_X86_64_PC32:
2255 case elfcpp::R_X86_64_PC32_BND:
2264 case elfcpp::R_X86_64_32:
2266 if (size == 32 && r_type == elfcpp::R_X86_64_32)
2279 case elfcpp::R_X86_64_32:
2282 case elfcpp::R_X86_64_PC32:
2285 case elfcpp::R_X86_64_PC32_BND:
2313 case elfcpp::R_X86_64_NONE:
2344 const elfcpp::Rela<size, false>& reloc,
2346 const elfcpp::Sym<size, false>& lsym,
2353 bool is_ifunc = lsym.get_st_type() == elfcpp::STT_GNU_IFUNC;
2356 unsigned int r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
2362 case elfcpp::R_X86_64_NONE:
2363 case elfcpp::R_X86_64_GNU_VTINHERIT:
2364 case elfcpp::R_X86_64_GNU_VTENTRY:
2367 case elfcpp::R_X86_64_64:
2376 unsigned int r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
2380 ? elfcpp::R_X86_64_RELATIVE64
2381 : elfcpp::R_X86_64_RELATIVE),
2388 case elfcpp::R_X86_64_32:
2389 case elfcpp::R_X86_64_32S:
2390 case elfcpp::R_X86_64_16:
2391 case elfcpp::R_X86_64_8:
2399 if (size == 32 && r_type == elfcpp::R_X86_64_32)
2401 unsigned int r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
2404 elfcpp::R_X86_64_RELATIVE,
2414 unsigned int r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
2415 if (lsym.get_st_type() != elfcpp::STT_SECTION)
2438 case elfcpp::R_X86_64_PC64:
2439 case elfcpp::R_X86_64_PC32:
2440 case elfcpp::R_X86_64_PC32_BND:
2441 case elfcpp::R_X86_64_PC16:
2442 case elfcpp::R_X86_64_PC8:
2445 case elfcpp::R_X86_64_PLT32:
2446 case elfcpp::R_X86_64_PLT32_BND:
2451 case elfcpp::R_X86_64_GOTPC32:
2452 case elfcpp::R_X86_64_GOTOFF64:
2453 case elfcpp::R_X86_64_GOTPC64:
2454 case elfcpp::R_X86_64_PLTOFF64:
2461 case elfcpp::R_X86_64_GOT64:
2462 case elfcpp::R_X86_64_GOT32:
2463 case elfcpp::R_X86_64_GOTPCREL64:
2464 case elfcpp::R_X86_64_GOTPCREL:
2465 case elfcpp::R_X86_64_GOTPLT64:
2469 unsigned int r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
2487 if (r_type != elfcpp::R_X86_64_GOT32)
2492 elfcpp::R_X86_64_RELATIVE,
2499 gold_assert(lsym.get_st_type() != elfcpp::STT_SECTION);
2511 case elfcpp::R_X86_64_COPY:
2512 case elfcpp::R_X86_64_GLOB_DAT:
2513 case elfcpp::R_X86_64_JUMP_SLOT:
2514 case elfcpp::R_X86_64_RELATIVE:
2515 case elfcpp::R_X86_64_IRELATIVE:
2517 case elfcpp::R_X86_64_TPOFF64:
2518 case elfcpp::R_X86_64_DTPMOD64:
2519 case elfcpp::R_X86_64_TLSDESC:
2525 case elfcpp::R_X86_64_TLSGD: // Global-dynamic
2526 case elfcpp::R_X86_64_GOTPC32_TLSDESC: // Global-dynamic (from ~oliva url)
2527 case elfcpp::R_X86_64_TLSDESC_CALL:
2528 case elfcpp::R_X86_64_TLSLD: // Local-dynamic
2529 case elfcpp::R_X86_64_DTPOFF32:
2530 case elfcpp::R_X86_64_DTPOFF64:
2531 case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
2532 case elfcpp::R_X86_64_TPOFF32: // Local-exec
2540 case elfcpp::R_X86_64_TLSGD: // General-dynamic
2547 unsigned int r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
2559 elfcpp::R_X86_64_DTPMOD64);
2565 case elfcpp::R_X86_64_GOTPC32_TLSDESC:
2579 unsigned int r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
2592 rt->add_target_specific(elfcpp::R_X86_64_TLSDESC, arg,
2600 case elfcpp::R_X86_64_TLSDESC_CALL:
2603 case elfcpp::R_X86_64_TLSLD: // Local-dynamic
2613 case elfcpp::R_X86_64_DTPOFF32:
2614 case elfcpp::R_X86_64_DTPOFF64:
2617 case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
2624 unsigned int r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
2627 elfcpp::R_X86_64_TPOFF64);
2633 case elfcpp::R_X86_64_TPOFF32: // Local-exec
2645 case elfcpp::R_X86_64_SIZE32:
2646 case elfcpp::R_X86_64_SIZE64:
2675 case elfcpp::R_X86_64_64:
2676 case elfcpp::R_X86_64_32:
2677 case elfcpp::R_X86_64_32S:
2678 case elfcpp::R_X86_64_16:
2679 case elfcpp::R_X86_64_8:
2680 case elfcpp::R_X86_64_GOT64:
2681 case elfcpp::R_X86_64_GOT32:
2682 case elfcpp::R_X86_64_GOTPCREL64:
2683 case elfcpp::R_X86_64_GOTPCREL:
2684 case elfcpp::R_X86_64_GOTPLT64:
2705 const elfcpp::Rela<size, false>& ,
2707 const elfcpp::Sym<size, false>&)
2729 const elfcpp::Rela<size, false>& ,
2736 && (gsym->visibility() == elfcpp::STV_INTERNAL
2737 || gsym->visibility() == elfcpp::STV_PROTECTED
2738 || gsym->visibility() == elfcpp::STV_HIDDEN))
2752 const elfcpp::Rela<size, false>& reloc,
2757 if (gsym->type() == elfcpp::STT_GNU_IFUNC
2763 case elfcpp::R_X86_64_NONE:
2764 case elfcpp::R_X86_64_GNU_VTINHERIT:
2765 case elfcpp::R_X86_64_GNU_VTENTRY:
2768 case elfcpp::R_X86_64_64:
2769 case elfcpp::R_X86_64_32:
2770 case elfcpp::R_X86_64_32S:
2771 case elfcpp::R_X86_64_16:
2772 case elfcpp::R_X86_64_8:
2794 else if (((size == 64 && r_type == elfcpp::R_X86_64_64)
2795 || (size == 32 && r_type == elfcpp::R_X86_64_32))
2796 && gsym->type() == elfcpp::STT_GNU_IFUNC
2808 unsigned int r_type = elfcpp::R_X86_64_IRELATIVE;
2815 else if (((size == 64 && r_type == elfcpp::R_X86_64_64)
2816 || (size == 32 && r_type == elfcpp::R_X86_64_32))
2820 rela_dyn->add_global_relative(gsym, elfcpp::R_X86_64_RELATIVE,
2838 case elfcpp::R_X86_64_PC64:
2839 case elfcpp::R_X86_64_PC32:
2840 case elfcpp::R_X86_64_PC32_BND:
2841 case elfcpp::R_X86_64_PC16:
2842 case elfcpp::R_X86_64_PC8:
2868 case elfcpp::R_X86_64_GOT64:
2869 case elfcpp::R_X86_64_GOT32:
2870 case elfcpp::R_X86_64_GOTPCREL64:
2871 case elfcpp::R_X86_64_GOTPCREL:
2872 case elfcpp::R_X86_64_GOTPLT64:
2879 if (gsym->type() == elfcpp::STT_GNU_IFUNC)
2905 || (gsym->visibility() == elfcpp::STV_PROTECTED
2907 || (gsym->type() == elfcpp::STT_GNU_IFUNC
2910 elfcpp::R_X86_64_GLOB_DAT);
2917 if (gsym->type() != elfcpp::STT_GNU_IFUNC)
2932 elfcpp::R_X86_64_RELATIVE,
2940 case elfcpp::R_X86_64_PLT32:
2941 case elfcpp::R_X86_64_PLT32_BND:
2956 case elfcpp::R_X86_64_GOTPC32:
2957 case elfcpp::R_X86_64_GOTOFF64:
2958 case elfcpp::R_X86_64_GOTPC64:
2959 case elfcpp::R_X86_64_PLTOFF64:
2964 if (r_type == elfcpp::R_X86_64_PLTOFF64
2969 case elfcpp::R_X86_64_COPY:
2970 case elfcpp::R_X86_64_GLOB_DAT:
2971 case elfcpp::R_X86_64_JUMP_SLOT:
2972 case elfcpp::R_X86_64_RELATIVE:
2973 case elfcpp::R_X86_64_IRELATIVE:
2975 case elfcpp::R_X86_64_TPOFF64:
2976 case elfcpp::R_X86_64_DTPMOD64:
2977 case elfcpp::R_X86_64_TLSDESC:
2983 case elfcpp::R_X86_64_TLSGD: // Global-dynamic
2984 case elfcpp::R_X86_64_GOTPC32_TLSDESC: // Global-dynamic (from ~oliva url)
2985 case elfcpp::R_X86_64_TLSDESC_CALL:
2986 case elfcpp::R_X86_64_TLSLD: // Local-dynamic
2987 case elfcpp::R_X86_64_DTPOFF32:
2988 case elfcpp::R_X86_64_DTPOFF64:
2989 case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
2990 case elfcpp::R_X86_64_TPOFF32: // Local-exec
2995 (r_type == elfcpp::R_X86_64_GOTTPOFF &&
3002 case elfcpp::R_X86_64_TLSGD: // General-dynamic
3011 elfcpp::R_X86_64_DTPMOD64,
3012 elfcpp::R_X86_64_DTPOFF64);
3021 elfcpp::R_X86_64_TPOFF64);
3027 case elfcpp::R_X86_64_GOTPC32_TLSDESC:
3043 elfcpp::R_X86_64_TLSDESC, 0);
3052 elfcpp::R_X86_64_TPOFF64);
3058 case elfcpp::R_X86_64_TLSDESC_CALL:
3061 case elfcpp::R_X86_64_TLSLD: // Local-dynamic
3071 case elfcpp::R_X86_64_DTPOFF32:
3072 case elfcpp::R_X86_64_DTPOFF64:
3075 case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
3084 elfcpp::R_X86_64_TPOFF64);
3090 case elfcpp::R_X86_64_TPOFF32: // Local-exec
3102 case elfcpp::R_X86_64_SIZE32:
3103 case elfcpp::R_X86_64_SIZE64:
3127 if (sh_type == elfcpp::SHT_REL)
3132 gold::gc_process_relocs<size, false, Target_x86_64<size>, elfcpp::SHT_RELA,
3164 if (sh_type == elfcpp::SHT_REL)
3171 gold::scan_relocs<size, false, Target_x86_64<size>, elfcpp::SHT_RELA,
3212 odyn->add_section_plus_offset(elfcpp::DT_TLSDESC_PLT,
3214 odyn->add_section_plus_offset(elfcpp::DT_TLSDESC_GOT,
3242 elfcpp::PT_LOAD, // segment_type
3243 elfcpp::PF_W, // segment_flags_set
3244 elfcpp::PF(0), // segment_flags_clear
3247 elfcpp::STT_NOTYPE, // type
3248 elfcpp::STB_GLOBAL, // binding
3249 elfcpp::STV_HIDDEN, // visibility
3256 elfcpp::PT_LOAD, // segment_type
3257 elfcpp::PF_W, // segment_flags_set
3258 elfcpp::PF(0), // segment_flags_clear
3261 elfcpp::STT_NOTYPE, // type
3262 elfcpp::STB_GLOBAL, // binding
3263 elfcpp::STV_HIDDEN, // visibility
3284 const elfcpp::Rela<size, false>& rela,
3289 typename elfcpp::Elf_types<size>::Elf_Addr address,
3294 if ((r_type != elfcpp::R_X86_64_PLT32
3295 && r_type != elfcpp::R_X86_64_PLT32_BND
3296 && r_type != elfcpp::R_X86_64_PC32_BND
3297 && r_type != elfcpp::R_X86_64_PC32)
3326 unsigned int r_sym = elfcpp::elf_r_sym<size>(rela.get_r_info());
3334 const elfcpp::Elf_Xword addend = rela.get_r_addend();
3346 case elfcpp::R_X86_64_GOT32:
3347 case elfcpp::R_X86_64_GOT64:
3348 case elfcpp::R_X86_64_GOTPLT64:
3349 case elfcpp::R_X86_64_GOTPCREL:
3350 case elfcpp::R_X86_64_GOTPCREL64:
3358 unsigned int r_sym = elfcpp::elf_r_sym<size>(rela.get_r_info());
3372 case elfcpp::R_X86_64_NONE:
3373 case elfcpp::R_X86_64_GNU_VTINHERIT:
3374 case elfcpp::R_X86_64_GNU_VTENTRY:
3377 case elfcpp::R_X86_64_64:
3381 case elfcpp::R_X86_64_PC64:
3386 case elfcpp::R_X86_64_32:
3394 case elfcpp::R_X86_64_32S:
3401 case elfcpp::R_X86_64_PC32:
3402 case elfcpp::R_X86_64_PC32_BND:
3407 case elfcpp::R_X86_64_16:
3411 case elfcpp::R_X86_64_PC16:
3416 case elfcpp::R_X86_64_8:
3420 case elfcpp::R_X86_64_PC8:
3425 case elfcpp::R_X86_64_PLT32:
3426 case elfcpp::R_X86_64_PLT32_BND:
3440 case elfcpp::R_X86_64_PLTOFF64:
3445 typename elfcpp::Elf_types<size>::Elf_Addr got_address;
3453 case elfcpp::R_X86_64_GOT32:
3458 case elfcpp::R_X86_64_GOTPC32:
3461 typename elfcpp::Elf_types<size>::Elf_Addr value;
3467 case elfcpp::R_X86_64_GOT64:
3468 case elfcpp::R_X86_64_GOTPLT64:
3475 case elfcpp::R_X86_64_GOTPC64:
3478 typename elfcpp::Elf_types<size>::Elf_Addr value;
3484 case elfcpp::R_X86_64_GOTOFF64:
3486 typename elfcpp::Elf_types<size>::Elf_Addr value;
3493 case elfcpp::R_X86_64_GOTPCREL:
3496 typename elfcpp::Elf_types<size>::Elf_Addr value;
3502 case elfcpp::R_X86_64_GOTPCREL64:
3505 typename elfcpp::Elf_types<size>::Elf_Addr value;
3511 case elfcpp::R_X86_64_COPY:
3512 case elfcpp::R_X86_64_GLOB_DAT:
3513 case elfcpp::R_X86_64_JUMP_SLOT:
3514 case elfcpp::R_X86_64_RELATIVE:
3515 case elfcpp::R_X86_64_IRELATIVE:
3517 case elfcpp::R_X86_64_TPOFF64:
3518 case elfcpp::R_X86_64_DTPMOD64:
3519 case elfcpp::R_X86_64_TLSDESC:
3526 case elfcpp::R_X86_64_TLSGD: // Global-dynamic
3527 case elfcpp::R_X86_64_GOTPC32_TLSDESC: // Global-dynamic (from ~oliva url)
3528 case elfcpp::R_X86_64_TLSDESC_CALL:
3529 case elfcpp::R_X86_64_TLSLD: // Local-dynamic
3530 case elfcpp::R_X86_64_DTPOFF32:
3531 case elfcpp::R_X86_64_DTPOFF64:
3532 case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
3533 case elfcpp::R_X86_64_TPOFF32: // Local-exec
3538 case elfcpp::R_X86_64_SIZE32:
3539 case elfcpp::R_X86_64_SIZE64:
3558 const elfcpp::Rela<size, false>& rela,
3563 typename elfcpp::Elf_types<size>::Elf_Addr address,
3569 const elfcpp
3570 elfcpp::Shdr<size, false> data_shdr(relinfo->data_shdr);
3571 bool is_executable = (data_shdr.get_sh_flags() & elfcpp::SHF_EXECINSTR) != 0;
3573 typename elfcpp::Elf_types<size>::Elf_Addr value = psymval->value(relinfo->object, 0);
3582 case elfcpp::R_X86_64_TLSGD: // Global-dynamic
3619 unsigned int r_sym = elfcpp::elf_r_sym<size>(rela.get_r_info());
3645 case elfcpp::R_X86_64_GOTPC32_TLSDESC: // Global-dynamic (from ~oliva url)
3646 case elfcpp::R_X86_64_TLSDESC_CALL:
3671 if (r_type == elfcpp::R_X86_64_GOTPC32_TLSDESC
3687 unsigned int r_sym = elfcpp::elf_r_sym<size>(rela.get_r_info());
3708 if (r_type == elfcpp::R_X86_64_GOTPC32_TLSDESC)
3723 case elfcpp::R_X86_64_TLSLD: // Local-dynamic
3757 case elfcpp::R_X86_64_DTPOFF32:
3777 case elfcpp::R_X86_64_DTPOFF64:
3792 case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
3830 unsigned int r_sym = elfcpp::elf_r_sym<size>(rela.get_r_info());
3846 case elfcpp::R_X86_64_TPOFF32: // Local-exec
3868 const elfcpp::Rela<size, false>& rela,
3870 typename elfcpp::Elf_types<size>::Elf_Addr value,
3872 typename elfcpp::Elf_types<size>::Elf_Addr address,
3907 const elfcpp::Elf_Xword addend = rela.get_r_addend();
3925 const elfcpp::Rela<size, false>& rela,
3927 typename elfcpp::Elf_types<size>::Elf_Addr value,
3980 const elfcpp::Rela<size, false>& rela,
3982 typename elfcpp::Elf_types<size>::Elf_Addr value,
3984 typename elfcpp::Elf_types<size>::Elf_Addr address,
3987 if (r_type == elfcpp::R_X86_64_GOTPC32_TLSDESC)
3996 const elfcpp::Elf_Xword addend = rela.get_r_addend();
4003 gold_assert(r_type == elfcpp::R_X86_64_TLSDESC_CALL);
4020 const elfcpp::Rela<size, false>& rela,
4022 typename elfcpp::Elf_types<size>::Elf_Addr value,
4026 if (r_type == elfcpp::R_X86_64_GOTPC32_TLSDESC)
4043 gold_assert(r_type == elfcpp::R_X86_64_TLSDESC_CALL);
4058 const elfcpp::Rela<size, false>& rela,
4060 typename elfcpp::Elf_types<size>::Elf_Addr,
4099 const elfcpp::Rela<size, false>& rela,
4101 typename elfcpp::Elf_types<size>::Elf_Addr value,
4167 typename elfcpp::Elf_types<size>::Elf_Addr address,
4171 gold_assert(sh_type == elfcpp::SHT_RELA);
4173 gold::relocate_section<size, false, Target_x86_64<size>, elfcpp::SHT_RELA,
4195 typename elfcpp::Elf_types<size>::Elf_Addr r_offset,
4197 typename elfcpp::Elf_types<size>::Elf_Swxword r_addend,
4200 typename elfcpp::Elf_types<size>::Elf_Addr address,
4227 case elfcpp::R_X86_64_NONE:
4228 case elfcpp::R_X86_64_GNU_VTINHERIT:
4229 case elfcpp::R_X86_64_GNU_VTENTRY:
4230 case elfcpp::R_X86_64_TLSGD: // Global-dynamic
4231 case elfcpp::R_X86_64_GOTPC32_TLSDESC: // Global-dynamic (from ~oliva url)
4232 case elfcpp::R_X86_64_TLSDESC_CALL:
4233 case elfcpp::R_X86_64_TLSLD: // Local-dynamic
4234 case elfcpp::R_X86_64_DTPOFF32:
4235 case elfcpp::R_X86_64_DTPOFF64:
4236 case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
4237 case elfcpp::R_X86_64_TPOFF32: // Local-exec
4240 case elfcpp::R_X86_64_64:
4241 case elfcpp::R_X86_64_PC64:
4242 case elfcpp::R_X86_64_GOTOFF64:
4243 case elfcpp::R_X86_64_GOTPC64:
4244 case elfcpp::R_X86_64_PLTOFF64:
4245 case elfcpp::R_X86_64_GOT64:
4246 case elfcpp::R_X86_64_GOTPCREL64:
4247 case elfcpp::R_X86_64_GOTPCREL:
4248 case elfcpp::R_X86_64_GOTPLT64:
4251 case elfcpp::R_X86_64_32:
4252 case elfcpp::R_X86_64_32S:
4253 case elfcpp::R_X86_64_PC32:
4254 case elfcpp::R_X86_64_PC32_BND:
4255 case elfcpp::R_X86_64_PLT32:
4256 case elfcpp::R_X86_64_PLT32_BND:
4257 case elfcpp::R_X86_64_GOTPC32:
4258 case elfcpp::R_X86_64_GOT32:
4261 case elfcpp::R_X86_64_16:
4262 case elfcpp::R_X86_64_PC16:
4265 case elfcpp::R_X86_64_8:
4266 case elfcpp::R_X86_64_PC8:
4269 case elfcpp::R_X86_64_COPY:
4270 case elfcpp::R_X86_64_GLOB_DAT:
4271 case elfcpp::R_X86_64_JUMP_SLOT:
4272 case elfcpp::R_X86_64_RELATIVE:
4273 case elfcpp::R_X86_64_IRELATIVE:
4275 case elfcpp::R_X86_64_TPOFF64:
4276 case elfcpp::R_X86_64_DTPMOD64:
4277 case elfcpp::R_X86_64_TLSDESC:
4281 case elfcpp::R_X86_64_SIZE32:
4282 case elfcpp::R_X86_64_SIZE64:
4307 gold_assert(sh_type == elfcpp::SHT_RELA);
4309 typedef gold::Default_scan_relocatable_relocs<elfcpp::SHT_RELA,
4312 gold::scan_relocatable_relocs<size, false, elfcpp::SHT_RELA,
4337 typename elfcpp::Elf_types<size>::Elf_Off offset_in_output_section,
4340 typename elfcpp::Elf_types<size>::Elf_Addr view_address,
4345 gold_assert(sh_type == elfcpp::SHT_RELA);
4347 gold::relocate_relocs<size, false, elfcpp::SHT_RELA>(
4386 elfcpp::Swap_unaligned<32, false>::writeval(jmp + 1, length - 5);
4457 gold_assert(r_type == elfcpp::R_X86_64_TLSDESC);
4548 uint32_t val = elfcpp::Swap_unaligned<32, false>::readval(pval);
4550 elfcpp::Swap_unaligned<32, false>::writeval(pval, val);
4576 : Target_selector_freebsd(elfcpp::EM_X86_64, size, false,
4632 typename elfcpp::Elf_types<size>::Elf_Addr got_addr,
4633 typename elfcpp::Elf_types<size>::Elf_Addr plt_addr);
4637 typename elfcpp::Elf_types<size>::Elf_Addr got_address,
4638 typename elfcpp::Elf_types<size>::Elf_Addr plt_address,
4645 typename elfcpp::Elf_types<size>::Elf_Addr got_address,
4646 typename elfcpp::Elf_types<size>::Elf_Addr plt_address,
4647 typename elfcpp::Elf_types<size>::Elf_Addr got_base,
4711 elfcpp::EM_X86_64, // machine_code
4724 elfcpp::SHN_UNDEF, // small_common_shndx
4725 elfcpp::SHN_X86_64_LCOMMON, // large_common_shndx
4727 elfcpp::SHF_X86_64_LARGE, // large_common_section_flags
4738 elfcpp::EM_X86_64, // machine_code
4751 elfcpp::SHN_UNDEF, // small_common_shndx
4752 elfcpp::SHN_X86_64_LCOMMON, // large_common_shndx
4754 elfcpp::SHF_X86_64_LARGE, // large_common_section_flags
4792 typename elfcpp::Elf_types<size>::Elf_Addr got_address,
4793 typename elfcpp::Elf_types<size>::Elf_Addr plt_address)
4796 elfcpp::Swap_unaligned<32, false>::writeval(pov + 2,
4799 elfcpp::Swap_unaligned<32, false>::writeval(pov + 9,
4836 typename elfcpp::Elf_types<size>::Elf_Addr got_address,
4837 typename elfcpp::Elf_types<size>::Elf_Addr plt_address,
4843 elfcpp::Swap_unaligned<32, false>::writeval(pov + 3,
4848 elfcpp::Swap_unaligned<32, false>::writeval(pov + 33, plt_index);
4849 elfcpp::Swap_unaligned<32, false>::writeval(pov + 38,
4882 typename elfcpp::Elf_types<size>::Elf_Addr got_address,
4883 typename elfcpp::Elf_types<size>::Elf_Addr plt_address,
4884 typename elfcpp::Elf_types<size>::Elf_Addr got_base,
4889 elfcpp::Swap_unaligned<32, false>::writeval(pov + 2,
4893 elfcpp::Swap_unaligned<32, false>::writeval(pov + 9,
4909 elfcpp::DW_CFA_def_cfa_offset, 16, // DW_CFA_def_cfa_offset: 16.
4910 elfcpp::DW_CFA_advance_loc + 6, // Advance 6 to __PLT__ + 6.
4911 elfcpp::DW_CFA_def_cfa_offset, 24, // DW_CFA_def_cfa_offset: 24.
4912 elfcpp::DW_CFA_advance_loc + 58, // Advance 58 to __PLT__ + 64.
4913 elfcpp::DW_CFA_def_cfa_expression, // DW_CFA_def_cfa_expression.
4915 elfcpp::DW_OP_breg7, 8, // Push %rsp + 8.
4916 elfcpp::DW_OP_breg16, 0, // Push %rip.
4917 elfcpp::DW_OP_const1u, 63, // Push 0x3f.
4918 elfcpp::DW_OP_and, // & (%rip & 0x3f).
4919 elfcpp::DW_OP_const1u, 37, // Push 0x25.
4920 elfcpp::DW_OP_ge, // >= ((%rip & 0x3f) >= 0x25)
4921 elfcpp::DW_OP_lit3, // Push 3.
4922 elfcpp::DW_OP_shl, // << (((%rip & 0x3f) >= 0x25) << 3)
4923 elfcpp::DW_OP_plus, // + ((((%rip&0x3f)>=0x25)<<3)+%rsp+8
4924 elfcpp::DW_CFA_nop, // Align to 32 bytes.
4925 elfcpp::DW_CFA_nop