Lines Matching full:elfcpp
29 #include "elfcpp.h"
108 typedef elfcpp::Swap<size, big_endian> Swap;
109 typedef elfcpp::Swap<16, big_endian> Swap16;
110 typedef elfcpp::Swap<32, big_endian> Swap32;
111 typedef elfcpp::Swap<64, big_endian> Swap64;
182 return (sh_type == elfcpp::SHT_PROGBITS
183 || sh_type == elfcpp::SHT_NOBITS
184 || sh_type == elfcpp::SHT_INIT_ARRAY
185 || sh_type == elfcpp::SHT_FINI_ARRAY
186 || sh_type == elfcpp::SHT_PREINIT_ARRAY
187 || sh_type == elfcpp::SHT_NOTE);
202 this->elf_file_.find_section_by_type(elfcpp::SHT_GNU_INCREMENTAL_INPUTS);
203 if (inputs_shndx == elfcpp::SHN_UNDEF) // Not found.
207 this->elf_file_.find_section_by_type(elfcpp::SHT_GNU_INCREMENTAL_SYMTAB);
208 if (symtab_shndx == elfcpp::SHN_UNDEF) // Not found.
214 this->elf_file_.find_section_by_type(elfcpp::SHT_GNU_INCREMENTAL_RELOCS);
215 if (relocs_shndx == elfcpp::SHN_UNDEF) // Not found.
221 this->elf_file_.find_section_by_type(elfcpp::SHT_GNU_INCREMENTAL_GOT_PLT);
222 if (got_plt_shndx == elfcpp::SHN_UNDEF) // Not found.
228 if (strtab_shndx == elfcpp::SHN_UNDEF
230 || this->elf_file_.section_type(strtab_shndx) != elfcpp::SHT_STRTAB)
275 elfcpp::Elf_strtab strtab(strtab_view.data(), strtab_location.data_size);
290 this->elf_file_.find_section_by_type(elfcpp::SHT_SYMTAB);
291 gold_assert(main_symtab_shndx != elfcpp::SHN_UNDEF);
297 gold_assert(main_strtab_shndx != elfcpp::SHN_UNDEF
524 typedef elfcpp::Shdr<size, big_endian> Shdr;
525 const int shdr_size = elfcpp::Elf_sizes<size>::shdr_size;
535 elfcpp::Elf_strtab shstrtab(shstrndx_view.data(),
568 const int sym_size = elfcpp::Elf_sizes<size>::sym_size;
579 elfcpp::Elf_strtab strtab(NULL, 0);
591 elfcpp::Sym<size, big_endian> gsym(sym_p);
638 this->main_symtab_loc_.data_size / elfcpp::Elf_sizes<size>::sym_size;
737 typedef typename elfcpp::Elf_types<size>::Elf_Addr Address;
738 typedef typename elfcpp::Elf_types<size>::Elf_Swxword Addend;
831 elfcpp::Elf_strtab* strtab)
834 *nsyms = this->main_symtab_loc_.data_size / elfcpp::Elf_sizes<size>::sym_size;
837 *strtab = elfcpp::Elf_strtab(strtab_view.data(),
850 const elfcpp::Ehdr<size, big_endian>& ehdr)
854 ehdr.get_e_ident()[elfcpp::EI_OSABI],
855 ehdr.get_e_ident()[elfcpp::EI_ABIVERSION]);
881 int want = elfcpp::Elf_recognizer::max_header_size;
886 if (!elfcpp::Elf_recognizer::is_elf_file(p, want))
895 if (!elfcpp::Elf_recognizer::is_valid_header(p, want, &size, &big_endian,
909 file, elfcpp::Ehdr<32, true>(p));
918 file, elfcpp::Ehdr<32, false>(p));
930 file, elfcpp::Ehdr<64, true>(p));
939 file, elfcpp::Ehdr<64, false>(p));
1719 if (sym->visibility() == elfcpp::STV_HIDDEN
1720 || sym->visibility() == elfcpp::STV_INTERNAL)
1854 elfcpp::Swap<32, big_endian>::writeval(pov, this->info_.sym_index);
1855 elfcpp::Swap<32, big_endian>::writeval(pov + 4, this->info_.input_index);
1886 elfcpp::Swap<32, big_endian>::writeval(pov, this->info_.sym_index);
1887 elfcpp::Swap<32, big_endian>::writeval(pov + 4, 0);
1926 elfcpp::Swap<32, big_endian>::writeval(pov, sym->symtab_index());
2124 const int sym_size = elfcpp::Elf_sizes<size>::sym_size;
2126 elfcpp::Sym<size, big_endian> sym(symbuf);
2127 elfcpp::Sym_write<size, big_endian> osym(symbuf);
2129 typedef typename elfcpp::Elf_types<size>::Elf_WXword Elf_size_type;
2136 elfcpp::Elf_strtab strtab(NULL, 0);
2150 elfcpp::Sym<size, big_endian> gsym(sym_p);
2155 typename elfcpp::Elf_types<size>::Elf_Addr v = gsym.get_st_value();
2157 elfcpp::STB st_bind = gsym.get_st_bind();
2158 elfcpp::STT st_type = gsym.get_st_type();
2162 if (st_bind == elfcpp::STB_LOCAL)
2163 st_bind = elfcpp::STB_GLOBAL;
2168 shndx = elfcpp::SHN_UNDEF;
2171 else if (shndx != elfcpp::SHN_ABS)
2174 gold_assert(shndx != elfcpp::SHN_UNDEF);
2180 if (st_type != elfcpp::STT_TLS)
2195 if (shndx != elfcpp::SHN_UNDEF)
2205 if (shndx == elfcpp::SHN_ABS)
2468 const int sym_size = elfcpp::Elf_sizes<size>::sym_size;
2478 elfcpp::Elf_strtab strtab(NULL, 0);
2486 elfcpp::Sym<size, big_endian> sym(symp);
2570 unsigned int shndx = elfcpp::Swap<32, big_endian>::readval(pov + 4);
2574 elfcpp::Swap<32, big_endian>::writeval(pov + 4, shndx);
2612 if (st_shndx >= elfcpp::SHN_LORESERVE)
2617 st_shndx = elfcpp::SHN_XINDEX;
2623 elfcpp::Sym_write<size, big_endian> osym(ov);
2627 osym.put_st_info(elfcpp::STB_LOCAL,
2628 static_cast<elfcpp::STT>(lsym.st_type));
2638 elfcpp::Sym_write<size, big_endian> osym(dyn_ov);
2642 osym.put_st_info(elfcpp::STB_LOCAL,
2643 static_cast<elfcpp::STT>(lsym.st_type));
2725 const int sym_size = elfcpp::Elf_sizes<size>::sym_size;
2727 elfcpp::Sym<size, big_endian> sym(symbuf);
2728 elfcpp::Sym_write<size, big_endian> osym(symbuf);
2735 elfcpp::Elf_strtab strtab(NULL, 0);
2756 elfcpp::Sym<size, big_endian> gsym(sym_p);
2763 elfcpp::STB st_bind = gsym.get_st_bind();
2764 elfcpp::STT st_type = gsym.get_st_type();
2768 if (st_bind == elfcpp::STB_LOCAL)
2769 st_bind = elfcpp::STB_GLOBAL;
2773 shndx = elfcpp::SHN_UNDEF;