Home | History | Annotate | Download | only in gold

Lines Matching full:elfcpp

37 #include "elfcpp.h"
97 typedef elfcpp::Elf_types<32>::Elf_Addr Arm_address;
159 { return Insn_template(data, THUMB16_TYPE, elfcpp::R_ARM_NONE, 0); }
165 { return Insn_template(data, THUMB16_SPECIAL_TYPE, elfcpp::R_ARM_NONE, 1); }
169 { return Insn_template(data, THUMB32_TYPE, elfcpp::R_ARM_NONE, 0); }
174 return Insn_template(data, THUMB32_TYPE, elfcpp::R_ARM_THM_JUMP24,
180 { return Insn_template(data, ARM_TYPE, elfcpp::R_ARM_NONE, 0); }
184 { return Insn_template(data, ARM_TYPE, elfcpp::R_ARM_JUMP24, reloc_addend); }
795 elfcpp::Swap<32, big_endian>::writeval(view,
799 elfcpp::Swap<32, big_endian>::writeval(view,
802 elfcpp::Swap<32, big_endian>::writeval(view,
1353 Arm_output_section(const char* name, elfcpp::Elf_Word type,
1354 elfcpp::Elf_Xword flags)
1356 (type == elfcpp::SHT_ARM_EXIDX
1357 ? flags | elfcpp::SHF_LINK_ORDER
1360 if (type == elfcpp::SHT_ARM_EXIDX)
1495 const typename elfcpp::Ehdr<32, big_endian>& ehdr)
1555 elfcpp::Elf_Word
1697 section_needs_reloc_stub_scanning(const elfcpp::Shdr<32, big_endian>&,
1703 section_is_scannable(const elfcpp::Shdr<32, big_endian>&, unsigned int,
1708 section_needs_cortex_a8_stub_scanning(const elfcpp::Shdr<32, big_endian>&,
1714 scan_section_for_cortex_a8_erratum(const elfcpp::Shdr<32, big_endian>&,
1733 const elfcpp::Shdr<32, big_endian>& shdr,
1735 const elfcpp::Shdr<32, big_endian>& text_shdr);
1752 elfcpp::Elf_Word processor_specific_flags_;
1775 const elfcpp::Ehdr<32, big_endian>& ehdr)
1791 elfcpp::Elf_Word
1807 elfcpp::Elf_Word processor_specific_flags_;
1820 elfcpp::Elf_types<32>::Elf_Swxword
1831 struct Stub_addend_reader<elfcpp::SHT_REL, big_endian>
1833 elfcpp::Elf_types<32>::Elf_Swxword
1837 const typename Reloc_types<elfcpp::SHT_REL, 32, big_endian>::Reloc&) const;
1846 struct Stub_addend_reader<elfcpp::SHT_RELA, big_endian>
1848 elfcpp::Elf_types<32>::Elf_Swxword
1852 const typename Reloc_types<elfcpp::SHT_RELA, 32,
2053 if (sh_type == elfcpp::SHT_RELA)
2057 if (r_type == elfcpp::R_ARM_TARGET1
2058 || r_type == elfcpp::R_ARM_TARGET2)
2069 case elfcpp::R_ARM_NONE:
2070 case elfcpp::R_ARM_V4BX:
2071 case elfcpp::R_ARM_TLS_GOTDESC:
2072 case elfcpp::R_ARM_TLS_CALL:
2073 case elfcpp::R_ARM_TLS_DESCSEQ:
2074 case elfcpp::R_ARM_THM_TLS_CALL:
2075 case elfcpp::R_ARM_GOTRELAX:
2076 case elfcpp::R_ARM_GNU_VTENTRY:
2077 case elfcpp::R_ARM_GNU_VTINHERIT:
2078 case elfcpp::R_ARM_THM_TLS_DESCSEQ16:
2079 case elfcpp::R_ARM_THM_TLS_DESCSEQ32:
2082 case elfcpp::R_ARM_TARGET1:
2083 case elfcpp::R_ARM_TARGET2:
2087 case elfcpp::R_ARM_ABS32:
2088 case elfcpp::R_ARM_REL32:
2089 case elfcpp::R_ARM_SBREL32:
2090 case elfcpp::R_ARM_GOTOFF32:
2091 case elfcpp::R_ARM_BASE_PREL:
2092 case elfcpp::R_ARM_GOT_BREL:
2093 case elfcpp::R_ARM_BASE_ABS:
2094 case elfcpp::R_ARM_ABS32_NOI:
2095 case elfcpp::R_ARM_REL32_NOI:
2096 case elfcpp::R_ARM_PLT32_ABS:
2097 case elfcpp::R_ARM_GOT_ABS:
2098 case elfcpp::R_ARM_GOT_PREL:
2099 case elfcpp::R_ARM_TLS_GD32:
2100 case elfcpp::R_ARM_TLS_LDM32:
2101 case elfcpp::R_ARM_TLS_LDO32:
2102 case elfcpp::R_ARM_TLS_IE32:
2103 case elfcpp::R_ARM_TLS_LE32:
2117 typedef Output_data_reloc<elfcpp::SHT_REL, true, 32, big_endian>
2126 rel_dyn_(NULL), rel_irelative_(NULL), copy_relocs_(elfcpp::R_ARM_COPY),
2149 this->get_aeabi_object_attribute(elfcpp::Tag_CPU_arch);
2151 return arch == elfcpp::TAG_CPU_ARCH_V6T2 || arch >= elfcpp::TAG_CPU_ARCH_V7;
2159 this->get_aeabi_object_attribute(elfcpp::Tag_CPU_arch);
2161 if (attr->int_value() == elfcpp::TAG_CPU_ARCH_V6_M
2162 || attr->int_value() == elfcpp::TAG_CPU_ARCH_V6S_M)
2164 if (attr->int_value() != elfcpp::TAG_CPU_ARCH_V7
2165 && attr->int_value() != elfcpp::TAG_CPU_ARCH_V7E_M)
2167 attr = this->get_aeabi_object_attribute(elfcpp::Tag_CPU_arch_profile);
2176 this->get_aeabi_object_attribute(elfcpp::Tag_CPU_arch);
2178 return (arch == elfcpp::TAG_CPU_ARCH_V6T2
2179 || arch == elfcpp::TAG_CPU_ARCH_V6K
2180 || arch == elfcpp::TAG_CPU_ARCH_V7
2181 || arch == elfcpp::TAG_CPU_ARCH_V7E_M);
2189 this->get_aeabi_object_attribute(elfcpp::Tag_CPU_arch);
2191 return (arch == elfcpp::TAG_CPU_ARCH_V6T2
2192 || arch == elfcpp::TAG_CPU_ARCH_V7
2193 || arch == elfcpp::TAG_CPU_ARCH_V7E_M);
2201 this->get_aeabi_object_attribute(elfcpp::Tag_CPU_arch);
2203 return (arch != elfcpp::TAG_CPU_ARCH_PRE_V4
2204 && arch != elfcpp::TAG_CPU_ARCH_V4);
2212 this->get_aeabi_object_attribute(elfcpp::Tag_CPU_arch);
2215 return (arch == elfcpp::TAG_CPU_ARCH_V6T2
2216 || arch == elfcpp::TAG_CPU_ARCH_V7
2217 || arch == elfcpp::TAG_CPU_ARCH_V6_M
2218 || arch == elfcpp::TAG_CPU_ARCH_V6S_M
2219 || arch == elfcpp::TAG_CPU_ARCH_V7E_M);
2221 return (arch != elfcpp::TAG_CPU_ARCH_PRE_V4
2222 && arch != elfcpp::TAG_CPU_ARCH_V4
2223 && arch != elfcpp::TAG_CPU_ARCH_V4T);
2311 typename elfcpp::Elf_types<32>::Elf_Off
2328 typename elfcpp::Elf_types<32>::Elf_Off
2331 typename elfcpp::Elf_types<32>::Elf_Addr
2422 gold_assert(parameters->target().machine_code() == elfcpp::EM_ARM
2479 const elfcpp::Ehdr<32, big_endian>& ehdr);
2483 const elfcpp::Ehdr<32, !big_endian>&)
2488 const elfcpp::Ehdr<64, false>&)
2493 const elfcpp::Ehdr<64, true>&)
2498 do_make_output_section(const char* name, elfcpp::Elf_Word type,
2499 elfcpp::Elf_Xword flags)
2582 const elfcpp::Rel<32, big_endian>& reloc, unsigned int r_type,
2583 const elfcpp::Sym<32, big_endian>& lsym,
2591 const elfcpp::Rel<32, big_endian>& reloc, unsigned int r_type,
2599 const elfcpp::Rel<32, big_endian>& ,
2601 const elfcpp::Sym<32, big_endian>&);
2608 const elfcpp::Rel<32, big_endian>& ,
2632 if (sym->type() == elfcpp::STT_GNU_IFUNC)
2636 && (sym->type() == elfcpp::STT_FUNC
2637 || sym->type() == elfcpp::STT_ARM_TFUNC)
2677 const elfcpp::Rel<32, big_endian>&,
2692 case elfcpp::R_ARM_GOT_BREL:
2693 case elfcpp::R_ARM_GOT_ABS:
2694 case elfcpp::R_ARM_GOT_PREL:
2695 case elfcpp::R_ARM_GOT_BREL12:
2696 case elfcpp::R_ARM_PLT32_ABS:
2697 case elfcpp::R_ARM_TLS_GD32:
2698 case elfcpp::R_ARM_TLS_LDM32:
2699 case elfcpp::R_ARM_TLS_IE32:
2700 case elfcpp::R_ARM_TLS_IE12GP:
2703 case elfcpp::R_ARM_CALL:
2704 case elfcpp::R_ARM_THM_CALL:
2705 case elfcpp::R_ARM_JUMP24:
2706 case elfcpp::R_ARM_THM_JUMP24:
2707 case elfcpp::R_ARM_THM_JUMP19:
2708 case elfcpp::R_ARM_PLT32:
2709 case elfcpp::R_ARM_THM_XPC22:
2710 case elfcpp::R_ARM_PREL31:
2711 case elfcpp::R_ARM_SBREL31:
2723 size_t, const elfcpp::Rel<32, big_endian>&, unsigned int,
2725 unsigned char*, elfcpp::Elf_types<32>::Elf_Addr,
2801 return (gsym->type() != elfcpp::STT_ARM_TFUNC
2810 Symbol* sym, const elfcpp::Rel<32, big_endian>& reloc)
2820 are_eabi_versions_compatible(elfcpp::Elf_Word v1, elfcpp::Elf_Word v2);
2825 merge_processor_specific_flags(const std::string&, elfcpp::Elf_Word);
2887 elfcpp::Elf_types<32>::Elf_Swxword, Arm_address);
2899 elfcpp::Elf_types<32>::Elf_Addr view_address,
2958 Copy_relocs<elfcpp::SHT_REL, 32, big_endian> copy_relocs_;
2984 elfcpp::EM_ARM, // machine_code
2997 elfcpp::SHN_UNDEF, // small_common_shndx
2998 elfcpp::SHN_UNDEF, // large_common_shndx
3036 static inline typename elfcpp::Swap<32, big_endian>::Valtype
3038 typename elfcpp::Swap<32, big_endian>::Valtype val)
3047 static inline typename elfcpp::Swap<32, big_endian>::Valtype
3049 typename elfcpp::Swap<32, big_endian>::Valtype val,
3050 typename elfcpp::Swap<32, big_endian>::Valtype x)
3070 static inline typename elfcpp::Swap<32, big_endian>::Valtype
3072 typename elfcpp::Swap<32, big_endian>::Valtype val)
3084 static inline typename elfcpp::Swap<32, big_endian>::Valtype
3086 typename elfcpp::Swap<32, big_endian>::Valtype val,
3087 typename elfcpp::Swap<32, big_endian>::Valtype x)
3100 calc_grp_kn(typename elfcpp::Swap<32, big_endian>::Valtype residual)
3119 static typename elfcpp::Swap<32, big_endian>::Valtype
3120 calc_grp_residual(typename elfcpp::Swap<32, big_endian>::Valtype residual,
3137 static typename elfcpp::Swap<32, big_endian>::Valtype
3138 calc_grp_gn(typename elfcpp::Swap<32, big_endian>::Valtype residual,
3141 typename elfcpp::Swap<32, big_endian>::Valtype gn = 0;
3260 typedef typename elfcpp::Swap<8, big_endian>::Valtype Valtype;
3262 Valtype val = elfcpp::Swap<8, big_endian>::readval(wv);
3266 elfcpp::Swap<8, big_endian>::writeval(wv, val);
3280 typedef typename elfcpp::Swap<16, big_endian>::Valtype Valtype;
3281 typedef typename elfcpp::Swap<32, big_endian>::Valtype Reltype;
3283 Valtype val = elfcpp::Swap<16, big_endian>::readval(wv);
3287 elfcpp::Swap<16, big_endian>::writeval(wv, val);
3299 typedef typename elfcpp::Swap<32, big_endian>::Valtype Valtype;
3300 typedef typename elfcpp::Swap<32, big_endian>::Valtype Reltype;
3302 Valtype val = elfcpp::Swap<32, big_endian>::readval(wv);
3306 elfcpp::Swap<32, big_endian>::writeval(wv, val);
3318 typedef typename elfcpp::Swap_unaligned<16, big_endian>::Valtype Valtype;
3319 Valtype val = elfcpp::Swap_unaligned<16, big_endian>::readval(view);
3323 elfcpp::Swap_unaligned<16, big_endian>::writeval(view, val);
3338 typedef typename elfcpp::Swap_unaligned<32, big_endian>::Valtype Valtype;
3339 Valtype addend = elfcpp::Swap_unaligned<32, big_endian>::readval(view);
3341 elfcpp::Swap_unaligned<32, big_endian>::writeval(view, x);
3353 typedef typename elfcpp::Swap_unaligned<32, big_endian>::Valtype Valtype;
3354 Valtype addend = elfcpp::Swap_unaligned<32, big_endian>::readval(view);
3356 elfcpp::Swap_unaligned<32, big_endian>::writeval(view, x);
3373 typedef typename elfcpp::Swap<16, big_endian>::Valtype Valtype;
3374 typedef typename elfcpp::Swap<16, big_endian>::Valtype Reltype;
3376 Valtype val = elfcpp::Swap<16, big_endian>::readval(wv);
3381 elfcpp::Swap<16, big_endian>::writeval(wv, val);
3395 typedef typename elfcpp::Swap<16, big_endian>::Valtype Valtype;
3397 Valtype val = elfcpp::Swap<16, big_endian>::readval(wv);
3400 elfcpp::Swap<16, big_endian>::writeval(wv, ((val & 0xff00)
3415 typedef typename elfcpp::Swap<16, big_endian>::Valtype Valtype;
3417 Valtype val = elfcpp::Swap<16, big_endian>::readval(wv);
3420 elfcpp::Swap<16, big_endian>::writeval(wv, ((val & 0xf800)
3450 typename elfcpp::Swap<32, big_endian>::Valtype got_offset)
3474 typedef typename elfcpp::Swap_unaligned<32, big_endian>::Valtype Valtype;
3475 Valtype val = elfcpp::Swap_unaligned<32, big_endian>::readval(view);
3479 elfcpp::Swap_unaligned<32, big_endian>::writeval(view, val);
3497 typedef typename elfcpp::Swap<32, big_endian>::Valtype Valtype;
3499 Valtype val = elfcpp::Swap<32, big_endian>::readval(wv);
3504 elfcpp::Swap<32, big_endian>::writeval(wv, val);
3519 typedef typename elfcpp::Swap<32, big_endian>::Valtype Valtype;
3521 Valtype val = elfcpp::Swap<32, big_endian>::readval(wv);
3525 elfcpp::Swap<32, big_endian>::writeval(wv, val);
3542 typedef typename elfcpp::Swap<16, big_endian>::Valtype Valtype;
3543 typedef typename elfcpp::Swap<32, big_endian>::Valtype Reltype;
3545 Reltype val = (elfcpp::Swap<16, big_endian>::readval(wv) << 16)
3546 | elfcpp::Swap<16, big_endian>::readval(wv + 1);
3551 elfcpp::Swap<16, big_endian>::writeval(wv, val >> 16);
3552 elfcpp::Swap<16, big_endian>::writeval(wv + 1, val & 0xffff);
3567 typedef typename elfcpp::Swap<16, big_endian>::Valtype Valtype;
3568 typedef typename elfcpp::Swap<32, big_endian>::Valtype Reltype;
3570 Reltype val = (elfcpp::Swap<16, big_endian>::readval(wv) << 16)
3571 | elfcpp::Swap<16, big_endian>::readval(wv + 1);
3575 elfcpp::Swap<16, big_endian>::writeval(wv, val >> 16);
3576 elfcpp::Swap<16, big_endian>::writeval(wv + 1, val & 0xffff);
3588 typedef typename elfcpp::Swap<16, big_endian>::Valtype Valtype;
3589 typedef typename elfcpp::Swap<32, big_endian>::Valtype Reltype;
3591 Reltype insn = (elfcpp::Swap<16, big_endian>::readval(wv) << 16)
3592 | elfcpp::Swap<16, big_endian>::readval(wv + 1);
3628 elfcpp::Swap<16, big_endian>::writeval(wv, insn >> 16);
3629 elfcpp::Swap<16, big_endian>::writeval(wv + 1, insn & 0xffff);
3641 typedef typename elfcpp::Swap<16, big_endian>::Valtype Valtype;
3642 typedef typename elfcpp::Swap<16, big_endian>::Valtype Reltype;
3644 Valtype insn = elfcpp::Swap<16, big_endian>::readval(wv);
3650 elfcpp::Swap<16, big_endian>::writeval(wv, insn);
3663 typedef typename elfcpp::Swap<16, big_endian>::Valtype Valtype;
3664 typedef typename elfcpp::Swap<32, big_endian>::Valtype Reltype;
3666 Reltype insn = (elfcpp::Swap<16, big_endian>::readval(wv) << 16)
3667 | elfcpp::Swap<16, big_endian>::readval(wv + 1);
3683 elfcpp::Swap<16, big_endian>::writeval(wv, insn >> 16);
3684 elfcpp::Swap<16, big_endian>::writeval(wv + 1, insn & 0xffff);
3698 typedef typename elfcpp::Swap<32, big_endian>::Valtype Valtype;
3700 Valtype val = elfcpp::Swap<32, big_endian>::readval(wv);
3728 elfcpp::Swap<32, big_endian>::writeval(wv, val);
3752 typedef typename elfcpp::Swap<32, big_endian>::Valtype Valtype;
3754 Valtype insn = elfcpp::Swap<32, big_endian>::readval(wv);
3789 elfcpp::Swap<32, big_endian>::writeval(wv, insn);
3807 typedef typename elfcpp::Swap<32, big_endian>::Valtype Valtype;
3809 Valtype insn = elfcpp::Swap<32, big_endian>::readval(wv);
3827 elfcpp::Swap<32, big_endian>::writeval(wv, insn);
3845 typedef typename elfcpp::Swap<32, big_endian>::Valtype Valtype;
3847 Valtype insn = elfcpp::Swap<32, big_endian>::readval(wv);
3865 elfcpp::Swap<32, big_endian>::writeval(wv, insn);
3883 typedef typename elfcpp::Swap<32, big_endian>::Valtype Valtype;
3885 Valtype insn = elfcpp::Swap<32, big_endian>::readval(wv);
3903 elfcpp::Swap<32, big_endian>::writeval(wv, insn);
3928 typedef typename elfcpp::Swap<32, big_endian>::Valtype Valtype;
3930 Valtype val = elfcpp::Swap<32, big_endian>::readval(wv);
3941 if (r_type == elfcpp::R_ARM_CALL)
3946 else if (r_type == elfcpp::R_ARM_JUMP24)
3951 else if (r_type == elfcpp::R_ARM_PLT32)
3956 else if (r_type == elfcpp::R_ARM_XPC25)
3981 elfcpp::Swap<32, big_endian>::writeval(wv, val);
3997 && !(may_use_blx && r_type == elfcpp::R_ARM_CALL))))
4026 gold_assert(may_use_blx && r_type == elfcpp::R_ARM_CALL);
4031 elfcpp::Swap<32, big_endian>::writeval(wv, val);
4057 typedef typename elfcpp::Swap<16, big_endian>::Valtype Valtype;
4059 uint32_t upper_insn = elfcpp::Swap<16, big_endian>::readval(wv);
4060 uint32_t lower_insn = elfcpp::Swap<16, big_endian>::readval(wv + 1);
4068 if (r_type == elfcpp::R_ARM_THM_CALL)
4073 else if (r_type == elfcpp::R_ARM_THM_JUMP24)
4079 else if (r_type == elfcpp::R_ARM_THM_XPC22)
4108 elfcpp::Swap<16, big_endian>::writeval(wv, 0xf3af);
4109 elfcpp::Swap<16, big_endian>::writeval(wv + 1, 0x8000);
4113 elfcpp::Swap<16, big_endian>::writeval(wv, 0xe000);
4114 elfcpp::Swap<16, big_endian>::writeval(wv + 1, 0xbf00);
4136 && (((r_type == elfcpp::R_ARM_THM_CALL) && !may_use_blx)
4137 || r_type == elfcpp::R_ARM_THM_JUMP24))))
4168 && (r_type == elfcpp::R_ARM_THM_CALL
4169 || r_type == elfcpp::R_ARM_THM_XPC22));
4192 elfcpp::Swap<16, big_endian>::writeval(wv, upper_insn);
4193 elfcpp::Swap<16, big_endian>::writeval(wv + 1, lower_insn);
4218 typedef typename elfcpp::Swap<16, big_endian>::Valtype Valtype;
4220 uint32_t upper_insn = elfcpp::Swap<16, big_endian>::readval(wv);
4221 uint32_t lower_insn = elfcpp::Swap<16, big_endian>::readval(wv + 1);
4241 elfcpp::Swap<16, big_endian>::writeval(wv, upper_insn);
4242 elfcpp::Swap<16, big_endian>::writeval(wv + 1, lower_insn);
4272 layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
4273 (elfcpp::SHF_ALLOC | elfcpp::SHF_WRITE),
4281 layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
4282 (elfcpp::SHF_ALLOC | elfcpp::SHF_WRITE),
4292 0, 0, elfcpp::STT_OBJECT,
4293 elfcpp::STB_LOCAL,
4294 elfcpp::STV_HIDDEN, 0,
4300 layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
4301 (elfcpp::SHF_ALLOC | elfcpp::SHF_WRITE),
4322 layout->add_output_section_data(".rel.dyn", elfcpp::SHT_REL,
4323 elfcpp::SHF_ALLOC, this->rel_dyn_,
4325 layout->add_output_section_data(".rel.dyn", elfcpp::SHT_REL,
4326 elfcpp::SHF_ALLOC, this->rel_irelative_,
4421 if (insns[i].r_type() != elfcpp::R_ARM_NONE)
4430 if (insns[i].r_type() == elfcpp::R_ARM_JUMP24)
4466 elfcpp::Swap<16, big_endian>::writeval(pov, insns[i].data() & 0xffff);
4469 elfcpp::Swap<16, big_endian>::writeval(
4477 elfcpp::Swap<16, big_endian>::writeval(pov, hi);
4478 elfcpp::Swap<16, big_endian>::writeval(pov + 2, lo);
4483 elfcpp::Swap<32, big_endian>::writeval(pov, insns[i].data());
4574 if (r_type == elfcpp::R_ARM_THM_CALL || r_type == elfcpp::R_ARM_THM_JUMP24)
4578 if ((r_type == elfcpp::R_ARM_THM_CALL) && may_use_blx && !target_is_thumb)
4594 && (((r_type == elfcpp::R_ARM_THM_CALL) && !may_use_blx)
4595 || (r_type == elfcpp::R_ARM_THM_JUMP24))))
4606 && (r_type == elfcpp::R_ARM_THM_CALL))
4617 && (r_type == elfcpp::R_ARM_THM_CALL))
4640 && (r_type == elfcpp::R_ARM_THM_CALL))
4646 && (r_type == elfcpp::R_ARM_THM_CALL))
4658 else if (r_type == elfcpp::R_ARM_CALL
4659 || r_type == elfcpp::R_ARM_JUMP24
4660 || r_type == elfcpp::R_ARM_PLT32)
4674 || ((r_type == elfcpp::R_ARM_CALL) && !may_use_blx)
4675 || (r_type == elfcpp::R_ARM_JUMP24)
4676 || (r_type == elfcpp::R_ARM_PLT32))
4739 Insn_template::data_word(0, elfcpp::R_ARM_ABS32, 0),
4749 Insn_template::data_word(0, elfcpp::R_ARM_ABS32, 0),
4762 Insn_template::data_word(0, elfcpp::R_ARM_ABS32, 0),
4774 Insn_template::data_word(0, elfcpp::R_ARM_ABS32, 0),
4785 Insn_template::data_word(0, elfcpp::R_ARM_ABS32, 0),
4804 Insn_template::data_word(0, elfcpp::R_ARM_REL32, -4),
4817 Insn_template::data_word(0, elfcpp::R_ARM_REL32, 0),
4827 Insn_template::data_word(0, elfcpp::R_ARM_REL32, 0),
4838 Insn_template::data_word(0, elfcpp::R_ARM_REL32, -4),
4852 Insn_template::data_word(0, elfcpp::R_ARM_REL32, 4),
4865 Insn_template::data_word(0, elfcpp::R_ARM_REL32, 0),
5410 elfcpp::Swap_unaligned<32, big_endian>::writeval(oview,
5412 elfcpp::Swap_unaligned<32, big_endian>::writeval(oview + 4,
5413 elfcpp::EXIDX_CANTUNWIND);
5587 if (second_word == elfcpp::EXIDX_CANTUNWIND)
5668 typedef typename elfcpp::Swap<32, big_endian>::Valtype Valtype;
5671 uint32_t second_word = elfcpp::Swap<32, big_endian>::readval(wv);
5737 gold_assert(this->type() != elfcpp::SHT_ARM_EXIDX);
5943 gold_assert((this->flags() & elfcpp::SHF_ALLOC) != 0);
5967 gold_assert(this->type() == elfcpp::SHT_ARM_EXIDX);
6153 gold_assert(this->type() == elfcpp::SHT_ARM_EXIDX);
6179 const elfcpp::Shdr<32, big_endian>& shdr,
6187 || (shdr.get_sh_flags() & elfcpp::SHF_ALLOC) == 0
6188 || shdr.get_sh_type() != elfcpp::SHT_PROGBITS)
6215 const elfcpp::Shdr<32, big_endian>& shdr,
6221 if (sh_type != elfcpp::SHT_REL && sh_type != elfcpp::SHT_RELA)
6235 if (sh_type == elfcpp::SHT_REL)
6236 reloc_size = elfcpp::Elf_sizes<32>::rel_size;
6238 reloc_size = elfcpp::Elf_sizes<32>::rela_size;
6251 const unsigned int shdr_size = elfcpp::Elf_sizes<32>::shdr_size;
6252 const elfcpp::Shdr<32, big_endian> text_shdr(pshdrs + index * shdr_size);
6286 const elfcpp::Shdr<32, big_endian>& shdr,
6308 const elfcpp::Shdr<32, big_endian>& shdr,
6380 const unsigned int shdr_size = elfcpp::Elf_sizes<32>::shdr_size;
6402 const elfcpp::Shdr<32, big_endian> shdr(p);
6436 if (sh_type == elfcpp::SHT_REL)
6437 reloc_size = elfcpp::Elf_sizes<32>::rel_size;
6439 reloc_size = elfcpp::Elf_sizes<32>::rela_size;
6461 const elfcpp::Shdr<32, big_endian> shdr(p);
6505 elfcpp::Shdr<32, big_endian>
6507 gold_assert(symtabshdr.get_sh_type() == elfcpp::SHT_SYMTAB);
6510 const int sym_size =elfcpp::Elf_sizes<32>::sym_size;
6524 elfcpp::Shdr<32, big_endian>
6526 if (strtabshdr.get_sh_type() != elfcpp::SHT_STRTAB)
6546 elfcpp::Sym<32, big_endian> sym(psyms);
6547 elfcpp::STT st_type = sym.get_st_type();
6565 if (st_type == elfcpp::STT_ARM_TFUNC
6566 || (st_type == elfcpp::STT_FUNC && ((input_value & 1) != 0)))
6619 relinfo.reloc_shndx = elfcpp::SHN_UNDEF;
6622 relinfo.data_shdr = pshdrs + i * elfcpp::Elf_sizes<32>::shdr_size;
6694 elfcpp::Shdr<32, big_endian> shdr(pshdr);
6698 if (shdr.get_sh_type() == elfcpp::SHT_REL)
6699 reloc_size = elfcpp::Elf_sizes<32>::rel_size;
6701 reloc_size = elfcpp::Elf_sizes<32>::rela_size;
6712 typename elfcpp::Elf_types<32>::Elf_WXword r_info;
6713 if (shdr.get_sh_type() == elfcpp::SHT_REL)
6715 typename elfcpp::Rel<32, big_endian> reloc(prelocs);
6721 typename elfcpp::Rela<32, big_endian> reloc(prelocs);
6726 unsigned int r_type = elfcpp::elf_r_type<32>(r_info);
6727 if (r_type != elfcpp::R_ARM_PREL31 && r_type != elfcpp::R_ARM_SBREL31)
6730 unsigned int r_sym = elfcpp::elf_r_sym<32>(r_info);
6738 const int sym_size = elfcpp::Elf_sizes<32>::sym_size;
6739 elfcpp::Sym<32, big_endian> sym(psyms + r_sym * sym_size);
6740 if (sym.get_st_type() == elfcpp::STT_SECTION)
6763 const elfcpp::Shdr<32, big_endian>& shdr,
6765 const elfcpp::Shdr<32, big_endian>& text_shdr)
6776 if (text_shndx == elfcpp::SHN_UNDEF || text_shndx >= this->shnum())
6799 if ((text_shdr.get_sh_flags() & elfcpp::SHF_ALLOC) == 0)
6808 else if ((text_shdr.get_sh_flags() & elfcpp::SHF_EXECINSTR) == 0)
6838 const unsigned char* pehdr = this->get_view(elfcpp::file_header_offset,
6839 elfcpp::Elf_sizes<32>::ehdr_size,
6841 elfcpp::Ehdr<32, big_endian> ehdr(pehdr);
6847 const size_t shdr_size = elfcpp::Elf_sizes<32>::shdr_size;
6853 elfcpp::Shdr<32, big_endian> shdr(ps);
6858 if (shdr.get_sh_type() == elfcpp::SHT_SYMTAB)
6861 const elfcpp::Elf_types<32>::Elf_WXword sym_size =
6862 elfcpp::Elf_sizes<32>::sym_size;
6866 else if (shdr.get_sh_type() != elfcpp::SHT_STRTAB)
6871 if (shdr.get_sh_type() == elfcpp::SHT_ARM_ATTRIBUTES)
6882 else if (shdr.get_sh_type() == elfcpp::SHT_ARM_EXIDX)
6885 if (text_shndx == elfcpp::SHN_UNDEF)
6889 elfcpp::Shdr<32, big_endian> text_shdr(pshdrs
6894 if ((shdr.get_sh_flags() & elfcpp::SHF_LINK_ORDER) == 0)
6922 elfcpp::Shdr<32, big_endian> shdr(ps);
6923 elfcpp::Elf_Word sh_type = shdr.get_sh_type();
6924 if (sh_type == elfcpp::SHT_REL || sh_type == elfcpp::SHT_RELA)
6942 elfcpp::Shdr<32, big_endian>
6944 gold_assert(symtabshdr.get_sh_type() == elfcpp::SHT_SYMTAB);
6947 const int sym_size =elfcpp::Elf_sizes<32>::sym_size;
6958 elfcpp::Shdr<32, big_endian> shdr(pshdrs + shndx * shdr_size);
6959 unsigned int text_shndx = elfcpp::SHN_UNDEF;
6964 elfcpp::Shdr<32, big_endian> text_shdr(pshdrs
6993 const unsigned int shdr_size = elfcpp::Elf_sizes<32>::shdr_size;
7003 elfcpp::Shdr<32, big_endian> shdr(ps);
7004 if (shdr.get_sh_type() == elfcpp::SHT_ARM_EXIDX)
7036 elfcpp::Shdr<32, big_endian>
7038 gold_assert(symtabshdr.get_sh_type() == elfcpp::SHT_SYMTAB);
7041 const int sym_size = elfcpp::Elf_sizes<32>::sym_size;
7059 elfcpp::Sym<32, big_endian> sym(psyms);
7119 const unsigned char* pehdr = this->get_view(elfcpp::file_header_offset,
7120 elfcpp::Elf_sizes<32>::ehdr_size,
7122 elfcpp::Ehdr<32, big_endian> ehdr(pehdr);
7128 const size_t shdr_size = elfcpp::Elf_sizes<32>::shdr_size;
7133 elfcpp::Shdr<32, big_endian> shdr(ps);
7134 if (shdr.get_sh_type() == elfcpp::SHT_ARM_ATTRIBUTES)
7153 elfcpp::Elf_types<32>::Elf_Swxword
7154 Stub_addend_reader<elfcpp::SHT_REL, big_endian>::operator()(
7157 const typename Reloc_types<elfcpp::SHT_REL, 32, big_endian>::Reloc&) const
7163 case elfcpp::R_ARM_CALL:
7164 case elfcpp::R_ARM_JUMP24:
7165 case elfcpp::R_ARM_PLT32:
7167 typedef typename elfcpp::Swap<32, big_endian>::Valtype Valtype;
7169 Valtype val = elfcpp::Swap<32, big_endian>::readval(wv);
7173 case elfcpp::R_ARM_THM_CALL:
7174 case elfcpp::R_ARM_THM_JUMP24:
7175 case elfcpp::R_ARM_THM_XPC22:
7177 typedef typename elfcpp::Swap<16, big_endian>::Valtype Valtype;
7179 Valtype upper_insn = elfcpp::Swap<16, big_endian>::readval(wv);
7180 Valtype lower_insn = elfcpp::Swap<16, big_endian>::readval(wv + 1);
7184 case elfcpp::R_ARM_THM_JUMP19:
7186 typedef typename elfcpp::Swap<16, big_endian>::Valtype Valtype;
7188 Valtype upper_insn = elfcpp::Swap<16, big_endian>::readval(wv);
7189 Valtype lower_insn = elfcpp::Swap<16, big_endian>::readval(wv + 1);
7221 elfcpp::R_ARM_TLS_DTPOFF32,
7243 elfcpp::R_ARM_TLS_DTPOFF32,
7288 if ((shndx == elfcpp::SHN_UNDEF)
7290 && shndx != elfcpp::SHN_UNDEF
7334 typedef typename elfcpp::Swap<32, big_endian>::Valtype Valtype;
7339 case elfcpp::R_ARM_TLS_DTPOFF32:
7342 case elfcpp::R_ARM_TLS_TPOFF32:
7348 elfcpp::Swap<32, big_endian>::writeval(wv, x);
7401 typedef Output_data_reloc<elfcpp::SHT_REL, true, 32, big_endian>
7552 layout->add_output_section_data(".rel.plt", elfcpp::SHT_REL,
7553 elfcpp::SHF_ALLOC, this->rel_,
7592 if (gsym->type() == elfcpp::STT_GNU_IFUNC
7661 elfcpp::R_ARM_IRELATIVE,
7674 if (gsym->type() == elfcpp::STT_GNU_IFUNC
7678 rel->add_symbolless_global_addend(gsym, elfcpp::R_ARM_IRELATIVE,
7684 this->rel_->add_global(gsym, elfcpp::R_ARM_JUMP_SLOT, this->got_plt_,
7717 elfcpp::STT_NOTYPE, elfcpp::STB_GLOBAL,
7718 elfcpp::STV_HIDDEN, 0, false, true);
7722 elfcpp::STT_NOTYPE, elfcpp::STB_GLOBAL,
7723 elfcpp::STV_HIDDEN, 0, true, true);
7737 if (gsym->type() == elfcpp::STT_GNU_IFUNC
7832 elfcpp::Swap<32, big_endian>::writeval(pov + i * 4, first_plt_entry[i]);
7834 elfcpp::Swap<32, big_endian>::writeval(pov + 16,
7862 elfcpp::Swap<32, big_endian>::writeval(pov, plt_insn0);
7864 elfcpp::Swap<32, big_endian>::writeval(pov + 4, plt_insn1);
7866 elfcpp::Swap<32, big_endian>::writeval(pov + 8, plt_insn2);
7937 gold_assert(sized_symbol->type() == elfcpp::STT_GNU_IFUNC);
7946 elfcpp::Swap<32, big_endian>::writeval(got_pov, value);
7992 layout->add_output_section_data(".plt", elfcpp::SHT_PROGBITS,
7993 (elfcpp::SHF_ALLOC
7994 | elfcpp::SHF_EXECINSTR),
7999 0, 0, elfcpp::STT_NOTYPE,
8000 elfcpp::STB_LOCAL,
8001 elfcpp::STV_DEFAULT, 0,
8083 elfcpp::STT_TLS,
8084 elfcpp::STB_LOCAL,
8085 elfcpp::STV_HIDDEN, 0,
8112 rel_dyn->add_local(object, 0, elfcpp::R_ARM_TLS_DTPMOD32, got,
8148 case elfcpp::R_ARM_NONE:
8149 case elfcpp::R_ARM_V4BX:
8150 case elfcpp::R_ARM_GNU_VTENTRY:
8151 case elfcpp::R_ARM_GNU_VTINHERIT:
8155 case elfcpp::R_ARM_ABS32:
8156 case elfcpp::R_ARM_ABS16:
8157 case elfcpp::R_ARM_ABS12:
8158 case elfcpp::R_ARM_THM_ABS5:
8159 case elfcpp::R_ARM_ABS8:
8160 case elfcpp::R_ARM_BASE_ABS:
8161 case elfcpp::R_ARM_MOVW_ABS_NC:
8162 case elfcpp::R_ARM_MOVT_ABS:
8163 case elfcpp::R_ARM_THM_MOVW_ABS_NC:
8164 case elfcpp::R_ARM_THM_MOVT_ABS:
8165 case elfcpp::R_ARM_ABS32_NOI:
8168 case elfcpp::R_ARM_REL32:
8169 case elfcpp::R_ARM_LDR_PC_G0:
8170 case elfcpp::R_ARM_SBREL32:
8171 case elfcpp::R_ARM_THM_PC8:
8172 case elfcpp::R_ARM_BASE_PREL:
8173 case elfcpp::R_ARM_MOVW_PREL_NC:
8174 case elfcpp::R_ARM_MOVT_PREL:
8175 case elfcpp::R_ARM_THM_MOVW_PREL_NC:
8176 case elfcpp::R_ARM_THM_MOVT_PREL:
8177 case elfcpp::R_ARM_THM_ALU_PREL_11_0:
8178 case elfcpp::R_ARM_THM_PC12:
8179 case elfcpp::R_ARM_REL32_NOI:
8180 case elfcpp::R_ARM_ALU_PC_G0_NC:
8181 case elfcpp::R_ARM_ALU_PC_G0:
8182 case elfcpp::R_ARM_ALU_PC_G1_NC:
8183 case elfcpp::R_ARM_ALU_PC_G1:
8184 case elfcpp::R_ARM_ALU_PC_G2:
8185 case elfcpp::R_ARM_LDR_PC_G1:
8186 case elfcpp::R_ARM_LDR_PC_G2:
8187 case elfcpp::R_ARM_LDRS_PC_G0:
8188 case elfcpp::R_ARM_LDRS_PC_G1:
8189 case elfcpp::R_ARM_LDRS_PC_G2:
8190 case elfcpp::R_ARM_LDC_PC_G0:
8191 case elfcpp::R_ARM_LDC_PC_G1:
8192 case elfcpp::R_ARM_LDC_PC_G2:
8193 case elfcpp::R_ARM_ALU_SB_G0_NC:
8194 case elfcpp::R_ARM_ALU_SB_G0:
8195 case elfcpp::R_ARM_ALU_SB_G1_NC:
8196 case elfcpp::R_ARM_ALU_SB_G1:
8197 case elfcpp::R_ARM_ALU_SB_G2:
8198 case elfcpp::R_ARM_LDR_SB_G0:
8199 case elfcpp::R_ARM_LDR_SB_G1:
8200 case elfcpp::R_ARM_LDR_SB_G2:
8201 case elfcpp::R_ARM_LDRS_SB_G0:
8202 case elfcpp::R_ARM_LDRS_SB_G1:
8203 case elfcpp::R_ARM_LDRS_SB_G2:
8204 case elfcpp::R_ARM_LDC_SB_G0:
8205 case elfcpp::R_ARM_LDC_SB_G1:
8206 case elfcpp::R_ARM_LDC_SB_G2:
8207 case elfcpp::R_ARM_MOVW_BREL_NC:
8208 case elfcpp::R_ARM_MOVT_BREL:
8209 case elfcpp::R_ARM_MOVW_BREL:
8210 case elfcpp::R_ARM_THM_MOVW_BREL_NC:
8211 case elfcpp::R_ARM_THM_MOVT_BREL:
8212 case elfcpp::R_ARM_THM_MOVW_BREL:
8213 case elfcpp::R_ARM_GOTOFF32:
8214 case elfcpp::R_ARM_GOTOFF12:
8215 case elfcpp::R_ARM_SBREL31:
8218 case elfcpp::R_ARM_PLT32:
8219 case elfcpp::R_ARM_CALL:
8220 case elfcpp::R_ARM_JUMP24:
8221 case elfcpp::R_ARM_THM_CALL:
8222 case elfcpp::R_ARM_THM_JUMP24:
8223 case elfcpp::R_ARM_THM_JUMP19:
8224 case elfcpp::R_ARM_THM_JUMP6:
8225 case elfcpp::R_ARM_THM_JUMP11:
8226 case elfcpp::R_ARM_THM_JUMP8:
8230 case elfcpp::R_ARM_PREL31:
8233 case elfcpp::R_ARM_GOT_BREL:
8234 case elfcpp::R_ARM_GOT_ABS:
8235 case elfcpp::R_ARM_GOT_PREL:
8239 case elfcpp::R_ARM_TLS_GD32: // Global-dynamic
8240 case elfcpp::R_ARM_TLS_LDM32: // Local-dynamic
8241 case elfcpp::R_ARM_TLS_LDO32: // Alternate local-dynamic
8242 case elfcpp::R_ARM_TLS_IE32: // Initial-exec
8243 case elfcpp::R_ARM_TLS_LE32: // Local-exec
8246 case elfcpp::R_ARM_TARGET1:
8247 case elfcpp::R_ARM_TARGET2:
8248 case elfcpp::R_ARM_COPY:
8249 case elfcpp::R_ARM_GLOB_DAT:
8250 case elfcpp::R_ARM_JUMP_SLOT:
8251 case elfcpp::R_ARM_RELATIVE:
8252 case elfcpp::R_ARM_PC24:
8253 case elfcpp::R_ARM_LDR_SBREL_11_0_NC:
8254 case elfcpp::R_ARM_ALU_SBREL_19_12_NC:
8255 case elfcpp::R_ARM_ALU_SBREL_27_20_CK:
8290 case elfcpp::R_ARM_RELATIVE:
8291 case elfcpp::R_ARM_COPY:
8292 case elfcpp::R_ARM_GLOB_DAT:
8293 case elfcpp::R_ARM_JUMP_SLOT:
8294 case elfcpp::R_ARM_ABS32:
8295 case elfcpp::R_ARM_ABS32_NOI:
8296 case elfcpp::R_ARM_IRELATIVE:
8297 case elfcpp::R_ARM_PC24:
8300 case elfcpp::R_ARM_TLS_DTPMOD32:
8301 case elfcpp::R_ARM_TLS_DTPOFF32:
8302 case elfcpp::R_ARM_TLS_TPOFF32:
8322 case elfcpp::R_ARM_NONE:
8360 const elfcpp::Rel<32, big_endian>& reloc,
8362 const elfcpp::Sym<32, big_endian>& lsym,
8371 bool is_ifunc = lsym.get_st_type() == elfcpp::STT_GNU_IFUNC;
8374 unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
8380 case elfcpp::R_ARM_NONE:
8381 case elfcpp::R_ARM_V4BX:
8382 case elfcpp::R_ARM_GNU_VTENTRY:
8383 case elfcpp::R_ARM_GNU_VTINHERIT:
8386 case elfcpp::R_ARM_ABS32:
8387 case elfcpp::R_ARM_ABS32_NOI:
8397 unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
8400 rel_dyn->add_local_relative(object, r_sym, elfcpp::R_ARM_RELATIVE,
8406 case elfcpp::R_ARM_ABS16:
8407 case elfcpp::R_ARM_ABS12:
8408 case elfcpp::R_ARM_THM_ABS5:
8409 case elfcpp::R_ARM_ABS8:
8410 case elfcpp::R_ARM_BASE_ABS:
8411 case elfcpp::R_ARM_MOVW_ABS_NC:
8412 case elfcpp::R_ARM_MOVT_ABS:
8413 case elfcpp::R_ARM_THM_MOVW_ABS_NC:
8414 case elfcpp::R_ARM_THM_MOVT_ABS:
8424 unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
8425 if (lsym.get_st_type() != elfcpp::STT_SECTION)
8446 case elfcpp::R_ARM_REL32:
8447 case elfcpp::R_ARM_LDR_PC_G0:
8448 case elfcpp::R_ARM_SBREL32:
8449 case elfcpp::R_ARM_THM_CALL:
8450 case elfcpp::R_ARM_THM_PC8:
8451 case elfcpp::R_ARM_BASE_PREL:
8452 case elfcpp::R_ARM_PLT32:
8453 elfcpp::R_ARM_CALL:
8454 case elfcpp::R_ARM_JUMP24:
8455 case elfcpp::R_ARM_THM_JUMP24:
8456 case elfcpp::R_ARM_SBREL31:
8457 case elfcpp::R_ARM_PREL31:
8458 case elfcpp::R_ARM_MOVW_PREL_NC:
8459 case elfcpp::R_ARM_MOVT_PREL:
8460 case elfcpp::R_ARM_THM_MOVW_PREL_NC:
8461 case elfcpp::R_ARM_THM_MOVT_PREL:
8462 case elfcpp::R_ARM_THM_JUMP19:
8463 case elfcpp::R_ARM_THM_JUMP6:
8464 case elfcpp::R_ARM_THM_ALU_PREL_11_0:
8465 case elfcpp::R_ARM_THM_PC12:
8466 case elfcpp::R_ARM_REL32_NOI:
8467 case elfcpp::R_ARM_ALU_PC_G0_NC:
8468 case elfcpp::R_ARM_ALU_PC_G0:
8469 case elfcpp::R_ARM_ALU_PC_G1_NC:
8470 case elfcpp::R_ARM_ALU_PC_G1:
8471 case elfcpp::R_ARM_ALU_PC_G2:
8472 case elfcpp::R_ARM_LDR_PC_G1:
8473 case elfcpp::R_ARM_LDR_PC_G2:
8474 case elfcpp::R_ARM_LDRS_PC_G0:
8475 case elfcpp::R_ARM_LDRS_PC_G1:
8476 case elfcpp::R_ARM_LDRS_PC_G2:
8477 case elfcpp::R_ARM_LDC_PC_G0:
8478 case elfcpp::R_ARM_LDC_PC_G1:
8479 case elfcpp::R_ARM_LDC_PC_G2:
8480 case elfcpp::R_ARM_ALU_SB_G0_NC:
8481 case elfcpp::R_ARM_ALU_SB_G0:
8482 case elfcpp::R_ARM_ALU_SB_G1_NC:
8483 case elfcpp::R_ARM_ALU_SB_G1:
8484 case elfcpp::R_ARM_ALU_SB_G2:
8485 case elfcpp::R_ARM_LDR_SB_G0:
8486 case elfcpp::R_ARM_LDR_SB_G1:
8487 case elfcpp::R_ARM_LDR_SB_G2:
8488 case elfcpp::R_ARM_LDRS_SB_G0:
8489 case elfcpp::R_ARM_LDRS_SB_G1:
8490 case elfcpp::R_ARM_LDRS_SB_G2:
8491 case elfcpp::R_ARM_LDC_SB_G0:
8492 case elfcpp::R_ARM_LDC_SB_G1:
8493 case elfcpp::R_ARM_LDC_SB_G2:
8494 case elfcpp::R_ARM_MOVW_BREL_NC:
8495 case elfcpp::R_ARM_MOVT_BREL:
8496 case elfcpp::R_ARM_MOVW_BREL:
8497 case elfcpp::R_ARM_THM_MOVW_BREL_NC:
8498 case elfcpp::R_ARM_THM_MOVT_BREL:
8499 case elfcpp::R_ARM_THM_MOVW_BREL:
8500 case elfcpp::R_ARM_THM_JUMP11:
8501 case elfcpp::R_ARM_THM_JUMP8:
8506 case elfcpp::R_ARM_GOTOFF32:
8507 case elfcpp::R_ARM_GOTOFF12:
8512 case elfcpp::R_ARM_GOT_BREL:
8513 case elfcpp::R_ARM_GOT_PREL:
8518 unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
8526 unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
8528 object, r_sym, elfcpp::R_ARM_RELATIVE, got,
8535 case elfcpp::R_ARM_TARGET1:
8536 case elfcpp::R_ARM_TARGET2:
8539 case elfcpp::R_ARM_COPY:
8540 case elfcpp::R_ARM_GLOB_DAT:
8541 case elfcpp::R_ARM_JUMP_SLOT:
8542 case elfcpp::R_ARM_RELATIVE:
8552 case elfcpp::R_ARM_TLS_GD32: // Global-dynamic
8553 case elfcpp::R_ARM_TLS_LDM32: // Local-dynamic
8554 case elfcpp::R_ARM_TLS_LDO32: // Alternate local-dynamic
8555 case elfcpp::R_ARM_TLS_IE32: // Initial-exec
8556 case elfcpp::R_ARM_TLS_LE32: // Local-exec
8564 case elfcpp::R_ARM_TLS_GD32: // Global-dynamic
8571 unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
8586 elfcpp::R_ARM_TLS_DTPMOD32);
8596 case elfcpp::R_ARM_TLS_LDM32: // Local-dynamic
8607 case elfcpp::R_ARM_TLS_LDO32: // Alternate local-dynamic
8610 case elfcpp::R_ARM_TLS_IE32: // Initial-exec
8618 elfcpp::elf_r_sym<32>(reloc.get_r_info());
8622 elfcpp::R_ARM_TLS_TPOFF32);
8630 elfcpp::R_ARM_TLS_TPOFF32, object,
8639 case elfcpp::R_ARM_TLS_LE32: // Local-exec
8644 gold_assert(lsym.get_st_type() != elfcpp::STT_SECTION);
8645 unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
8647 rel_dyn->add_local(object, r_sym, elfcpp::R_ARM_TLS_TPOFF32,
8659 case elfcpp::R_ARM_PC24:
8660 case elfcpp::R_ARM_LDR_SBREL_11_0_NC:
8661 case elfcpp::R_ARM_ALU_SBREL_19_12_NC:
8662 case elfcpp::R_ARM_ALU_SBREL_27_20_CK:
8689 case elfcpp::R_ARM_PC24:
8690 case elfcpp::R_ARM_THM_CALL:
8691 case elfcpp::R_ARM_PLT32:
8692 case elfcpp::R_ARM_CALL:
8693 case elfcpp::R_ARM_JUMP24:
8694 case elfcpp::R_ARM_THM_JUMP24:
8695 case elfcpp::R_ARM_SBREL31:
8696 case elfcpp::R_ARM_PREL31:
8697 case elfcpp::R_ARM_THM_JUMP19:
8698 case elfcpp::R_ARM_THM_JUMP6:
8699 case elfcpp::R_ARM_THM_JUMP11:
8700 case elfcpp::R_ARM_THM_JUMP8:
8719 const elfcpp::Rel<32, big_endian>&,
8721 const elfcpp::Sym<32, big_endian>&)
8736 const elfcpp::Rel<32, big_endian>&,
8758 const elfcpp::Rel<32, big_endian>& reloc,
8770 if (gsym->type() == elfcpp::STT_GNU_IFUNC
8777 case elfcpp::R_ARM_NONE:
8778 case elfcpp::R_ARM_V4BX:
8779 case elfcpp::R_ARM_GNU_VTENTRY:
8780 case elfcpp::R_ARM_GNU_VTINHERIT:
8783 case elfcpp::R_ARM_ABS32:
8784 case elfcpp::R_ARM_ABS16:
8785 case elfcpp::R_ARM_ABS12:
8786 case elfcpp::R_ARM_THM_ABS5:
8787 case elfcpp::R_ARM_ABS8:
8788 case elfcpp::R_ARM_BASE_ABS:
8789 case elfcpp::R_ARM_MOVW_ABS_NC:
8790 case elfcpp::R_ARM_MOVT_ABS:
8791 case elfcpp::R_ARM_THM_MOVW_ABS_NC:
8792 case elfcpp::R_ARM_THM_MOVT_ABS:
8793 case elfcpp::R_ARM_ABS32_NOI:
8816 else if ((r_type == elfcpp::R_ARM_ABS32
8817 || r_type == elfcpp::R_ARM_ABS32_NOI)
8818 && gsym->type() == elfcpp::STT_GNU_IFUNC
8829 unsigned int r_type = elfcpp::R_ARM_IRELATIVE;
8834 else if ((r_type == elfcpp::R_ARM_ABS32
8835 || r_type == elfcpp::R_ARM_ABS32_NOI)
8839 rel_dyn->add_global_relative(gsym, elfcpp::R_ARM_RELATIVE,
8854 case elfcpp::R_ARM_GOTOFF32:
8855 case elfcpp::R_ARM_GOTOFF12:
8860 case elfcpp::R_ARM_REL32:
8861 case elfcpp::R_ARM_LDR_PC_G0:
8862 case elfcpp::R_ARM_SBREL32:
8863 case elfcpp::R_ARM_THM_PC8:
8864 case elfcpp::R_ARM_BASE_PREL:
8865 case elfcpp::R_ARM_MOVW_PREL_NC:
8866 case elfcpp::R_ARM_MOVT_PREL:
8867 case elfcpp::R_ARM_THM_MOVW_PREL_NC:
8868 case elfcpp::R_ARM_THM_MOVT_PREL:
8869 case elfcpp::R_ARM_THM_ALU_PREL_11_0:
8870 case elfcpp::R_ARM_THM_PC12:
8871 case elfcpp::R_ARM_REL32_NOI:
8872 case elfcpp::R_ARM_ALU_PC_G0_NC:
8873 case elfcpp::R_ARM_ALU_PC_G0:
8874 case elfcpp::R_ARM_ALU_PC_G1_NC:
8875 case elfcpp::R_ARM_ALU_PC_G1:
8876 case elfcpp::R_ARM_ALU_PC_G2:
8877 case elfcpp::R_ARM_LDR_PC_G1:
8878 case elfcpp::R_ARM_LDR_PC_G2:
8879 case elfcpp::R_ARM_LDRS_PC_G0:
8880 case elfcpp::R_ARM_LDRS_PC_G1:
8881 case elfcpp::R_ARM_LDRS_PC_G2:
8882 case elfcpp::R_ARM_LDC_PC_G0:
8883 case elfcpp::R_ARM_LDC_PC_G1:
8884 case elfcpp::R_ARM_LDC_PC_G2:
8885 case elfcpp::R_ARM_ALU_SB_G0_NC:
8886 case elfcpp::R_ARM_ALU_SB_G0:
8887 case elfcpp::R_ARM_ALU_SB_G1_NC:
8888 case elfcpp::R_ARM_ALU_SB_G1:
8889 case elfcpp::R_ARM_ALU_SB_G2:
8890 case elfcpp::R_ARM_LDR_SB_G0:
8891 case elfcpp::R_ARM_LDR_SB_G1:
8892 case elfcpp::R_ARM_LDR_SB_G2:
8893 case elfcpp::R_ARM_LDRS_SB_G0:
8894 case elfcpp::R_ARM_LDRS_SB_G1:
8895 case elfcpp::R_ARM_LDRS_SB_G2:
8896 case elfcpp::R_ARM_LDC_SB_G0:
8897 case elfcpp::R_ARM_LDC_SB_G1:
8898 case elfcpp::R_ARM_LDC_SB_G2:
8899 case elfcpp::R_ARM_MOVW_BREL_NC:
8900 case elfcpp::R_ARM_MOVT_BREL:
8901 case elfcpp::R_ARM_MOVW_BREL:
8902 case elfcpp::R_ARM_THM_MOVW_BREL_NC:
8903 case elfcpp::R_ARM_THM_MOVT_BREL:
8904 case elfcpp::R_ARM_THM_MOVW_BREL:
8927 case elfcpp::R_ARM_THM_CALL:
8928 case elfcpp::R_ARM_PLT32:
8929 case elfcpp::R_ARM_CALL:
8930 case elfcpp::R_ARM_JUMP24:
8931 case elfcpp::R_ARM_THM_JUMP24:
8932 case elfcpp::R_ARM_SBREL31:
8933 case elfcpp::R_ARM_PREL31:
8934 case elfcpp::R_ARM_THM_JUMP19:
8935 case elfcpp::R_ARM_THM_JUMP6:
8936 case elfcpp::R_ARM_THM_JUMP11:
8937 case elfcpp::R_ARM_THM_JUMP8:
8961 case elfcpp::R_ARM_GOT_BREL:
8962 case elfcpp::R_ARM_GOT_ABS:
8963 case elfcpp::R_ARM_GOT_PREL:
8971 if (gsym->type() == elfcpp::STT_GNU_IFUNC)
8984 || (gsym->visibility() == elfcpp::STV_PROTECTED
8986 || (gsym->type() == elfcpp::STT_GNU_IFUNC
8989 rel_dyn, elfcpp::R_ARM_GLOB_DAT);
8996 if (gsym->type() != elfcpp::STT_GNU_IFUNC)
9009 gsym, elfcpp::R_ARM_RELATIVE, got,
9016 case elfcpp::R_ARM_TARGET1:
9017 case elfcpp::R_ARM_TARGET2:
9020 case elfcpp::R_ARM_COPY:
9021 case elfcpp::R_ARM_GLOB_DAT:
9022 case elfcpp::R_ARM_JUMP_SLOT:
9023 case elfcpp::R_ARM_RELATIVE:
9032 case elfcpp::R_ARM_TLS_GD32: // Global-dynamic
9033 case elfcpp::R_ARM_TLS_LDM32: // Local-dynamic
9034 case elfcpp::R_ARM_TLS_LDO32: // Alternate local-dynamic
9035 case elfcpp::R_ARM_TLS_IE32: // Initial-exec
9036 case elfcpp::R_ARM_TLS_LE32: // Local-exec
9043 case elfcpp::R_ARM_TLS_GD32: // Global-dynamic
9053 elfcpp::R_ARM_TLS_DTPMOD32,
9054 elfcpp::R_ARM_TLS_DTPOFF32);
9063 case elfcpp::R_ARM_TLS_LDM32: // Local-dynamic
9074 case elfcpp::R_ARM_TLS_LDO32: // Alternate local-dynamic
9077 case elfcpp::R_ARM_TLS_IE32: // Initial-exec
9087 elfcpp::R_ARM_TLS_TPOFF32);
9094 elfcpp::R_ARM_TLS_TPOFF32, gsym);
9102 case elfcpp::R_ARM_TLS_LE32: // Local-exec
9108 rel_dyn->add_global(gsym, elfcpp::R_ARM_TLS_TPOFF32,
9120 case elfcpp::R_ARM_PC24:
9121 case elfcpp::R_ARM_LDR_SBREL_11_0_NC:
9122 case elfcpp::R_ARM_ALU_SBREL_19_12_NC:
9123 case elfcpp::R_ARM_ALU_SBREL_27_20_CK:
9150 gold::gc_process_relocs<32, big_endian, Arm, elfcpp::SHT_REL, Scan,
9182 if (sh_type == elfcpp::SHT_RELA)
9189 gold::scan_relocs<32, big_endian, Target_arm, elfcpp::SHT_REL, Scan>(
9252 this->get_aeabi_object_attribute(elfcpp::Tag_CPU_arch);
9262 this->get_aeabi_object_attribute(elfcpp::Tag_CPU_arch_profile);
9264 (cpu_arch_attr->int_value() == elfcpp::TAG_CPU_ARCH_V7
9295 && exidx_section->type() == elfcpp::SHT_ARM_EXIDX)
9301 gold_assert(layout->find_output_segment(elfcpp::PT_ARM_EXIDX, 0,
9305 layout->make_output_segment(elfcpp::PT_ARM_EXIDX, elfcpp::PF_R);
9307 elfcpp::PF_R);
9319 elfcpp::SHT_ARM_ATTRIBUTES, 0,
9328 if ((*p)->type() == elfcpp::SHT_ARM_EXIDX)
9353 if ((output_section->flags() & elfcpp::SHF_ALLOC) == 0)
9387 const elfcpp::Rel<32, big_endian>& rel,
9437 case elfcpp::R_ARM_GOT_BREL:
9438 case elfcpp::R_ARM_GOT_PREL:
9447 unsigned int r_sym = elfcpp::elf_r_sym<32>(rel.get_r_info());
9492 (((gsym->type() == elfcpp::STT_ARM_TFUNC)
9493 || (gsym->type() == elfcpp::STT_FUNC
9504 elfcpp::Elf_types<32>::Elf_WXword r_info = rel.get_r_info();
9505 unsigned int r_sym = elfcpp::elf_r_sym<32>(r_info);
9537 unsigned int r_sym = elfcpp::elf_r_sym<32>(rel.get_r_info());
9544 if (r_type == elfcpp::R_ARM_BASE_ABS && gsym == NULL)
9592 case elfcpp::R_ARM_NONE:
9595 case elfcpp::R_ARM_ABS8:
9600 case elfcpp::R_ARM_ABS12:
9605 case elfcpp::R_ARM_ABS16:
9610 case elfcpp::R_ARM_ABS32:
9616 case elfcpp::R_ARM_ABS32_NOI:
9623 case elfcpp::R_ARM_MOVW_ABS_NC:
9630 case elfcpp::R_ARM_MOVT_ABS:
9635 case elfcpp::R_ARM_THM_MOVW_ABS_NC:
9641 case elfcpp::R_ARM_THM_MOVT_ABS:
9647 case elfcpp::R_ARM_MOVW_PREL_NC:
9648 case elfcpp::R_ARM_MOVW_BREL_NC:
9649 case elfcpp::R_ARM_MOVW_BREL:
9656 case elfcpp::R_ARM_MOVT_PREL:
9657 case elfcpp::R_ARM_MOVT_BREL:
9663 case elfcpp::R_ARM_THM_MOVW_PREL_NC:
9664 case elfcpp::R_ARM_THM_MOVW_BREL_NC:
9665 case elfcpp::R_ARM_THM_MOVW_BREL:
9672 case elfcpp::R_ARM_THM_MOVT_PREL:
9673 case elfcpp::R_ARM_THM_MOVT_BREL:
9679 case elfcpp::R_ARM_REL32:
9684 case elfcpp::R_ARM_THM_ABS5:
9690 case elfcpp::R_ARM_THM_CALL:
9691 case elfcpp::R_ARM_THM_XPC22:
9692 case elfcpp::R_ARM_THM_JUMP24:
9699 case elfcpp::R_ARM_GOTOFF32:
9708 case elfcpp::R_ARM_BASE_PREL:
9714 case elfcpp::R_ARM_BASE_ABS:
9719 case elfcpp::R_ARM_GOT_BREL:
9724 case elfcpp::R_ARM_GOT_PREL:
9736 case elfcpp::R_ARM_PLT32:
9737 case elfcpp::R_ARM_CALL:
9738 case elfcpp::R_ARM_JUMP24:
9739 case elfcpp::R_ARM_XPC25:
9752 case elfcpp::R_ARM_THM_JUMP19:
9758 case elfcpp::R_ARM_THM_JUMP6:
9763 case elfcpp::R_ARM_THM_JUMP8:
9768 case elfcpp::R_ARM_THM_JUMP11:
9773 case elfcpp::R_ARM_PREL31:
9778 case elfcpp::R_ARM_V4BX:
9789 case elfcpp::R_ARM_THM_PC8:
9794 case elfcpp::R_ARM_THM_PC12:
9799 case elfcpp::R_ARM_THM_ALU_PREL_11_0:
9805 case elfcpp::R_ARM_ALU_PC_G0_NC:
9806 case elfcpp::R_ARM_ALU_PC_G0:
9807 case elfcpp::R_ARM_ALU_PC_G1_NC:
9808 case elfcpp::R_ARM_ALU_PC_G1:
9809 case elfcpp::R_ARM_ALU_PC_G2:
9810 case elfcpp::R_ARM_ALU_SB_G0_NC:
9811 case elfcpp::R_ARM_ALU_SB_G0:
9812 case elfcpp::R_ARM_ALU_SB_G1_NC:
9813 case elfcpp::R_ARM_ALU_SB_G1:
9814 case elfcpp::R_ARM_ALU_SB_G2:
9822 case elfcpp::R_ARM_LDR_PC_G0:
9823 case elfcpp::R_ARM_LDR_PC_G1:
9824 case elfcpp::R_ARM_LDR_PC_G2:
9825 case elfcpp::R_ARM_LDR_SB_G0:
9826 case elfcpp::R_ARM_LDR_SB_G1:
9827 case elfcpp::R_ARM_LDR_SB_G2:
9834 case elfcpp::R_ARM_LDRS_PC_G0:
9835 case elfcpp::R_ARM_LDRS_PC_G1:
9836 case elfcpp::R_ARM_LDRS_PC_G2:
9837 case elfcpp::R_ARM_LDRS_SB_G0:
9838 case elfcpp::R_ARM_LDRS_SB_G1:
9839 case elfcpp::R_ARM_LDRS_SB_G2:
9846 case elfcpp::R_ARM_LDC_PC_G0:
9847 case elfcpp::R_ARM_LDC_PC_G1:
9848 case elfcpp::R_ARM_LDC_PC_G2:
9849 case elfcpp::R_ARM_LDC_SB_G0:
9850 case elfcpp::R_ARM_LDC_SB_G1:
9851 case elfcpp::R_ARM_LDC_SB_G2:
9860 case elfcpp::R_ARM_TLS_GD32: // Global-dynamic
9861 case elfcpp::R_ARM_TLS_LDM32: // Local-dynamic
9862 case elfcpp::R_ARM_TLS_LDO32: // Alternate local-dynamic
9863 case elfcpp::R_ARM_TLS_IE32: // Initial-exec
9864 case elfcpp::R_ARM_TLS_LE32: // Local-exec
9871 case elfcpp::R_ARM_PC24:
9872 case elfcpp::R_ARM_LDR_SBREL_11_0_NC:
9873 case elfcpp::R_ARM_ALU_SBREL_19_12_NC:
9874 case elfcpp::R_ARM_ALU_SBREL_27_20_CK:
9914 const elfcpp::Rel<32, big_endian>& rel,
9919 elfcpp::Elf_types<32>::Elf_Addr address,
9928 elfcpp::Elf_types<32>::Elf_Addr value = psymval->value(object, 0);
9937 case elfcpp::R_ARM_TLS_GD32: // Global-dynamic
9948 unsigned int r_sym = elfcpp::elf_r_sym<32>(rel.get_r_info());
9966 case elfcpp::R_ARM_TLS_LDM32: // Local-dynamic
9984 case elfcpp::R_ARM_TLS_LDO32: // Alternate local-dynamic
9988 case elfcpp::R_ARM_TLS_IE32: // Initial-exec
10002 unsigned int r_sym = elfcpp::elf_r_sym<32>(rel.get_r_info());
10019 case elfcpp::R_ARM_TLS_LE32: // Local-exec
10062 gold_assert(sh_type == elfcpp::SHT_REL);
10087 gold::relocate_section<32, big_endian, Target_arm, elfcpp::SHT_REL,
10143 gold_assert(sh_type == elfcpp::SHT_REL);
10145 typedef Arm_scan_relocatable_relocs<big_endian, elfcpp::SHT_REL,
10148 gold::scan_relocatable_relocs<32, big_endian, elfcpp::SHT_REL,
10173 typename elfcpp::Elf_types<32>::Elf_Off offset_in_output_section,
10181 gold_assert(sh_type == elfcpp::SHT_REL);
10183 gold::relocate_relocs<32, big_endian, elfcpp::SHT_REL>(
10208 typename elfcpp::Elf_types<32>::Elf_Off offset_in_output_section,
10210 elfcpp::Elf_types<32>::Elf_Addr view_address,
10215 gold_assert(sh_type == elfcpp::SHT_REL);
10217 typedef typename Reloc_types<elfcpp::SHT_REL, 32, big_endian>::Reloc Reltype;
10218 typedef typename Reloc_types<elfcpp::SHT_REL, 32, big_endian>::Reloc_write
10229 elfcpp::Elf_types<32>::Elf_WXword r_info = reloc.get_r_info();
10230 const unsigned int r_sym = elfcpp::elf_r_sym<32>(r_info);
10231 const unsigned int r_type = elfcpp::elf_r_type<32>(r_info);
10282 reloc_write.put_r_info(elfcpp::elf_r_info<32>(new_symndx, r_type));
10314 case elfcpp::R_ARM_ABS8:
10319 case elfcpp::R_ARM_ABS12:
10324 case elfcpp::R_ARM_ABS16:
10329 case elfcpp::R_ARM_THM_ABS5:
10335 case elfcpp::R_ARM_MOVW_ABS_NC:
10336 case elfcpp::R_ARM_MOVW_PREL_NC:
10337 case elfcpp::R_ARM_MOVW_BREL_NC:
10338 case elfcpp::R_ARM_MOVW_BREL:
10343 case elfcpp::R_ARM_THM_MOVW_ABS_NC:
10344 case elfcpp::R_ARM_THM_MOVW_PREL_NC:
10345 case elfcpp::R_ARM_THM_MOVW_BREL_NC:
10346 case elfcpp::R_ARM_THM_MOVW_BREL:
10351 case elfcpp::R_ARM_THM_CALL:
10352 case elfcpp::R_ARM_THM_XPC22:
10353 case elfcpp::R_ARM_THM_JUMP24:
10360 case elfcpp::R_ARM_PLT32:
10361 case elfcpp::R_ARM_CALL:
10362 case elfcpp::R_ARM_JUMP24:
10363 case elfcpp::R_ARM_XPC25:
10370 case elfcpp::R_ARM_THM_JUMP19:
10376 case elfcpp::R_ARM_THM_JUMP6:
10382 case elfcpp::R_ARM_THM_JUMP8:
10388 case elfcpp::R_ARM_THM_JUMP11:
10394 case elfcpp::R_ARM_PREL31:
10400 case elfcpp::R_ARM_THM_PC8:
10406 case elfcpp::R_ARM_THM_PC12:
10412 case elfcpp::R_ARM_THM_ALU_PREL_11_0:
10420 case elfcpp::R_ARM_MOVT_ABS:
10421 case elfcpp::R_ARM_THM_MOVT_ABS:
10422 case elfcpp::R_ARM_MOVT_PREL:
10423 case elfcpp::R_ARM_MOVT_BREL:
10424 case elfcpp::R_ARM_THM_MOVT_PREL:
10425 case elfcpp::R_ARM_THM_MOVT_BREL:
10426 case elfcpp::R_ARM_ALU_PC_G0_NC:
10427 case elfcpp::R_ARM_ALU_PC_G0:
10428 case elfcpp::R_ARM_ALU_PC_G1_NC:
10429 case elfcpp::R_ARM_ALU_PC_G1:
10430 case elfcpp::R_ARM_ALU_PC_G2:
10431 case elfcpp::R_ARM_ALU_SB_G0_NC:
10432 case elfcpp::R_ARM_ALU_SB_G0:
10433 case elfcpp::R_ARM_ALU_SB_G1_NC:
10434 case elfcpp::R_ARM_ALU_SB_G1:
10435 case elfcpp::R_ARM_ALU_SB_G2:
10436 case elfcpp::R_ARM_LDR_PC_G0:
10437 case elfcpp::R_ARM_LDR_PC_G1:
10438 case elfcpp::R_ARM_LDR_PC_G2:
10439 case elfcpp::R_ARM_LDR_SB_G0:
10440 case elfcpp::R_ARM_LDR_SB_G1:
10441 case elfcpp::R_ARM_LDR_SB_G2:
10442 case elfcpp::R_ARM_LDRS_PC_G0:
10443 case elfcpp::R_ARM_LDRS_PC_G1:
10444 case elfcpp::R_ARM_LDRS_PC_G2:
10445 case elfcpp::R_ARM_LDRS_SB_G0:
10446 case elfcpp::R_ARM_LDRS_SB_G1:
10447 case elfcpp::R_ARM_LDRS_SB_G2:
10448 case elfcpp::R_ARM_LDC_PC_G0:
10449 case elfcpp::R_ARM_LDC_PC_G1:
10450 case elfcpp::R_ARM_LDC_PC_G2:
10451 case elfcpp::R_ARM_LDC_SB_G0:
10452 case elfcpp::R_ARM_LDC_SB_G1:
10453 case elfcpp::R_ARM_LDC_SB_G2:
10503 case elfcpp::R_ARM_TARGET1:
10505 return elfcpp::R_ARM_ABS32;
10507 case elfcpp::R_ARM_TARGET2:
10509 return elfcpp::R_ARM_GOT_PREL;
10521 elfcpp::Elf_Word v1,
10522 elfcpp::Elf_Word v2)
10526 if ((v1 == elfcpp::EF_ARM_EABI_UNKNOWN || v2 == elfcpp::EF_ARM_EABI_UNKNOWN)
10527 || (v1 == elfcpp::EF_ARM_EABI_VER4 && v2 == elfcpp::EF_ARM_EABI_VER5)
10528 || (v1 == elfcpp::EF_ARM_EABI_VER5 && v2 == elfcpp::EF_ARM_EABI_VER4))
10543 elfcpp::Elf_Word flags)
10547 elfcpp::Elf_Word out_flags = this->processor_specific_flags();
10554 elfcpp::Elf_Word version1 = elfcpp::arm_eabi_version(flags);
10555 elfcpp::Elf_Word version2 = elfcpp::arm_eabi_version(out_flags);
10561 (flags & elfcpp::EF_ARM_EABIMASK) >> 24,
10562 (out_flags & elfcpp::EF_ARM_EABIMASK) >> 24);
10577 this->set_processor_specific_flags(flags & elfcpp::EF_ARM_EABIMASK);
10588 gold_assert(len == elfcpp::Elf_sizes<32>::ehdr_size);
10590 elfcpp::Ehdr<32, big_endian> ehdr(view);
10591 elfcpp::Elf_Word flags = this->processor_specific_flags();
10592 unsigned char e_ident[elfcpp::EI_NIDENT];
10593 memcpy(e_ident, ehdr.get_e_ident(), elfcpp::EI_NIDENT);
10595 if (elfcpp::arm_eabi_version(flags)
10596 == elfcpp::EF_ARM_EABI_UNKNOWN)
10597 e_ident[elfcpp::EI_OSABI] = elfcpp::ELFOSABI_ARM;
10599 e_ident[elfcpp::EI_OSABI] = 0;
10600 e_ident[elfcpp::EI_ABIVERSION] = 0;
10606 if (elfcpp::arm_eabi_version(flags) == elfcpp::EF_ARM_EABI_VER5)
10608 elfcpp::Elf_Half type = ehdr.get_e_type();
10609 if (type == elfcpp::ET_EXEC || type == elfcpp::ET_DYN)
10611 Object_attribute* attr = this->get_aeabi_object_attribute(elfcpp::Tag_ABI_VFP_args);
10612 if (attr->int_value() == elfcpp::AEABI_VFP_args_vfp)
10613 flags |= elfcpp::EF_ARM_ABI_FLOAT_HARD;
10615 flags |= elfcpp::EF_ARM_ABI_FLOAT_SOFT;
10619 elfcpp::Ehdr_write<32, big_endian> oehdr(view);
10634 off_t offset, const elfcpp::Ehdr<32, big_endian>& ehdr)
10639 if (et == elfcpp::ET_REL
10640 || (et == elfcpp::ET_EXEC && input_file->just_symbols()))
10647 else if (et == elfcpp::ET_DYN)
10677 known_attributes[elfcpp::Tag_also_compatible_with].string_value();
10679 && sv.data()[0] == elfcpp::Tag_CPU_arch
10702 known_attributes[elfcpp::Tag_also_compatible_with].set_string_value("");
10709 sv[0] = elfcpp::Tag_CPU_arch;
10714 known_attributes[elfcpp::Tag_also_compatible_with].set_string_value(sv);
10730 #define T(X) elfcpp::TAG_CPU_ARCH_##X
10870 if (oldtag > elfcpp::MAX_TAG_CPU_ARCH || newtag > elfcpp::MAX_TAG_CPU_ARCH)
10891 if (tagh <= elfcpp::TAG_CPU_ARCH_V6KZ)
10989 if (arch == elfcpp::TAG_CPU_ARCH_V7 && (profile == 'R' || profile == 'M'))
10991 else if (arch >= elfcpp::TAG_CPU_ARCH_V7E_M)
11042 if (out_attr[elfcpp::Tag_MPextension_use_legacy].int_value() != 0)
11044 if (out_attr[elfcpp::Tag_MPextension_use].int_value() != 0
11045 && out_attr[elfcpp::Tag_MPextension_use_legacy].int_value()
11046 != out_attr[elfcpp::Tag_MPextension_use].int_value())
11053 out_attr[elfcpp::Tag_MPextension_use] =
11054 out_attr[elfcpp::Tag_MPextension_use_legacy];
11055 out_attr[elfcpp::Tag_MPextension_use_legacy].set_type(0);
11056 out_attr[elfcpp::Tag_MPextension_use_legacy].set_int_value(0);
11067 if (in_attr[elfcpp::Tag_ABI_VFP_args].int_value()
11068 elfcpp::Tag_ABI_VFP_args].int_value())
11071 if (out_attr[elfcpp::Tag_ABI_FP_number_model].int_value()
11072 == elfcpp::AEABI_FP_number_model_none
11073 || (in_attr[elfcpp::Tag_ABI_FP_number_model].int_value()
11074 != elfcpp::AEABI_FP_number_model_none
11075 && out_attr[elfcpp::Tag_ABI_VFP_args].int_value()
11076 == elfcpp::AEABI_VFP_args_compatible))
11077 out_attr[elfcpp::Tag_ABI_VFP_args].set_int_value(
11078 in_attr[elfcpp::Tag_ABI_VFP_args].int_value());
11079 else if (in_attr[elfcpp::Tag_ABI_FP_number_model].int_value()
11080 != elfcpp::AEABI_FP_number_model_none
11081 && in_attr[elfcpp::Tag_ABI_VFP_args].int_value()
11082 != elfcpp::AEABI_VFP_args_compatible
11093 case elfcpp::Tag_CPU_raw_name:
11094 case elfcpp::Tag_CPU_name:
11098 case elfcpp::Tag_ABI_optimization_goals:
11099 case elfcpp::Tag_ABI_FP_optimization_goals:
11103 case elfcpp::Tag_CPU_arch:
11127 out_attr[elfcpp::Tag_CPU_name].set_string_value(
11128 in_attr[elfcpp::Tag_CPU_name].string_value());
11129 out_attr[elfcpp::Tag_CPU_raw_name].set_string_value(
11130 in_attr[elfcpp::Tag_CPU_raw_name].string_value());
11134 out_attr[elfcpp::Tag_CPU_name].set_string_value("");
11135 out_attr[elfcpp::Tag_CPU_raw_name].set_string_value("");
11140 if (out_attr[elfcpp::Tag_CPU_name].string_value() == "")
11147 out_attr[elfcpp::Tag_CPU_name].set_string_value(cpu_name);
11152 case elfcpp::Tag_ARM_ISA_use:
11153 case elfcpp::Tag_THUMB_ISA_use:
11154 case elfcpp::Tag_WMMX_arch:
11155 case elfcpp::Tag_Advanced_SIMD_arch:
11157 case elfcpp::Tag_ABI_FP_rounding:
11158 case elfcpp::Tag_ABI_FP_exceptions:
11159 case elfcpp::Tag_ABI_FP_user_exceptions:
11160 case elfcpp::Tag_ABI_FP_number_model:
11161 case elfcpp::Tag_VFP_HP_extension:
11162 case elfcpp::Tag_CPU_unaligned_access:
11163 case elfcpp::Tag_T2EE_use:
11164 case elfcpp::Tag_Virtualization_use:
11165 case elfcpp::Tag_MPextension_use:
11171 case elfcpp::Tag_ABI_align8_preserved:
11172 case elfcpp::Tag_ABI_PCS_RO_data:
11178 case elfcpp::Tag_ABI_align8_needed:
11180 && (in_attr[elfcpp::Tag_ABI_align8_preserved].int_value() == 0
11181 || (out_attr[elfcpp::Tag_ABI_align8_preserved].int_value()
11191 case elfcpp::Tag_ABI_FP_denormal:
11192 case elfcpp::Tag_ABI_PCS_GOT_use:
11210 case elfcpp::Tag_CPU_arch_profile:
11236 case elfcpp::Tag_VFP_arch:
11279 case elfcpp::Tag_PCS_config:
11291 case elfcpp::Tag_ABI_PCS_R9_use:
11293 && out_attr[i].int_value() != elfcpp::AEABI_R9_unused
11294 && in_attr[i].int_value() != elfcpp::AEABI_R9_unused
11299 if (out_attr[i].int_value() == elfcpp::AEABI_R9_unused)
11302 case elfcpp::Tag_ABI_PCS_RW_data:
11303 if (in_attr[i].int_value() == elfcpp::AEABI_PCS_RW_data_SBrel
11304 && (in_attr[elfcpp::Tag_ABI_PCS_R9_use].int_value()
11305 != elfcpp::AEABI_R9_SB)
11306 && (out_attr[elfcpp::Tag_ABI_PCS_R9_use].int_value()
11307 != elfcpp::AEABI_R9_unused)
11318 case elfcpp::Tag_ABI_PCS_wchar_t:
11334 case elfcpp::Tag_ABI_enum_size:
11335 if (in_attr[i].int_value() != elfcpp::AEABI_enum_unused)
11337 if (out_attr[i].int_value() == elfcpp::AEABI_enum_unused
11338 || out_attr[i].int_value() == elfcpp::AEABI_enum_forced_wide)
11344 else if (in_attr[i].int_value() != elfcpp::AEABI_enum_forced_wide
11360 case elfcpp::Tag_ABI_VFP_args:
11363 case elfcpp::Tag_ABI_WMMX_args:
11375 case elfcpp::Tag_ABI_HardFP_use:
11383 case elfcpp::Tag_ABI_FP_16bit_format:
11395 case elfcpp::Tag_DIV_use:
11405 get_aeabi_object_attribute(elfcpp::Tag_CPU_arch)->
11408 get_aeabi_object_attribute(elfcpp::Tag_CPU_arch_profile)->
11425 case elfcpp::Tag_MPextension_use_legacy:
11429 && in_attr[elfcpp::Tag_MPextension_use].int_value() != 0)
11431 if (in_attr[elfcpp::Tag_MPextension_use].int_value()
11441 > out_attr[elfcpp::Tag_MPextension_use].int_value())
11442 out_attr[elfcpp::Tag_MPextension_use] = in_attr[i];
11446 case elfcpp::Tag_nodefaults:
11452 case elfcpp::Tag_also_compatible_with:
11455 case elfcpp::Tag_conformance:
11654 elfcpp::Elf_types<32>::Elf_Swxword addend,
11679 ((gsym->type() == elfcpp::STT_ARM_TFUNC)
11680 || (gsym->type() == elfcpp::STT_FUNC
11713 case elfcpp::R_ARM_CALL:
11714 case elfcpp::R_ARM_JUMP24:
11715 case elfcpp::R_ARM_PLT32:
11719 case elfcpp::R_ARM_THM_CALL:
11720 case elfcpp::R_ARM_THM_XPC22:
11721 case elfcpp::R_ARM_THM_JUMP24:
11722 case elfcpp::R_ARM_THM_JUMP19:
11760 && (r_type == elfcpp::R_ARM_THM_JUMP24
11761 || r_type == elfcpp::R_ARM_THM_JUMP19
11762 || r_type == elfcpp::R_ARM_THM_CALL
11763 || r_type == elfcpp::R_ARM_THM_XPC22)
11803 elfcpp::Elf_types<32>::Elf_Addr view_address,
11821 typename elfcpp::Elf_types<32>::Elf_WXword r_info = reloc.get_r_info();
11822 unsigned int r_sym = elfcpp::elf_r_sym<32>(r_info);
11823 unsigned int r_type = elfcpp::elf_r_type<32>(r_info);
11828 if ((r_type != elfcpp::R_ARM_CALL)
11829 && (r_type != elfcpp::R_ARM_JUMP24)
11830 && (r_type != elfcpp::R_ARM_PLT32)
11831 && (r_type != elfcpp::R_ARM_THM_CALL)
11832 && (r_type != elfcpp::R_ARM_THM_XPC22)
11833 && (r_type != elfcpp::R_ARM_THM_JUMP24)
11834 && (r_type != elfcpp::R_ARM_THM_JUMP19)
11835 && (r_type != elfcpp::R_ARM_V4BX))
11851 if (r_type == elfcpp::R_ARM_V4BX)
11856 typedef typename elfcpp::Swap<32, big_endian>::Valtype Valtype;
11859 elfcpp::Elf_types<32>::Elf_Swxword insn =
11860 elfcpp::Swap<32, big_endian>::readval(wv);
11885 elfcpp::Elf_types<32>::Elf_Swxword addend =
11908 && shndx != elfcpp::SHN_UNDEF
11970 if (gsym->type() == elfcpp::STT_TLS)
11972 else if (gsym->type() == elfcpp::STT_GNU_IFUNC)
11998 typename elfcpp::Elf_types<32>::Elf_Addr value =
12042 if (sh_type == elfcpp::SHT_REL)
12043 this->scan_reloc_section_for_stubs<elfcpp::SHT_REL>(
12052 else if (sh_type == elfcpp::SHT_RELA)
12055 this->scan_reloc_section_for_stubs<elfcpp::SHT_RELA>(
12166 if ((*p)->type() == elfcpp::SHT_ARM_EXIDX)
12340 unsigned char reloc_buffer[elfcpp::Elf_sizes<32>::rel_size];
12342 elfcpp::Rel_write<32, big_endian> reloc_write(reloc_buffer);
12344 reloc_write.put_r_info(elfcpp::elf_r_info<32>(0, r_type));
12345 elfcpp::Rel<32, big_endian> rel(reloc_buffer);
12364 else if (tag == elfcpp::Tag_nodefaults)
12367 else if (tag == elfcpp::Tag_CPU_raw_name || tag == elfcpp::Tag_CPU_name)
12392 return elfcpp::Tag_conformance;
12394 return elfcpp::Tag_nodefaults;
12395 if ((num - 2) < elfcpp::Tag_nodefaults)
12397 if ((num - 1) < elfcpp::Tag_conformance)
12426 typedef typename elfcpp::Swap<16, big_endian>::Valtype Valtype;
12428 uint32_t insn = elfcpp::Swap<16, big_endian>::readval(wv);
12436 insn = (insn << 16) | elfcpp::Swap<16, big_endian>::readval(wv + 1);
12471 if (cortex_a8_reloc->r_type() == elfcpp::R_ARM_THM_CALL
12474 else if (cortex_a8_reloc->r_type() == elfcpp::R_ARM_THM_CALL
12582 typedef typename elfcpp::Swap<16, big_endian>::Valtype Valtype;
12584 Valtype upper_insn = elfcpp::Swap<16, big_endian>::readval(wv);
12585 Valtype lower_insn = elfcpp::Swap<16, big_endian>::readval(wv + 1);
12618 elfcpp::Swap<16, big_endian>::writeval(wv, upper_insn);
12619 elfcpp::Swap<16, big_endian>::writeval(wv + 1, lower_insn);
12630 : Target_selector(elfcpp::EM_ARM, 32, big_endian,
12680 if (os != NULL && (os->flags() & elfcpp::SHF_ALLOC) != 0)
12722 elfcpp::STT_NOTYPE,
12723 elfcpp::STB_GLOBAL,
12724 elfcpp::STV_HIDDEN,
12735 elfcpp::STT_NOTYPE,
12736 elfcpp::STB_GLOBAL,
12737 elfcpp::STV_HIDDEN,
12748 0, 0, elfcpp::STT_OBJECT,
12749 elfcpp::STB_GLOBAL, elfcpp::STV_HIDDEN, 0,
12753 0, 0, elfcpp::STT_OBJECT,
12754 elfcpp::STB_GLOBAL, elfcpp::STV_HIDDEN, 0,
12791 elfcpp::EM_ARM, // machine_code
12804 elfcpp::SHN_UNDEF, // small_common_shndx
12805 elfcpp::SHN_UNDEF, // large_common_shndx
12906 elfcpp::Swap<32, big_endian>::writeval
12908 elfcpp::Swap<32, big_endian>::writeval
12912 elfcpp::Swap<32, big_endian>::writeval(pov + i * 4, first_plt_entry[i]);
12952 elfcpp::Swap<32, big_endian>::writeval
12954 elfcpp::Swap<32, big_endian>::writeval
12956 elfcpp::Swap<32, big_endian>::writeval
12958 elfcpp::Swap<32, big_endian>::writeval