Home | History | Annotate | Download | only in llvm-readobj

Lines Matching refs:Sec

178   void LoadVersionDefs(const Elf_Shdr *sec) const;
348 bool checkTLSSections(const Elf_Phdr &Phdr, const Elf_Shdr &Sec);
349 bool checkoffsets(const Elf_Phdr &Phdr, const Elf_Shdr &Sec);
350 bool checkVMA(const Elf_Phdr &Phdr, const Elf_Shdr &Sec);
351 bool checkPTDynamic(const Elf_Phdr &Phdr, const Elf_Shdr &Sec);
363 void printRelocations(const Elf_Shdr *Sec, const ELFO *Obj);
418 void ELFDumper<ELFT>::LoadVersionNeeds(const Elf_Shdr *sec) const {
419 unsigned vn_size = sec->sh_size; // Size of section in bytes
420 unsigned vn_count = sec->sh_info; // Number of Verneed entries
421 const char *sec_start = (const char *)Obj->base() + sec->sh_offset;
452 void ELFDumper<ELFT>::LoadVersionDefs(const Elf_Shdr *sec) const {
453 unsigned vd_size = sec->sh_size; // Size of section in bytes
454 unsigned vd_count = sec->sh_info; // Number of Verdef entries
455 const char *sec_start = (const char *)Obj->base() + sec->sh_offset;
497 const typename ELFO::Elf_Shdr *Sec,
500 if (!Sec)
502 StringRef Name = unwrapOrError(Obj->getSectionName(Sec));
503 W.printNumber("Section Name", Name, Sec->sh_name);
504 W.printHex("Address", Sec->sh_addr);
505 W.printHex("Offset", Sec->sh_offset);
506 W.printNumber("Link", Sec->sh_link);
508 const uint8_t *P = (const uint8_t *)Obj->base() + Sec->sh_offset;
531 const typename ELFO::Elf_Shdr *Sec,
537 if (!Sec)
548 (const uint8_t *)Obj->base() + Sec->sh_offset;
549 const uint8_t *SecEndAddress = SecStartAddress + Sec->sh_size;
552 unwrapOrError(Obj->getSection(Sec->sh_link));
587 const typename ELFO::Elf_Shdr *Sec,
593 if (!Sec)
601 const uint8_t *SecData = (const uint8_t *)Obj->base() + Sec->sh_offset;
603 unwrapOrError(Obj->getSection(Sec->sh_link));
731 const typename ELFO::Elf_Shdr *Sec =
733 SectionName = unwrapOrError(Obj.getSectionName(Sec));
1321 for (const Elf_Shdr &Sec : Obj->sections()) {
1322 switch (Sec.sh_type) {
1326 DotSymtabSec = &Sec;
1331 DynSymRegion = createDRIFrom(&Sec);
1333 DynSymtabName = unwrapOrError(Obj->getSectionName(&Sec));
1336 ShndxTable = unwrapOrError(Obj->getSHNDXTable(Sec));
1341 dot_gnu_version_sec = &Sec;
1346 dot_gnu_version_d_sec = &Sec;
1351 dot_gnu_version_r_sec = &Sec;
1854 for (const ELFO::Elf_Shdr &Sec : Obj->sections()) {
1855 if (Sec.sh_type != ELF::SHT_ARM_ATTRIBUTES)
1858 ArrayRef<uint8_t> Contents = unwrapOrError(Obj->getSectionContents(&Sec));
2252 ArrayRef<uint8_t> Sec = unwrapOrError(Obj->getSectionContents(Shdr));
2253 if (Sec.size() != sizeof(Elf_Mips_ABIFlags<ELFT>)) {
2258 auto *Flags = reinterpret_cast<const Elf_Mips_ABIFlags<ELFT> *>(Sec.data());
2297 ArrayRef<uint8_t> Sec = unwrapOrError(Obj->getSectionContents(Shdr));
2298 if (Sec.size() != sizeof(Elf_Mips_RegInfo<ELFT>)) {
2304 auto *Reginfo = reinterpret_cast<const Elf_Mips_RegInfo<ELFT> *>(Sec.data());
2317 ArrayRef<uint8_t> Sec = unwrapOrError(Obj->getSectionContents(Shdr));
2318 while (!Sec.empty()) {
2319 if (Sec.size() < sizeof(Elf_Mips_Options<ELFT>)) {
2323 auto *O = reinterpret_cast<const Elf_Mips_Options<ELFT> *>(Sec.data());
2333 Sec = Sec.slice(O->size);
2339 for (const auto &Sec : Obj->sections()) {
2340 StringRef Name = unwrapOrError(Obj->getSectionName(&Sec));
2342 StackMapSection = &Sec;
2426 for (const Elf_Shdr &Sec : Obj->sections()) {
2427 if (Sec.sh_type == ELF::SHT_GROUP) {
2429 const Elf_Shdr *Symtab = unwrapOrError(Obj->getSection(Sec.sh_link));
2432 Obj->template getEntry<Elf_Sym>(Symtab, Sec.sh_info);
2434 Obj->template getSectionContentsAsArray<Elf_Word>(&Sec));
2435 StringRef Name = unwrapOrError(Obj->getSectionName(&Sec));
2442 auto Sec = unwrapOrError(Obj->getSection(Ndx));
2443 const StringRef Name = unwrapOrError(Obj->getSectionName(Sec));
2471 const Elf_Shdr *Sec = unwrapOrError(
2473 TargetName = unwrapOrError(Obj->getSectionName(Sec));
2520 for (const Elf_Shdr &Sec : Obj->sections()) {
2521 if (Sec.sh_type != ELF::SHT_REL && Sec.sh_type != ELF::SHT_RELA)
2524 StringRef Name = unwrapOrError(Obj->getSectionName(&Sec));
2525 unsigned Entries = Sec.getEntityCount();
2526 uintX_t Offset = Sec.sh_offset;
2530 printRelocHeader(OS, ELFT::Is64Bits, (Sec.sh_type == ELF::SHT_RELA));
2531 const Elf_Shdr *SymTab = unwrapOrError(Obj->getSection(Sec.sh_link));
2532 if (Sec.sh_type == ELF::SHT_REL) {
2533 for (const auto &R : Obj->rels(&Sec)) {
2541 for (const auto &R : Obj->relas(&Sec))
2666 for (const Elf_Shdr &Sec : Obj->sections()) {
2669 Fields[1].Str = unwrapOrError(Obj->getSectionName(&Sec));
2670 Type = getSectionTypeString(Obj->getHeader()->e_machine, Sec.sh_type);
2672 Address = to_string(format_hex_no_prefix(Sec.sh_addr, Width));
2674 Offset = to_string(format_hex_no_prefix(Sec.sh_offset, 6));
2676 Size = to_string(format_hex_no_prefix(Sec.sh_size, 6));
2678 EntrySize = to_string(format_hex_no_prefix(Sec.sh_entsize, 2));
2680 Flags = getGNUFlags(Sec.sh_flags);
2682 Link = to_string(Sec.sh_link);
2684 Info = to_string(Sec.sh_info);
2686 Alignment = to_string(Sec.sh_addralign);
2837 const Elf_Shdr &Sec) {
2838 return (((Sec.sh_flags & ELF::SHF_TLS) &&
2841 (!(Sec.sh_flags & ELF::SHF_TLS) && Phdr.p_type != ELF::PT_TLS));
2847 bool GNUStyle<ELFT>::checkoffsets(const Elf_Phdr &Phdr, const Elf_Shdr &Sec) {
2848 if (Sec.sh_type == ELF::SHT_NOBITS)
2851 (Sec.sh_type == ELF::SHT_NOBITS) && ((Sec.sh_flags & ELF::SHF_TLS) != 0);
2854 (IsSpecial && Phdr.p_type != ELF::PT_TLS) ? 0 : Sec.sh_size;
2855 if (Sec.sh_offset >= Phdr.p_offset)
2856 return ((Sec.sh_offset + SectionSize <= Phdr.p_filesz + Phdr.p_offset)
2858 (Sec.sh_offset + 1 <= Phdr.p_offset + Phdr.p_filesz));
2865 bool GNUStyle<ELFT>::checkVMA(const Elf_Phdr &Phdr, const Elf_Shdr &Sec) {
2866 if (!(Sec.sh_flags & ELF::SHF_ALLOC))
2869 (Sec.sh_type == ELF::SHT_NOBITS) && ((Sec.sh_flags & ELF::SHF_TLS) != 0);
2872 (IsSpecial && Phdr.p_type != ELF::PT_TLS) ? 0 : Sec.sh_size;
2873 if (Sec.sh_addr >= Phdr.p_vaddr)
2874 return ((Sec.sh_addr + SectionSize <= Phdr.p_vaddr + Phdr.p_memsz) &&
2875 (Sec.sh_addr + 1 <= Phdr.p_vaddr + Phdr.p_memsz));
2881 bool GNUStyle<ELFT>::checkPTDynamic(const Elf_Phdr &Phdr, const Elf_Shdr &Sec) {
2882 if (Phdr.p_type != ELF::PT_DYNAMIC || Sec.sh_size != 0 || Phdr.p_memsz == 0)
2885 return ((Sec.sh_type == ELF::SHT_NOBITS) ||
2886 (Sec.sh_offset > Phdr.p_offset &&
2887 Sec.sh_offset < Phdr.p_offset + Phdr.p_filesz)) &&
2888 (!(Sec.sh_flags & ELF::SHF_ALLOC) ||
2889 (Sec.sh_addr > Phdr.p_vaddr && Sec.sh_addr < Phdr.p_memsz));
2944 for (const Elf_Shdr &Sec : Obj->sections()) {
2949 bool TbssInNonTLS = (Sec.sh_type == ELF::SHT_NOBITS) &&
2950 ((Sec.sh_flags & ELF::SHF_TLS) != 0) &&
2952 if (!TbssInNonTLS && checkTLSSections(Phdr, Sec) &&
2953 checkoffsets(Phdr, Sec) && checkVMA(Phdr, Sec) &&
2954 checkPTDynamic(Phdr, Sec) && (Sec.sh_type != ELF::SHT_NULL))
2955 Sections += unwrapOrError(Obj->getSectionName(&Sec)).str() + " ";
3212 for (const Elf_Shdr &Sec : Obj->sections()) {
3213 if (Sec.sh_type == ELF::SHT_GROUP) {
3215 const Elf_Shdr *Symtab = unwrapOrError(Obj->getSection(Sec.sh_link));
3217 const Elf_Sym *Sym = Obj->template getEntry<Elf_Sym>(Symtab, Sec.sh_info);
3219 Obj->template getSectionContentsAsArray<Elf_Word>(&Sec));
3221 StringRef Name = unwrapOrError(Obj->getSectionName(&Sec));
3222 W.printNumber("Name", Name, Sec.sh_name);
3230 auto Sec = unwrapOrError(Obj->getSection(Data[Member]));
3231 const StringRef Name = unwrapOrError(Obj->getSectionName(Sec));
3246 for (const Elf_Shdr &Sec : Obj->sections()) {
3249 if (Sec.sh_type != ELF::SHT_REL && Sec.sh_type != ELF::SHT_RELA)
3252 StringRef Name = unwrapOrError(Obj->getSectionName(&Sec));
3257 printRelocations(&Sec, Obj);
3265 void LLVMStyle<ELFT>::printRelocations(const Elf_Shdr *Sec, const ELFO *Obj) {
3266 const Elf_Shdr *SymTab = unwrapOrError(Obj->getSection(Sec->sh_link));
3268 switch (Sec->sh_type) {
3270 for (const Elf_Rel &R : Obj->rels(Sec)) {
3279 for (const Elf_Rela &R : Obj->relas(Sec))
3293 const Elf_Shdr *Sec = unwrapOrError(
3295 TargetName = unwrapOrError(Obj->getSectionName(Sec));
3320 for (const Elf_Shdr &Sec : Obj->sections()) {
3323 StringRef Name = unwrapOrError(Obj->getSectionName(&Sec));
3327 W.printNumber("Name", Name, Sec.sh_name);
3329 getElfSectionType(Obj->getHeader()->e_machine, Sec.sh_type),
3330 Sec.sh_type);
3359 W.printFlags("Flags", Sec.sh_flags, makeArrayRef(SectionFlags));
3360 W.printHex("Address", Sec.sh_addr);
3361 W.printHex("Offset", Sec.sh_offset);
3362 W.printNumber("Size", Sec.sh_size);
3363 W.printNumber("Link", Sec.sh_link);
3364 W.printNumber("Info", Sec.sh_info);
3365 W.printNumber("AddressAlignment", Sec.sh_addralign);
3366 W.printNumber("EntrySize", Sec.sh_entsize);
3370 printRelocations(&Sec, Obj);
3381 if (SymSec == &Sec)
3386 if (opts::SectionData && Sec.sh_type != ELF::SHT_NOBITS) {
3387 ArrayRef<uint8_t> Data = unwrapOrError(Obj->getSectionContents(&Sec));