Home | History | Annotate | Download | only in gold

Lines Matching refs:elfcpp

207 	if ((*p)->type() == elfcpp::PT_LOAD)
216 if (((*p)->flags() & elfcpp::SHF_ALLOC) != 0)
224 shdr_size = elfcpp::Elf_sizes<32>::shdr_size;
226 shdr_size = elfcpp::Elf_sizes<64>::shdr_size;
272 const int shdr_size = elfcpp::Elf_sizes<size>::shdr_size;
276 typename elfcpp::Shdr_write<size, big_endian> oshdr(v);
278 oshdr.put_sh_type(elfcpp::SHT_NULL);
284 / elfcpp::Elf_sizes<size>::shdr_size);
285 if (section_count < elfcpp::SHN_LORESERVE)
291 if (shstrndx < elfcpp::SHN_LORESERVE)
297 oshdr.put_sh_info(segment_count >= elfcpp::PN_XNUM ? segment_count : 0);
326 if (((*p)->flags() & elfcpp::SHF_ALLOC) == 0
327 && (*p)->type() != elfcpp::SHT_GROUP)
330 elfcpp::Shdr_write<size, big_endian> oshdr(v);
344 if ((*p)->type() == elfcpp::SHT_GROUP
348 elfcpp::Shdr_write<size, big_endian> oshdr(v);
400 const int phdr_size = elfcpp::Elf_sizes<size>::phdr_size;
410 elfcpp::Phdr_write<size, big_endian> ophdr(v);
426 phdr_size = elfcpp::Elf_sizes<32>::phdr_size;
428 phdr_size = elfcpp::Elf_sizes<64>::phdr_size;
501 int ehdr_size = elfcpp::Elf_sizes<size>::ehdr_size;
503 elfcpp::Ehdr_write<size, big_endian> oehdr(view);
505 unsigned char e_ident[elfcpp::EI_NIDENT];
506 memset(e_ident, 0, elfcpp::EI_NIDENT);
507 e_ident[elfcpp::EI_MAG0] = elfcpp::ELFMAG0;
508 e_ident[elfcpp::EI_MAG1] = elfcpp::ELFMAG1;
509 e_ident[elfcpp::EI_MAG2] = elfcpp::ELFMAG2;
510 e_ident[elfcpp::EI_MAG3] = elfcpp::ELFMAG3;
512 e_ident[elfcpp::EI_CLASS] = elfcpp::ELFCLASS32;
514 e_ident[elfcpp::EI_CLASS] = elfcpp::ELFCLASS64;
517 e_ident[elfcpp::EI_DATA] = (big_endian
518 ? elfcpp::ELFDATA2MSB
519 : elfcpp::ELFDATA2LSB);
520 e_ident[elfcpp::EI_VERSION] = elfcpp::EV_CURRENT;
523 elfcpp::ET e_type;
525 e_type = elfcpp::ET_REL;
527 e_type = elfcpp::ET_DYN;
529 e_type = elfcpp::ET_EXEC;
533 oehdr.put_e_version(elfcpp::EV_CURRENT);
544 oehdr.put_e_ehsize(elfcpp::Elf_sizes<size>::ehdr_size);
553 oehdr.put_e_phentsize(elfcpp::Elf_sizes<size>::phdr_size);
555 / elfcpp::Elf_sizes<size>::phdr_size);
556 if (phnum > elfcpp::PN_XNUM)
557 phnum = elfcpp::PN_XNUM;
561 oehdr.put_e_shentsize(elfcpp::Elf_sizes<size>::shdr_size);
563 / elfcpp::Elf_sizes<size>::shdr_size);
565 if (section_count < elfcpp::SHN_LORESERVE)
567 / elfcpp::Elf_sizes<size>::shdr_size);
572 if (shstrndx < elfcpp::SHN_LORESERVE)
575 oehdr.put_e_shstrndx(elfcpp::SHN_XINDEX);
587 typename elfcpp::Elf_types<size>::Elf_Addr
629 return elfcpp::Elf_sizes<32>::ehdr_size;
631 return elfcpp::Elf_sizes<64>::ehdr_size;
709 Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::Output_reloc(
730 Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::Output_reloc(
755 Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::Output_reloc(
781 Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::Output_reloc(
810 Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::Output_reloc(
831 Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::Output_reloc(
856 Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::Output_reloc(
872 Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::Output_reloc(
892 Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::Output_reloc(
908 Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::Output_reloc(
929 Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::
973 Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::get_symbol_index()
1043 typename elfcpp::Elf_types<size>::Elf_Addr
1044 Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::
1071 typename elfcpp::Elf_types<size>::Elf_Addr
1072 Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::get_address() const
1102 Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::write_rel(
1107 wr->put_r_info(elfcpp::elf_r_info<size>(sym_index, this->type_));
1114 Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::write(
1117 elfcpp::Rel_write<size, big_endian> orel(pov);
1124 typename elfcpp::Elf_types<size>::Elf_Addr
1125 Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::symbol_value(
1164 Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::
1165 compare(const Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>& r2)
1211 Output_reloc<elfcpp::SHT_RELA, dynamic, size, big_endian>::write(
1214 elfcpp::Rela_write<size, big_endian> orel(pov);
1236 if (sh_type == elfcpp::SHT_REL)
1237 os->set_entsize(elfcpp::Elf_sizes<size>::rel_size);
1238 else if (sh_type == elfcpp::SHT_RELA)
1239 os->set_entsize(elfcpp::Elf_sizes<size>::rela_size);
1306 elfcpp::Elf_Word flags,
1327 elfcpp::Elf_Word* contents = reinterpret_cast<elfcpp::Elf_Word*>(oview);
1328 elfcpp::Swap<32, big_endian>::writeval(contents, this->flags_);
1348 elfcpp::Swap<32, big_endian>::writeval(contents, output_shndx);
1413 && gsym->type() == elfcpp::STT_TLS)
1450 elfcpp::Swap<got_size, big_endian>::writeval(pov, val);
1774 typename elfcpp::Elf_types<size>::Elf_WXword val;
1808 elfcpp::Dyn_write<size, big_endian> dw(pov);
1821 os->set_entsize(elfcpp::Elf_sizes<32>::dyn_size);
1823 os->set_entsize(elfcpp::Elf_sizes<64>::dyn_size);
1835 if (this->entries_.empty() || this->entries_.back().tag() != elfcpp::DT_NULL)
1839 this->add_constant(elfcpp::DT_NULL, 0);
1840 this->add_constant(elfcpp::DT_NULL, 0);
1845 dyn_size = elfcpp::Elf_sizes<32>::dyn_size;
1847 dyn_size = elfcpp::Elf_sizes<64>::dyn_size;
1889 const int dyn_size = elfcpp::Elf_sizes<size>::dyn_size;
1944 elfcpp::Swap<32, big_endian>::writeval(oview + symndx * 4, p->second);
1982 elfcpp::Swap_unaligned<32, true>::writeval(pov, len - 4);
1983 elfcpp::Swap_unaligned<16, true>::writeval(pov + 4, this->version);
1984 elfcpp::Swap_unaligned<32, true>::writeval(pov + 6, 0);
1988 elfcpp::Swap_unaligned<32, false>::writeval(pov, len - 4);
1989 elfcpp::Swap_unaligned<16, false>::writeval(pov + 4, this->version);
1990 elfcpp::Swap_unaligned<32, false>::writeval(pov + 6, 0);
2042 elfcpp::Swap_unaligned<32, true>::writeval(pov, len - 4);
2043 elfcpp::Swap_unaligned<16, true>::writeval(pov + 4, this->version);
2044 elfcpp::Swap_unaligned<32, true>::writeval(pov + 6, len - (4 + 2 + 4));
2048 elfcpp::Swap_unaligned<32, false>::writeval(pov, len - 4);
2049 elfcpp::Swap_unaligned<16, false>::writeval(pov + 4, this->version);
2050 elfcpp::Swap_unaligned<32, false>::writeval(pov + 6, len - (4 + 2 + 4));
2079 memset(pov, elfcpp::DW_LNS_set_basic_block, oview + len - pov);
2268 Output_section::Output_section(const char* name, elfcpp::Elf_Word type,
2269 elfcpp::Elf_Xword flags)
2325 if ((flags & elfcpp::SHF_ALLOC) == 0)
2368 const elfcpp::Shdr<size, big_endian>& shdr,
2372 elfcpp::Elf_Xword addralign = shdr.get_sh_addralign();
2383 typename elfcpp::Elf_types<size>::Elf_WXword sh_flags = shdr.get_sh_flags();
2390 sh_flags |= (elfcpp::SHF_MERGE | elfcpp::SHF_STRINGS);
2402 if ((sh_flags & elfcpp::SHF_MERGE) != 0
2453 && (sh_flags & elfcpp::SHF_EXECINSTR) != 0
2465 && (sh_flags & elfcpp::SHF_EXECINSTR) != 0
2639 bool is_string = (flags & elfcpp::SHF_STRINGS) != 0;
2822 Output_section::update_flags_for_input_section(elfcpp::Elf_Xword flags)
2827 if ((this->flags_ & elfcpp::SHF_ALLOC) == 0
2828 && (flags & elfcpp::SHF_ALLOC) != 0)
2832 & (elfcpp::SHF_WRITE
2833 | elfcpp::SHF_ALLOC
2834 | elfcpp::SHF_EXECINSTR));
2836 if ((flags & elfcpp::SHF_MERGE) == 0)
2837 this->flags_ &=~ elfcpp::SHF_MERGE;
2841 this->flags_ |= elfcpp::SHF_MERGE;
2844 if ((flags & elfcpp::SHF_STRINGS) == 0)
2845 this->flags_ &=~ elfcpp::SHF_STRINGS;
2849 this->flags_ |= elfcpp::SHF_STRINGS;
3157 if (((this->flags_ & elfcpp::SHF_ALLOC) == 0) && !this->is_noload_)
3183 if ((this->flags_ & elfcpp::SHF_ALLOC) == 0)
3579 if (this->type() == elfcpp::SHT_PREINIT_ARRAY
3580 || this->type() == elfcpp::SHT_INIT_ARRAY
3581 || this->type() == elfcpp::SHT_FINI_ARRAY)
3620 elfcpp::Shdr_write<size, big_endian>* oshdr) const
3625 elfcpp::Elf_Xword flags = this->flags_;
3627 flags |= elfcpp::SHF_INFO_LINK;
3642 elfcpp::Elf_Word info;
4024 if ((this->flags_ & elfcpp::SHF_ALLOC) != 0)
4052 Output_segment::Output_segment(elfcpp::Elf_Word type, elfcpp::Elf_Word flags)
4069 if (type == elfcpp::PT_TLS)
4070 this->flags_ = elfcpp::PF_R;
4078 elfcpp::Elf_Word seg_flags)
4080 gold_assert(this->type() == elfcpp::PT_LOAD);
4081 gold_assert((os->flags() & elfcpp::SHF_ALLOC) != 0);
4102 elfcpp::Elf_Word seg_flags)
4104 gold_assert(this->type() != elfcpp::PT_LOAD);
4105 gold_assert((os->flags() & elfcpp::SHF_ALLOC) != 0);
4160 if ((*p)->output_section()->type() != elfcpp::SHT_NOBITS)
4268 gold_assert(this->type_ == elfcpp::PT_LOAD);
4295 if ((*p)->is_section_flag_set(elfcpp::SHF_TLS))
4306 if ((*p)->is_section_flag_set(elfcpp::SHF_TLS)
4307 && (*p)->is_section_type(elfcpp::SHT_NOBITS))
4407 if (target->isolate_execinstr() && (this->flags() & elfcpp::PF_X) != 0)
4469 if ((*p)->is_section_flag_set(elfcpp::SHF_TLS))
4580 if (!(*p)->is_section_flag_set(elfcpp::SHF_TLS)
4581 || !(*p)->is_section_type(elfcpp::SHT_NOBITS))
4604 gold_assert(this->type_ != elfcpp::PT_LOAD);
4640 && (*p)->output_section()->type() == elfcpp::SHT_NOBITS)
4675 if (this->type_ == elfcpp::PT_GNU_RELRO)
4693 if (this->type_ == elfcpp::PT_TLS)
4706 gold_assert(this->type_ == elfcpp::PT_TLS);
4804 Output_segment::write_header(elfcpp::Phdr_write<size, big_endian>* ophdr)
4828 if (this->type_ != elfcpp::PT_LOAD)
4851 const int shdr_size = elfcpp::Elf_sizes<size>::shdr_size;
4860 elfcpp::Shdr_write<size, big_endian> oshdr(v);
4874 if (this->type() != elfcpp::PT_LOAD)
5251 const elfcpp::Shdr<32, false>& shdr,
5264 const elfcpp::Shdr<32, true>& shdr,
5277 const elfcpp::Shdr<64, false>& shdr,
5290 const elfcpp::Shdr<64, true>& shdr,
5297 class Output_reloc<elfcpp::SHT_REL, false, 32, false>;
5302 class Output_reloc<elfcpp::SHT_REL, false, 32, true>;
5307 class Output_reloc<elfcpp::SHT_REL, false, 64, false>;
5312 class Output_reloc<elfcpp::SHT_REL, false, 64, true>;
5317 class Output_reloc<elfcpp::SHT_REL, true, 32, false>;
5322 class Output_reloc<elfcpp::SHT_REL, true, 32, true>;
5327 class Output_reloc<elfcpp::SHT_REL, true, 64, false>;
5332 class Output_reloc<elfcpp::SHT_REL, true, 64, true>;
5337 class Output_reloc<elfcpp::SHT_RELA, false, 32, false>;
5342 class Output_reloc<elfcpp::SHT_RELA, false, 32, true>;
5347 class Output_reloc<elfcpp::SHT_RELA, false, 64, false>;
5352 class Output_reloc<elfcpp::SHT_RELA, false, 64, true>;
5357 class Output_reloc<elfcpp::SHT_RELA, true, 32, false>;
5362 class Output_reloc<elfcpp::SHT_RELA, true, 32, true>;
5367 class Output_reloc<elfcpp::SHT_RELA, true, 64, false>;
5372 class Output_reloc<elfcpp::SHT_RELA, true, 64, true>;
5377 class Output_data_reloc<elfcpp::SHT_REL, false, 32, false>;
5382 class Output_data_reloc<elfcpp::SHT_REL, false, 32, true>;
5387 class Output_data_reloc<elfcpp::SHT_REL, false, 64, false>;
5392 class Output_data_reloc<elfcpp::SHT_REL, false, 64, true>;
5397 class Output_data_reloc<elfcpp::SHT_REL, true, 32, false>;
5402 class Output_data_reloc<elfcpp::SHT_REL, true, 32, true>;
5407 class Output_data_reloc<elfcpp::SHT_REL, true, 64, false>;
5412 class Output_data_reloc<elfcpp::SHT_REL, true, 64, true>;
5417 class Output_data_reloc<elfcpp::SHT_RELA, false, 32, false>;
5422 class Output_data_reloc<elfcpp::SHT_RELA, false, 32, true>;
5427 class Output_data_reloc<elfcpp::SHT_RELA, false, 64, false>;
5432 class Output_data_reloc<elfcpp::SHT_RELA, false, 64, true>;
5437 class Output_data_reloc<elfcpp::SHT_RELA, true, 32, false>;
5442 class Output_data_reloc<elfcpp::SHT_RELA, true, 32, true>;
5447 class Output_data_reloc<elfcpp::SHT_RELA, true, 64, false>;
5452 class Output_data_reloc<elfcpp::SHT_RELA, true, 64, true>;
5457 class Output_relocatable_relocs<elfcpp::SHT_REL, 32, false>;
5462 class Output_relocatable_relocs<elfcpp::SHT_REL, 32, true>;
5467 class Output_relocatable_relocs<elfcpp::SHT_REL, 64, false>;
5472 class Output_relocatable_relocs<elfcpp::SHT_REL, 64, true>;
5477 class Output_relocatable_relocs<elfcpp::SHT_RELA, 32, false>;
5482 class Output_relocatable_relocs<elfcpp::SHT_RELA, 32, true>;
5487 class Output_relocatable_relocs<elfcpp::SHT_RELA, 64, false>;
5492 class Output_relocatable_relocs<elfcpp::SHT_RELA, 64, true>;