Home | History | Annotate | Download | only in gold

Lines Matching refs:elfcpp

27 #include "elfcpp.h"
84 typedef Output_data_reloc<elfcpp::SHT_REL, true, 32, false> Reloc_section;
150 elfcpp::Elf_types<32>::Elf_Addr got_address)
161 elfcpp::Elf_types<32>::Elf_Addr got_address,
175 elfcpp::Elf_types<32>::Elf_Addr got_address) = 0;
179 elfcpp::Elf_types<32>::Elf_Addr got_address,
301 elfcpp::Elf_types<32>::Elf_Addr got_address);
305 elfcpp::Elf_types<32>::Elf_Addr got_address,
331 do_fill_first_plt_entry(unsigned char* pov, elfcpp::Elf_types<32>::Elf_Addr);
335 elfcpp::Elf_types<32>::Elf_Addr,
356 typedef Output_data_reloc<elfcpp::SHT_REL, true, 32, false> Reloc_section;
362 rel_irelative_(NULL), copy_relocs_(elfcpp::R_386_COPY),
413 elfcpp::Elf_types<32>::Elf_Addr view_address,
439 elfcpp::Elf_types<32>::Elf_Off offset_in_output_section,
442 elfcpp::Elf_types<32>::Elf_Addr view_address,
562 const elfcpp::Rel<32, false>& reloc, unsigned int r_type,
563 const elfcpp::Sym<32, false>& lsym,
571 const elfcpp::Rel<32, false>& reloc, unsigned int r_type,
580 const elfcpp::Rel<32, false>& reloc,
582 const elfcpp::Sym<32, false>& lsym);
590 const elfcpp::Rel<32, false>& reloc,
638 size_t relnum, const elfcpp::Rel<32, false>&,
641 unsigned char*, elfcpp::Elf_types<32>::Elf_Addr,
648 size_t relnum, const elfcpp::Rel<32, false>&,
651 unsigned char*, elfcpp::Elf_types<32>::Elf_Addr,
658 const elfcpp::Rel<32, false>&, unsigned int r_type,
659 elfcpp::Elf_types<32>::Elf_Addr value,
667 const elfcpp::Rel<32, false>&, unsigned int r_type,
668 elfcpp::Elf_types<32>::Elf_Addr value,
677 const elfcpp::Rel<32, false>&, unsigned int r_type,
678 elfcpp::Elf_types<32>::Elf_Addr value,
687 const elfcpp::Rel<32, false>&, unsigned int r_type,
688 elfcpp::Elf_types<32>::Elf_Addr value,
696 const elfcpp::Rel<32, false>&, unsigned int r_type,
697 elfcpp::Elf_types<32>::Elf_Addr value,
705 const elfcpp::Rel<32, false>&, unsigned int r_type,
706 elfcpp::Elf_types<32>::Elf_Addr value,
750 return (gsym->type() != elfcpp::STT_GNU_IFUNC
755 || (gsym->visibility() != elfcpp::STV_DEFAULT
756 && gsym->visibility() != elfcpp::STV_PROTECTED)
829 Symbol* sym, const elfcpp::Rel<32, false>& reloc)
871 Copy_relocs<elfcpp::SHT_REL, 32, false> copy_relocs_;
882 elfcpp::EM_386, // machine_code
895 elfcpp::SHN_UNDEF, // small_common_shndx
896 elfcpp::SHN_UNDEF, // large_common_shndx
926 layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
927 (elfcpp::SHF_ALLOC
928 | elfcpp::SHF_WRITE),
932 layout->add_output_section_data(".got.plt", elfcpp::SHT_PROGBITS,
933 (elfcpp::SHF_ALLOC
934 | elfcpp::SHF_WRITE),
952 0, 0, elfcpp::STT_OBJECT,
953 elfcpp::STB_LOCAL,
954 elfcpp::STV_HIDDEN, 0,
960 layout->add_output_section_data(".got.plt", elfcpp::SHT_PROGBITS,
961 (elfcpp::SHF_ALLOC
962 | elfcpp::SHF_WRITE),
969 layout->add_output_section_data(".got.plt", elfcpp::SHT_PROGBITS,
970 (elfcpp::SHF_ALLOC
971 | elfcpp::SHF_WRITE),
988 layout->add_output_section_data(".rel.dyn", elfcpp::SHT_REL,
989 elfcpp::SHF_ALLOC, this->rel_dyn_,
1009 layout->add_output_section_data(".rel.dyn", elfcpp::SHT_REL,
1010 elfcpp::SHF_ALLOC, this->rel_irelative_,
1034 elfcpp::Swap<32, false>::writeval(got_view, dynamic_addr);
1053 layout->add_output_section_data(".rel.plt", elfcpp::SHT_REL,
1054 elfcpp::SHF_ALLOC, this->rel_,
1075 if (gsym->type() == elfcpp::STT_GNU_IFUNC
1084 rel->add_symbolless_global_addend(gsym, elfcpp::R_386_IRELATIVE,
1107 this->rel_->add_global(gsym, elfcpp::R_386_JUMP_SLOT, this->got_plt_,
1138 elfcpp::R_386_IRELATIVE,
1159 layout->add_output_section_data(".rel.plt", elfcpp::SHT_REL,
1160 elfcpp::SHF_ALLOC, this->tls_desc_rel_,
1180 layout->add_output_section_data(".rel.plt", elfcpp::SHT_REL,
1181 elfcpp::SHF_ALLOC, this->irelative_rel_,
1195 elfcpp::STT_NOTYPE, elfcpp::STB_GLOBAL,
1196 elfcpp::STV_HIDDEN, 0, false, true);
1200 elfcpp::STT_NOTYPE, elfcpp::STB_GLOBAL,
1201 elfcpp::STV_HIDDEN, 0, true, true);
1213 if (gsym->type() == elfcpp::STT_GNU_IFUNC
1245 elfcpp::Elf_types<32>::Elf_Addr got_address)
1248 elfcpp::Swap_unaligned<32, false>::writeval(pov + 2, got_address + 4);
1249 elfcpp::Swap<32, false>::writeval(pov + 8, got_address + 8);
1264 elfcpp::Elf_types<32>::Elf_Addr)
1284 elfcpp::Elf_types<32>::Elf_Addr got_address,
1290 elfcpp::Swap_unaligned<32, false>::writeval(pov + 2,
1292 elfcpp::Swap_unaligned<32, false>::writeval(pov + 7, plt_rel_offset);
1293 elfcpp::Swap<32, false>::writeval(pov + 12, - (plt_offset + 12 + 4));
1311 elfcpp::Elf_types<32>::Elf_Addr,
1317 elfcpp::Swap_unaligned<32, false>::writeval(pov + 2, got_offset);
1318 elfcpp::Swap_unaligned<32, false>::writeval(pov + 7, plt_rel_offset);
1319 elfcpp::Swap<32, false>::writeval(pov + 12, - (plt_offset + 12 + 4));
1336 (elfcpp::DW_EH_PE_pcrel // FDE encoding.
1337 | elfcpp::DW_EH_PE_sdata4),
1338 elfcpp::DW_CFA_def_cfa, 4, 4, // DW_CFA_def_cfa: r4 (esp) ofs 4.
1339 elfcpp::DW_CFA_offset + 8, 1, // DW_CFA_offset: r8 (eip) at cfa-4.
1340 elfcpp::DW_CFA_nop, // Align to 16 bytes.
1341 elfcpp::DW_CFA_nop
1350 elfcpp::DW_CFA_def_cfa_offset, 8, // DW_CFA_def_cfa_offset: 8.
1351 elfcpp::DW_CFA_advance_loc + 6, // Advance 6 to __PLT__ + 6.
1352 elfcpp::DW_CFA_def_cfa_offset, 12, // DW_CFA_def_cfa_offset: 12.
1353 elfcpp::DW_CFA_advance_loc + 10, // Advance 10 to __PLT__ + 16.
1354 elfcpp::DW_CFA_def_cfa_expression, // DW_CFA_def_cfa_expression.
1356 elfcpp::DW_OP_breg4, 4, // Push %esp + 4.
1357 elfcpp::DW_OP_breg8, 0, // Push %eip.
1358 elfcpp::DW_OP_lit15, // Push 0xf.
1359 elfcpp::DW_OP_and, // & (%eip & 0xf).
1360 elfcpp::DW_OP_lit11, // Push 0xb.
1361 elfcpp::DW_OP_ge, // >= ((%eip & 0xf) >= 0xb)
1362 elfcpp::DW_OP_lit2, // Push 2.
1363 elfcpp::DW_OP_shl, // << (((%eip & 0xf) >= 0xb) << 2)
1364 elfcpp::DW_OP_plus, // + ((((%eip&0xf)>=0xb)<<2)+%esp+4
1365 elfcpp::DW_CFA_nop, // Align to 32 bytes.
1366 elfcpp::DW_CFA_nop,
1367 elfcpp::DW_CFA_nop,
1368 elfcpp::DW_CFA_nop
1396 elfcpp::Elf_types<32>::Elf_Addr plt_address = this->address();
1397 elfcpp::Elf_types<32>::Elf_Addr got_address = this->got_plt_->address();
1406 const int rel_size = elfcpp::Elf_sizes<32>::rel_size;
1429 elfcpp::Swap<32, false>::writeval(got_pov,
1445 elfcpp::Swap<32, false>::writeval(got_irelative_view + p->got_offset,
1456 elfcpp::Swap<32, false>::writeval(got_irelative_view + p->got_offset,
1487 layout->add_output_section_data(".plt", elfcpp::SHT_PROGBITS,
1488 (elfcpp::SHF_ALLOC
1489 | elfcpp::SHF_EXECINSTR),
1576 elfcpp::STT_TLS,
1577 elfcpp::STB_LOCAL,
1578 elfcpp::STV_HIDDEN, 0,
1599 rel_dyn->add_local(object, 0, elfcpp::R_386_TLS_DTPMOD32, got,
1621 case elfcpp::R_386_TLS_GD:
1622 case elfcpp::R_386_TLS_GOTDESC:
1623 case elfcpp::R_386_TLS_DESC_CALL:
1632 case elfcpp::R_386_TLS_LDM:
1638 case elfcpp::R_386_TLS_LDO_32:
1642 case elfcpp::R_386_TLS_IE:
1643 case elfcpp::R_386_TLS_GOTIE:
1644 case elfcpp::R_386_TLS_IE_32:
1653 case elfcpp::R_386_TLS_LE:
1654 case elfcpp::R_386_TLS_LE_32:
1671 case elfcpp::R_386_NONE:
1672 case elfcpp::R_386_GNU_VTINHERIT:
1673 case elfcpp::R_386_GNU_VTENTRY:
1674 case elfcpp::R_386_GOTPC:
1678 case elfcpp::R_386_32:
1679 case elfcpp::R_386_16:
1680 case elfcpp::R_386_8:
1683 case elfcpp::R_386_PC32:
1684 case elfcpp::R_386_PC16:
1685 case elfcpp::R_386_PC8:
1686 case elfcpp::R_386_GOTOFF:
1689 case elfcpp::R_386_PLT32:
1692 case elfcpp::R_386_GOT32:
1696 case elfcpp::R_386_TLS_GD: // Global-dynamic
1697 case elfcpp::R_386_TLS_GOTDESC: // Global-dynamic (from ~oliva url)
1698 case elfcpp::R_386_TLS_DESC_CALL:
1699 case elfcpp::R_386_TLS_LDM: // Local-dynamic
1700 case elfcpp::R_386_TLS_LDO_32: // Alternate local-dynamic
1701 case elfcpp::R_386_TLS_IE: // Initial-exec
1702 case elfcpp::R_386_TLS_IE_32:
1703 case elfcpp::R_386_TLS_GOTIE:
1704 case elfcpp::R_386_TLS_LE: // Local-exec
1705 case elfcpp::R_386_TLS_LE_32:
1708 case elfcpp::R_386_COPY:
1709 case elfcpp::R_386_GLOB_DAT:
1710 case elfcpp::R_386_JUMP_SLOT:
1711 case elfcpp::R_386_RELATIVE:
1712 case elfcpp::R_386_IRELATIVE:
1713 case elfcpp::R_386_TLS_TPOFF:
1714 case elfcpp::R_386_TLS_DTPMOD32:
1715 case elfcpp::R_386_TLS_DTPOFF32:
1716 case elfcpp::R_386_TLS_TPOFF32:
1717 case elfcpp::R_386_TLS_DESC:
1718 case elfcpp::R_386_32PLT:
1719 case elfcpp::R_386_TLS_GD_32:
1720 case elfcpp::R_386_TLS_GD_PUSH:
1721 case elfcpp::R_386_TLS_GD_CALL:
1722 case elfcpp::R_386_TLS_GD_POP:
1723 case elfcpp::R_386_TLS_LDM_32:
1724 case elfcpp::R_386_TLS_LDM_PUSH:
1725 case elfcpp::R_386_TLS_LDM_CALL:
1726 case elfcpp::R_386_TLS_LDM_POP:
1727 case elfcpp::R_386_USED_BY_INTEL_200:
1768 const elfcpp::Rel<32, false>& reloc,
1770 const elfcpp::Sym<32, false>& lsym,
1777 if (lsym.get_st_type() == elfcpp::STT_GNU_IFUNC
1780 unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
1786 case elfcpp::R_386_NONE:
1787 case elfcpp::R_386_GNU_VTINHERIT:
1788 case elfcpp::R_386_GNU_VTENTRY:
1791 case elfcpp::R_386_32:
1801 unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
1802 rel_dyn->add_local_relative(object, r_sym, elfcpp::R_386_RELATIVE,
1808 case elfcpp::R_386_16:
1809 case elfcpp::R_386_8:
1818 unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
1819 if (lsym.get_st_type() != elfcpp::STT_SECTION)
1840 case elfcpp::R_386_PC32:
1841 case elfcpp::R_386_PC16:
1842 case elfcpp::R_386_PC8:
1845 case elfcpp::R_386_PLT32:
1850 case elfcpp::R_386_GOTOFF:
1851 case elfcpp::R_386_GOTPC:
1856 case elfcpp::R_386_GOT32:
1868 && lsym.get_st_type() != elfcpp::STT_GNU_IFUNC)
1878 unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
1884 if (lsym.get_st_type() == elfcpp::STT_GNU_IFUNC)
1898 elfcpp::R_386_RELATIVE,
1907 case elfcpp::R_386_COPY:
1908 case elfcpp::R_386_GLOB_DAT:
1909 case elfcpp::R_386_JUMP_SLOT:
1910 case elfcpp::R_386_RELATIVE:
1911 case elfcpp::R_386_IRELATIVE:
1912 case elfcpp::R_386_TLS_TPOFF:
1913 case elfcpp::R_386_TLS_DTPMOD32:
1914 case elfcpp::R_386_TLS_DTPOFF32:
1915 case elfcpp::R_386_TLS_TPOFF32:
1916 case elfcpp::R_386_TLS_DESC:
1923 case elfcpp::R_386_TLS_GD: // Global-dynamic
1924 case elfcpp::R_386_TLS_GOTDESC: // Global-dynamic (from ~oliva url)
1925 case elfcpp::R_386_TLS_DESC_CALL:
1926 case elfcpp::R_386_TLS_LDM: // Local-dynamic
1927 case elfcpp::R_386_TLS_LDO_32: // Alternate local-dynamic
1928 case elfcpp::R_386_TLS_IE: // Initial-exec
1929 case elfcpp::R_386_TLS_IE_32:
1930 case elfcpp::R_386_TLS_GOTIE:
1931 case elfcpp::R_386_TLS_LE: // Local-exec
1932 case elfcpp::R_386_TLS_LE_32:
1939 case elfcpp::R_386_TLS_GD: // Global-dynamic
1946 unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
1957 elfcpp::R_386_TLS_DTPMOD32);
1963 case elfcpp::R_386_TLS_GOTDESC: // Global-dynamic (from ~oliva)
1974 unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
1987 rt->add_absolute(elfcpp::R_386_TLS_DESC, got, got_offset);
1994 case elfcpp::R_386_TLS_DESC_CALL:
1997 case elfcpp::R_386_TLS_LDM: // Local-dynamic
2007 case elfcpp::R_386_TLS_LDO_32: // Alternate local-dynamic
2010 case elfcpp::R_386_TLS_IE: // Initial-exec
2011 case elfcpp::R_386_TLS_IE_32:
2012 case elfcpp::R_386_TLS_GOTIE:
2018 if (r_type == elfcpp::R_386_TLS_IE
2023 = elfcpp::elf_r_sym<32>(reloc.get_r_info());
2025 elfcpp::R_386_RELATIVE,
2032 unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
2033 unsigned int dyn_r_type = (r_type == elfcpp::R_386_TLS_IE_32
2034 ? elfcpp::R_386_TLS_TPOFF32
2035 : elfcpp::R_386_TLS_TPOFF);
2036 elfcpp::R_386_TLS_IE_32
2047 case elfcpp::R_386_TLS_LE: // Local-exec
2048 case elfcpp::R_386_TLS_LE_32:
2053 gold_assert(lsym.get_st_type() != elfcpp::STT_SECTION);
2054 unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
2055 unsigned int dyn_r_type = (r_type == elfcpp::R_386_TLS_LE_32
2056 ? elfcpp::R_386_TLS_TPOFF32
2057 : elfcpp::R_386_TLS_TPOFF);
2070 case elfcpp::R_386_32PLT:
2071 case elfcpp::R_386_TLS_GD_32:
2072 case elfcpp::R_386_TLS_GD_PUSH:
2073 case elfcpp::R_386_TLS_GD_CALL:
2074 case elfcpp::R_386_TLS_GD_POP:
2075 case elfcpp::R_386_TLS_LDM_32:
2076 case elfcpp::R_386_TLS_LDM_PUSH:
2077 case elfcpp::R_386_TLS_LDM_CALL:
2078 case elfcpp::R_386_TLS_LDM_POP:
2079 case elfcpp::R_386_USED_BY_INTEL_200:
2103 case elfcpp::R_386_32:
2104 case elfcpp::R_386_16:
2105 case elfcpp::R_386_8:
2106 case elfcpp::R_386_GOTOFF:
2107 case elfcpp::R_386_GOT32:
2125 const elfcpp::Rel<32, false>& ,
2127 const elfcpp::Sym<32, false>&)
2140 const elfcpp::Rel<32, false>& ,
2156 const elfcpp::Rel<32, false>& reloc,
2161 if (gsym->type() == elfcpp::STT_GNU_IFUNC
2167 case elfcpp::R_386_NONE:
2168 case elfcpp::R_386_GNU_VTINHERIT:
2169 case elfcpp::R_386_GNU_VTENTRY:
2172 case elfcpp::R_386_32:
2173 case elfcpp::R_386_16:
2174 case elfcpp::R_386_8:
2196 else if (r_type == elfcpp::R_386_32
2197 && gsym->type() == elfcpp::STT_GNU_IFUNC
2209 elfcpp::R_386_IRELATIVE,
2214 else if (r_type == elfcpp::R_386_32
2218 rel_dyn->add_global_relative(gsym, elfcpp::R_386_RELATIVE,
2232 case elfcpp::R_386_PC32:
2233 case elfcpp::R_386_PC16:
2234 case elfcpp::R_386_PC8:
2246 || r_type != elfcpp::R_386_PC32)
2268 case elfcpp::R_386_GOT32:
2291 if (gsym->type() == elfcpp::STT_GNU_IFUNC)
2317 || (gsym->visibility() == elfcpp::STV_PROTECTED
2319 || (gsym->type() == elfcpp::STT_GNU_IFUNC
2322 rel_dyn, elfcpp::R_386_GLOB_DAT);
2329 if (gsym->type() != elfcpp::STT_GNU_IFUNC)
2343 rel_dyn->add_global_relative(gsym, elfcpp::R_386_RELATIVE,
2351 case elfcpp::R_386_PLT32:
2366 case elfcpp::R_386_GOTOFF:
2367 case elfcpp::R_386_GOTPC:
2374 case elfcpp::R_386_COPY:
2375 case elfcpp::R_386_GLOB_DAT:
2376 case elfcpp::R_386_JUMP_SLOT:
2377 case elfcpp::R_386_RELATIVE:
2378 case elfcpp::R_386_IRELATIVE:
2379 case elfcpp::R_386_TLS_TPOFF:
2380 case elfcpp::R_386_TLS_DTPMOD32:
2381 case elfcpp::R_386_TLS_DTPOFF32:
2382 case elfcpp::R_386_TLS_TPOFF32:
2383 case elfcpp::R_386_TLS_DESC:
2390 case elfcpp::R_386_TLS_GD: // Global-dynamic
2391 case elfcpp::R_386_TLS_GOTDESC: // Global-dynamic (from ~oliva url)
2392 case elfcpp::R_386_TLS_DESC_CALL:
2393 case elfcpp::R_386_TLS_LDM: // Local-dynamic
2394 case elfcpp::R_386_TLS_LDO_32: // Alternate local-dynamic
2395 case elfcpp::R_386_TLS_IE: // Initial-exec
2396 case elfcpp::R_386_TLS_IE_32:
2397 case elfcpp::R_386_TLS_GOTIE:
2398 case elfcpp::R_386_TLS_LE: // Local-exec
2399 case elfcpp::R_386_TLS_LE_32:
2406 case elfcpp::R_386_TLS_GD: // Global-dynamic
2415 elfcpp::R_386_TLS_DTPMOD32,
2416 elfcpp::R_386_TLS_DTPOFF32);
2425 elfcpp::R_386_TLS_TPOFF);
2431 case elfcpp::R_386_TLS_GOTDESC: // Global-dynamic (~oliva url)
2444 elfcpp::R_386_TLS_DESC, 0);
2453 elfcpp::R_386_TLS_TPOFF);
2459 case elfcpp::R_386_TLS_DESC_CALL:
2462 case elfcpp::R_386_TLS_LDM: // Local-dynamic
2472 case elfcpp::R_386_TLS_LDO_32: // Alternate local-dynamic
2475 case elfcpp::R_386_TLS_IE: // Initial-exec
2476 case elfcpp::R_386_TLS_IE_32:
2477 case elfcpp::R_386_TLS_GOTIE:
2483 if (r_type == elfcpp::R_386_TLS_IE
2487 rel_dyn->add_global_relative(gsym, elfcpp::R_386_RELATIVE,
2495 unsigned int dyn_r_type = (r_type == elfcpp::R_386_TLS_IE_32
2496 ? elfcpp::R_386_TLS_TPOFF32
2497 : elfcpp::R_386_TLS_TPOFF);
2498 unsigned int got_type = (r_type == elfcpp::R_386_TLS_IE_32
2509 case elfcpp::R_386_TLS_LE: // Local-exec
2510 case elfcpp::R_386_TLS_LE_32:
2515 unsigned int dyn_r_type = (r_type == elfcpp::R_386_TLS_LE_32
2516 ? elfcpp::R_386_TLS_TPOFF32
2517 : elfcpp::R_386_TLS_TPOFF);
2530 case elfcpp::R_386_32PLT:
2531 case elfcpp::R_386_TLS_GD_32:
2532 case elfcpp::R_386_TLS_GD_PUSH:
2533 case elfcpp::R_386_TLS_GD_CALL:
2534 case elfcpp::R_386_TLS_GD_POP:
2535 case elfcpp::R_386_TLS_LDM_32:
2536 case elfcpp::R_386_TLS_LDM_PUSH:
2537 case elfcpp::R_386_TLS_LDM_CALL:
2538 case elfcpp::R_386_TLS_LDM_POP:
2539 case elfcpp::R_386_USED_BY_INTEL_200:
2561 gold::gc_process_relocs<32, false, Target_i386, elfcpp::SHT_REL,
2592 if (sh_type == elfcpp::SHT_RELA)
2599 gold::scan_relocs<32, false, Target_i386, elfcpp::SHT_REL,
2651 elfcpp::PT_LOAD, // segment_type
2652 elfcpp::PF_W, // segment_flags_set
2653 elfcpp::PF(0), // segment_flags_clear
2656 elfcpp::STT_NOTYPE, // type
2657 elfcpp::STB_GLOBAL, // binding
2658 elfcpp::STV_HIDDEN, // visibility
2665 elfcpp::PT_LOAD, // segment_type
2666 elfcpp::PF_W, // segment_flags_set
2667 elfcpp::PF(0), // segment_flags_clear
2670 elfcpp::STT_NOTYPE, // type
2671 elfcpp::STB_GLOBAL, // binding
2672 elfcpp::STV_HIDDEN, // visibility
2699 if ((output_section->flags() & elfcpp::SHF_ALLOC) == 0)
2731 const elfcpp::Rel<32, false>& rel,
2736 elfcpp::Elf_types<32>::Elf_Addr address,
2741 if ((r_type != elfcpp::R_386_PLT32
2742 && r_type != elfcpp::R_386_PC32)
2762 && gsym->type() == elfcpp::STT_GNU_IFUNC
2763 && r_type == elfcpp::R_386_32
2781 unsigned int r_sym = elfcpp::elf_r_sym<32>(rel.get_r_info());
2791 case elfcpp::R_386_NONE:
2792 case elfcpp::R_386_GNU_VTINHERIT:
2793 case elfcpp::R_386_GNU_VTENTRY:
2796 case elfcpp::R_386_32:
2801 case elfcpp::R_386_PC32:
2806 case elfcpp::R_386_16:
2811 case elfcpp::R_386_PC16:
2816 case elfcpp::R_386_8:
2821 case elfcpp::R_386_PC8:
2826 case elfcpp::R_386_PLT32:
2836 case elfcpp::R_386_GOT32:
2849 elfcpp::Elf_types<32>::Elf_Addr value;
2868 unsigned int r_sym = elfcpp::elf_r_sym<32>(rel.get_r_info());
2877 case elfcpp::R_386_GOTOFF:
2879 elfcpp::Elf_types<32>::Elf_Addr value;
2886 case elfcpp::R_386_GOTPC:
2888 elfcpp::Elf_types<32>::Elf_Addr value;
2894 case elfcpp::R_386_COPY:
2895 case elfcpp::R_386_GLOB_DAT:
2896 case elfcpp::R_386_JUMP_SLOT:
2897 case elfcpp::R_386_RELATIVE:
2898 case elfcpp::R_386_IRELATIVE:
2901 case elfcpp::R_386_TLS_TPOFF:
2902 case elfcpp::R_386_TLS_DTPMOD32:
2903 case elfcpp::R_386_TLS_DTPOFF32:
2904 case elfcpp::R_386_TLS_TPOFF32:
2905 case elfcpp::R_386_TLS_DESC:
2913 case elfcpp::R_386_TLS_GD: // Global-dynamic
2914 case elfcpp::R_386_TLS_GOTDESC: // Global-dynamic (from ~oliva url)
2915 case elfcpp::R_386_TLS_DESC_CALL:
2916 case elfcpp::R_386_TLS_LDM: // Local-dynamic
2917 case elfcpp::R_386_TLS_LDO_32: // Alternate local-dynamic
2918 case elfcpp::R_386_TLS_IE: // Initial-exec
2919 case elfcpp::R_386_TLS_IE_32:
2920 case elfcpp::R_386_TLS_GOTIE:
2921 case elfcpp::R_386_TLS_LE: // Local-exec
2922 case elfcpp::R_386_TLS_LE_32:
2927 case elfcpp::R_386_32PLT:
2928 case elfcpp::R_386_TLS_GD_32:
2929 case elfcpp::R_386_TLS_GD_PUSH:
2930 case elfcpp::R_386_TLS_GD_CALL:
2931 case elfcpp::R_386_TLS_GD_POP:
2932 case elfcpp::R_386_TLS_LDM_32:
2933 case elfcpp::R_386_TLS_LDM_PUSH:
2934 case elfcpp::R_386_TLS_LDM_CALL:
2935 case elfcpp::R_386_TLS_LDM_POP:
2936 case elfcpp::R_386_USED_BY_INTEL_200:
2953 const elfcpp::Rel<32, false>& rel,
2958 elfcpp::Elf_types<32>::Elf_Addr,
2965 elfcpp::Elf_types<32>::Elf_Addr value = psymval->value(object, 0);
2974 case elfcpp::R_386_TLS_GD: // Global-dynamic
3001 unsigned int r_sym = elfcpp::elf_r_sym<32>(rel.get_r_info());
3025 case elfcpp::R_386_TLS_GOTDESC: // Global-dynamic (from ~oliva url)
3026 case elfcpp::R_386_TLS_DESC_CALL:
3047 if (r_type == elfcpp::R_386_TLS_GOTDESC
3063 unsigned int r_sym = elfcpp::elf_r_sym<32>(rel.get_r_info());
3082 if (r_type == elfcpp::R_386_TLS_GOTDESC)
3096 case elfcpp::R_386_TLS_LDM: // Local-dynamic
3132 case elfcpp::R_386_TLS_LDO_32: // Alternate local-dynamic
3140 elfcpp::Shdr<32, false> shdr(relinfo->data_shdr);
3141 if ((shdr.get_sh_flags() & elfcpp::SHF_EXECINSTR) != 0)
3155 case elfcpp::R_386_TLS_IE: // Initial-exec
3156 case elfcpp::R_386_TLS_GOTIE:
3157 case elfcpp::R_386_TLS_IE_32:
3175 unsigned int got_type = (r_type == elfcpp::R_386_TLS_IE_32
3186 unsigned int r_sym = elfcpp::elf_r_sym<32>(rel.get_r_info());
3192 if (r_type == elfcpp::R_386_TLS_IE)
3204 case elfcpp::R_386_TLS_LE: // Local-exec
3220 case elfcpp::R_386_TLS_LE_32:
3245 const elfcpp::Rel<32, false>& rel,
3247 elfcpp::Elf_types<32>::Elf_Addr value,
3309 const elfcpp::Rel<32, false>& rel,
3311 elfcpp::Elf_types<32>::Elf_Addr value,
3376 const elfcpp::Rel<32, false>& rel,
3378 elfcpp::Elf_types<32>::Elf_Addr value,
3382 if (r_type == elfcpp::R_386_TLS_GOTDESC)
3398 gold_assert(r_type == elfcpp::R_386_TLS_DESC_CALL);
3415 const elfcpp::Rel<32, false>& rel,
3417 elfcpp::Elf_types<32>::Elf_Addr value,
3421 if (r_type == elfcpp::R_386_TLS_GOTDESC)
3436 gold_assert(r_type == elfcpp::R_386_TLS_DESC_CALL);
3452 const elfcpp::Rel<32, false>& rel,
3454 elfcpp::Elf_types<32>::Elf_Addr,
3484 const elfcpp::Rel<32, false>& rel,
3486 elfcpp::Elf_types<32>::Elf_Addr value,
3493 if (r_type == elfcpp::R_386_TLS_IE)
3567 if (r_type == elfcpp::R_386_TLS_IE || r_type == elfcpp::R_386_TLS_GOTIE)
3583 elfcpp::Elf_types<32>::Elf_Addr address,
3587 gold_assert(sh_type == elfcpp::SHT_REL);
3589 gold::relocate_section<32, false, Target_i386, elfcpp::SHT_REL,
3613 case elfcpp::R_386_NONE:
3614 case elfcpp::R_386_GNU_VTINHERIT:
3615 case elfcpp::R_386_GNU_VTENTRY:
3616 case elfcpp::R_386_TLS_GD: // Global-dynamic
3617 case elfcpp::R_386_TLS_GOTDESC: // Global-dynamic (from ~oliva url)
3618 case elfcpp::R_386_TLS_DESC_CALL:
3619 case elfcpp::R_386_TLS_LDM: // Local-dynamic
3620 case elfcpp::R_386_TLS_LDO_32: // Alternate local-dynamic
3621 case elfcpp::R_386_TLS_IE: // Initial-exec
3622 case elfcpp::R_386_TLS_IE_32:
3623 case elfcpp::R_386_TLS_GOTIE:
3624 case elfcpp::R_386_TLS_LE: // Local-exec
3625 case elfcpp::R_386_TLS_LE_32:
3628 case elfcpp::R_386_32:
3629 case elfcpp::R_386_PC32:
3630 case elfcpp::R_386_GOT32:
3631 case elfcpp::R_386_PLT32:
3632 case elfcpp::R_386_GOTOFF:
3633 case elfcpp::R_386_GOTPC:
3636 case elfcpp::R_386_16:
3637 case elfcpp::R_386_PC16:
3640 case elfcpp::R_386_8:
3641 case elfcpp::R_386_PC8:
3646 case elfcpp::R_386_COPY:
3647 case elfcpp::R_386_GLOB_DAT:
3648 case elfcpp::R_386_JUMP_SLOT:
3649 case elfcpp::R_386_RELATIVE:
3650 case elfcpp::R_386_IRELATIVE:
3651 case elfcpp::R_386_TLS_TPOFF:
3652 case elfcpp::R_386_TLS_DTPMOD32:
3653 case elfcpp::R_386_TLS_DTPOFF32:
3654 case elfcpp::R_386_TLS_TPOFF32:
3655 case elfcpp::R_386_TLS_DESC:
3659 case elfcpp::R_386_32PLT:
3660 case elfcpp::R_386_TLS_GD_32:
3661 case elfcpp::R_386_TLS_GD_PUSH:
3662 case elfcpp::R_386_TLS_GD_CALL:
3663 case elfcpp::R_386_TLS_GD_POP:
3664 case elfcpp::R_386_TLS_LDM_32:
3665 case elfcpp::R_386_TLS_LDM_PUSH:
3666 case elfcpp::R_386_TLS_LDM_CALL:
3667 case elfcpp::R_386_TLS_LDM_POP:
3668 case elfcpp::R_386_USED_BY_INTEL_200:
3691 gold_assert(sh_type == elfcpp::SHT_REL);
3693 typedef gold::Default_scan_relocatable_relocs<elfcpp::SHT_REL,
3696 gold::scan_relocatable_relocs<32, false, elfcpp::SHT_REL,
3720 elfcpp::Elf_types<32>::Elf_Off offset_in_output_section,
3723 elfcpp::Elf_types<32>::Elf_Addr view_address,
3728 gold_assert(sh_type == elfcpp::SHT_REL);
3730 gold::relocate_relocs<32, false, elfcpp::SHT_REL>(
3767 elfcpp::Swap_unaligned<32, false>::writeval(jmp + 1, length - 5);
3850 return (sym->type() == elfcpp::STT_FUNC
3893 uint32_t val = elfcpp::Swap_unaligned<32, false>::readval(pval);
3895 elfcpp::Swap_unaligned<32, false>::writeval(pval, val);
3920 : Target_selector_freebsd(elfcpp::EM_386, 32, false,
3973 elfcpp::Elf_types<32>::Elf_Addr got_address);
3977 elfcpp::Elf_types<32>::Elf_Addr got_address,
4001 do_fill_first_plt_entry(unsigned char* pov, elfcpp::Elf_types<32>::Elf_Addr);
4005 elfcpp::Elf_types<32>::Elf_Addr,
4049 elfcpp::EM_386, // machine_code
4062 elfcpp::SHN_UNDEF, // small_common_shndx
4063 elfcpp::SHN_UNDEF, // large_common_shndx
4095 elfcpp::Elf_types<32>::Elf_Addr got_address)
4098 elfcpp::Swap_unaligned<32, false>::writeval(pov + 2, got_address + 4);
4099 elfcpp::Swap<32, false>::writeval(pov + 8, got_address + 8);
4126 elfcpp::Elf_types<32>::Elf_Addr)
4161 elfcpp::Elf_types<32>::Elf_Addr got_address,
4167 elfcpp::Swap_unaligned<32, false>::writeval(pov + 2,
4169 elfcpp::Swap_unaligned<32, false>::writeval(pov + 33, plt_rel_offset);
4170 elfcpp::Swap<32, false>::writeval(pov + 38, - (plt_offset + 38 + 4));
4204 elfcpp::Elf_types<32>::Elf_Addr,
4210 elfcpp::Swap_unaligned<32, false>::writeval(pov + 2, got_offset);
4211 elfcpp::Swap_unaligned<32, false>::writeval(pov + 33, plt_rel_offset);
4212 elfcpp::Swap<32, false>::writeval(pov + 38, - (plt_offset + 38 + 4));
4222 elfcpp::DW_CFA_def_cfa_offset, 8, // DW_CFA_def_cfa_offset: 8.
4223 elfcpp::DW_CFA_advance_loc + 6, // Advance 6 to __PLT__ + 6.
4224 elfcpp::DW_CFA_def_cfa_offset, 12, // DW_CFA_def_cfa_offset: 12.
4225 elfcpp::DW_CFA_advance_loc + 58, // Advance 58 to __PLT__ + 64.
4226 elfcpp::DW_CFA_def_cfa_expression, // DW_CFA_def_cfa_expression.
4228 elfcpp::DW_OP_breg4, 4, // Push %esp + 4.
4229 elfcpp::DW_OP_breg8, 0, // Push %eip.
4230 elfcpp::DW_OP_const1u, 63, // Push 0x3f.
4231 elfcpp::DW_OP_and, // & (%eip & 0x3f).
4232 elfcpp::DW_OP_const1u, 37, // Push 0x25.
4233 elfcpp::DW_OP_ge, // >= ((%eip & 0x3f) >= 0x25)
4234 elfcpp::DW_OP_lit2, // Push 2.
4235 elfcpp::DW_OP_shl, // << (((%eip & 0x3f) >= 0x25) << 2)
4236 elfcpp::DW_OP_plus, // + ((((%eip&0x3f)>=0x25)<<2)+%esp+4
4237 elfcpp::DW_CFA_nop, // Align to 32 bytes.
4238 elfcpp::DW_CFA_nop