Home | History | Annotate | Download | only in gold

Lines Matching full:elfcpp

39 #include "elfcpp.h"
95 Section_bounds sections[elfcpp::DW_SECT_MAX + 1];
208 elfcpp::DW_SECT section_id);
251 typedef typename elfcpp::Elf_types<size>::Elf_Addr Address;
255 const elfcpp::Ehdr<size, big_endian>& ehdr)
440 elfcpp::Elf_file<size, big_endian, Object> elf_file_;
457 this->section_id_map_.resize(elfcpp::DW_SECT_MAX + 1);
472 add_contribution(elfcpp::DW_SECT section_id, const unsigned char* contents,
750 get_dwarf_section_name(elfcpp::DW_SECT section_id)
764 gold_assert(section_id > 0 && section_id <= elfcpp::DW_SECT_MAX);
776 const int shdr_size = elfcpp::Elf_sizes<size>::shdr_size;
790 typename elfcpp::Shdr<size, big_endian> shdrnames(pshdrnames);
791 if (shdrnames.get_sh_type() != elfcpp::SHT_STRTAB)
856 if (this->section_type(i) != elfcpp::SHT_PROGBITS)
896 unsigned int debug_shndx[elfcpp::DW_SECT_MAX + 1];
897 for (unsigned int i = 0; i <= elfcpp::DW_SECT_MAX; i++)
907 if (this->section_type(i) != elfcpp::SHT_PROGBITS)
921 debug_shndx[elfcpp::DW_SECT_INFO] = i;
925 debug_shndx[elfcpp::DW_SECT_ABBREV] = i;
927 debug_shndx[elfcpp::DW_SECT_LINE] = i;
929 debug_shndx[elfcpp::DW_SECT_LOC] = i;
933 debug_shndx[elfcpp::DW_SECT_STR_OFFSETS] = i;
935 debug_shndx[elfcpp::DW_SECT_MACINFO] = i;
937 debug_shndx[elfcpp::DW_SECT_MACRO] = i;
959 debug_shndx[elfcpp::DW_SECT_TYPES] = debug_types[0];
961 debug_shndx[elfcpp::DW_SECT_TYPES] = 0;
968 if (debug_shndx[elfcpp::DW_SECT_INFO] > 0)
971 debug_shndx[elfcpp::DW_SECT_INFO] = 0;
976 debug_shndx[elfcpp::DW_SECT_TYPES] = *tp;
1000 if (this->section_type(i) != elfcpp::SHT_PROGBITS)
1039 int hdrsize = elfcpp::Elf_recognizer::max_header_size;
1044 if (!elfcpp::Elf_recognizer::is_elf_file(elf_header, hdrsize))
1053 if (!elfcpp::Elf_recognizer::is_valid_header(elf_header, hdrsize, &size,
1103 elfcpp::Ehdr<size, big_endian> ehdr(p);
1110 ehdr.get_e_ident()[elfcpp::EI_OSABI],
1111 ehdr.get_e_ident()[elfcpp::EI_ABIVERSION]);
1137 elfcpp::DW_SECT info_sect = (is_tu_index
1138 ? elfcpp::DW_SECT_TYPES
1139 : elfcpp::DW_SECT_INFO);
1150 elfcpp::Swap_unaligned<32, big_endian>::readval(contents);
1160 elfcpp::Swap_unaligned<32, big_endian>::readval(contents
1163 elfcpp::Swap_unaligned<32, big_endian>::readval(contents
1171 elfcpp::Swap_unaligned<32, big_endian>::readval(contents
1186 Section_bounds sections[elfcpp::DW_SECT_MAX + 1];
1187 for (int i = elfcpp::DW_SECT_ABBREV; i <= elfcpp::DW_SECT_MAX; ++i)
1191 static_cast<elfcpp::DW_SECT>(i));
1204 elfcpp::Swap_unaligned<64, big_endian>::readval(phash);
1206 elfcpp::Swap_unaligned<32, big_endian>::readval(pindex);
1222 elfcpp::Swap_unaligned<64, big_endian>::readval(pch);
1224 elfcpp::Swap_unaligned<64, big_endian>::readval(porow);
1226 elfcpp::Swap_unaligned<64, big_endian>::readval(psrow);
1292 elfcpp::Swap_unaligned<32, big_endian>::readval(contents);
1302 elfcpp::Swap_unaligned<32, big_endian>::readval(contents
1305 elfcpp::Swap_unaligned<32, big_endian>::readval(contents
1311 elfcpp::Swap_unaligned<32, big_endian>::readval(contents
1332 uint64_t probe = elfcpp::Swap_unaligned<64, big_endian>::readval(ph);
1333 uint32_t row_index = elfcpp::Swap_unaligned<32, big_endian>::readval(pi);
1343 probe = elfcpp::Swap_unaligned<64, big_endian>::readval(ph);
1344 row_index = elfcpp::Swap_unaligned<32, big_endian>::readval(pi);
1412 elfcpp::DW_SECT section_id)
1427 if (section_id == elfcpp::DW_SECT_STR_OFFSETS)
1478 unsigned int val = elfcpp::Swap_unaligned<32, big_endian>::readval(p);
1480 elfcpp::Swap_unaligned<32, big_endian>::writeval(q, val);
1518 ? debug_shndx[elfcpp::DW_SECT_TYPES]
1519 : debug_shndx[elfcpp::DW_SECT_INFO]);
1523 if (debug_shndx[elfcpp::DW_SECT_ABBREV] == 0)
1527 Section_bounds sections[elfcpp::DW_SECT_MAX + 1];
1528 for (int i = elfcpp::DW_SECT_ABBREV; i <= elfcpp::DW_SECT_MAX; ++i)
1532 static_cast<elfcpp::DW_SECT>(i));
1539 reader.add_units(output_file, debug_shndx[elfcpp::DW_SECT_ABBREV], sections);
1564 this->next_file_offset_ = elfcpp::Elf_sizes<32>::ehdr_size;
1566 this->next_file_offset_ = elfcpp::Elf_sizes<64>::ehdr_size;
1576 static const char buf[elfcpp::Elf_sizes<64>::ehdr_size] = { 0 };
1622 Dwp_output_file::add_contribution(elfcpp::DW_SECT section_id,
1645 if (section_id == elfcpp::DW_SECT_INFO)
1769 for (unsigned int i = 1; i <= elfcpp::DW_SECT_MAX; i++)
1904 if (this->shnum_ >= elfcpp::SHN_LORESERVE)
1906 if (this->shstrndx_ >= elfcpp::SHN_LORESERVE)
1912 this->write_shdr(sect.name, elfcpp::SHT_PROGBITS, 0, 0, sect.offset,
1915 this->write_shdr(shstrtab_name, elfcpp::SHT_STRTAB, 0, 0,
1979 for (unsigned int c = 1; c <= elfcpp::DW_SECT_MAX; ++c)
1995 elfcpp::Swap_unaligned<32, big_endian>::writeval(p, 2);
1997 elfcpp::Swap_unaligned<32, big_endian>::writeval(p, ncols);
1999 elfcpp::Swap_unaligned<32, big_endian>::writeval(p, nused);
2001 elfcpp::Swap_unaligned<32, big_endian>::writeval(p, nslots);
2007 elfcpp::Swap_unaligned<64, big_endian>::writeval(p, index.hash_table(i));
2014 elfcpp::Swap_unaligned<32, big_endian>::writeval(p, index.index_table(i));
2019 for (unsigned int c = 1; c <= elfcpp::DW_SECT_MAX; ++c)
2023 elfcpp::Swap_unaligned<32, big_endian>::writeval(p, c);
2034 for (unsigned int c = 1; c <= elfcpp::DW_SECT_MAX; ++c)
2039 elfcpp::Swap_unaligned<32, big_endian>::writeval(p, offset);
2054 for (unsigned int c = 1; c <= elfcpp::DW_SECT_MAX; ++c)
2059 elfcpp::Swap_unaligned<32, big_endian>::writeval(p, size);
2102 const unsigned int ehdr_size = elfcpp::Elf_sizes<size>::ehdr_size;
2104 elfcpp::Ehdr_write<size, big_endian> ehdr(buf);
2106 unsigned char e_ident[elfcpp::EI_NIDENT];
2107 memset(e_ident, 0, elfcpp::EI_NIDENT);
2108 e_ident[elfcpp::EI_MAG0] = elfcpp::ELFMAG0;
2109 e_ident[elfcpp::EI_MAG1] = elfcpp::ELFMAG1;
2110 e_ident[elfcpp::EI_MAG2] = elfcpp::ELFMAG2;
2111 e_ident[elfcpp::EI_MAG3] = elfcpp::ELFMAG3;
2113 e_ident[elfcpp::EI_CLASS] = elfcpp::ELFCLASS32;
2115 e_ident[elfcpp::EI_CLASS] = elfcpp::ELFCLASS64;
2118 e_ident[elfcpp::EI_DATA] = (big_endian
2119 ? elfcpp::ELFDATA2MSB
2120 : elfcpp::ELFDATA2LSB);
2121 e_ident[elfcpp::EI_VERSION] = elfcpp::EV_CURRENT;
2124 ehdr.put_e_type(elfcpp::ET_REL);
2126 ehdr.put_e_version(elfcpp::EV_CURRENT);
2131 ehdr.put_e_ehsize(elfcpp::Elf_sizes<size>::ehdr_size);
2134 ehdr.put_e_shentsize(elfcpp::Elf_sizes<size>::shdr_size);
2135 ehdr.put_e_shnum(this->shnum_ < elfcpp::SHN_LORESERVE ? this->shnum_ : 0);
2136 ehdr.put_e_shstrndx(this->shstrndx_ < elfcpp::SHN_LORESERVE
2138 : static_cast<unsigned int>(elfcpp::SHN_XINDEX));
2188 const unsigned int shdr_size = elfcpp::Elf_sizes<size>::shdr_size;
2190 elfcpp::Shdr_write<size, big_endian> shdr(buf);
2213 const char* dwo_name = die->string_attribute(elfcpp::DW_AT_GNU_dwo_name);
2216 uint64_t dwo_id = die->uint_attribute(elfcpp::DW_AT_GNU_dwo_id);
2245 unit_set->signature = die->uint_attribute(elfcpp::DW_AT_GNU_dwo_id);
2246 for (unsigned int i = elfcpp::DW_SECT_ABBREV; i <= elfcpp::DW_SECT_MAX; ++i)
2253 this->output_file_->add_contribution(elfcpp::DW_SECT_INFO,
2257 unit_set->sections[elfcpp::DW_SECT_INFO] = bounds;
2274 for (unsigned int i = elfcpp::DW_SECT_ABBREV; i <= elfcpp::DW_SECT_MAX; ++i)
2280 this->output_file_->add_contribution(elfcpp::DW_SECT_TYPES, contents,
2283 unit_set->sections[elfcpp::DW_SECT_TYPES] = bounds;