Lines Matching refs:ELF
126 if (LHSType == ELF::STT_SECTION && RHSType != ELF::STT_SECTION) in operator <()
128 if (LHSType != ELF::STT_SECTION && RHSType == ELF::STT_SECTION) in operator <()
130 if (LHSType == ELF::STT_SECTION && RHSType == ELF::STT_SECTION) in operator <()
140 StringTableBuilder StrTabBuilder{StringTableBuilder::ELF};
367 bool LargeIndex = shndx >= ELF::SHN_LORESERVE && !Reserved; in writeSymbol()
379 uint16_t Index = LargeIndex ? uint16_t(ELF::SHN_XINDEX) : shndx; in writeSymbol()
418 W.OS << ELF::ElfMagic; // e_ident[EI_MAG0] to e_ident[EI_MAG3] in writeHeader()
420 W.OS << char(is64Bit() ? ELF::ELFCLASS64 : ELF::ELFCLASS32); // e_ident[EI_CLASS] in writeHeader()
423 W.OS << char(W.Endian == support::little ? ELF::ELFDATA2LSB in writeHeader()
424 : ELF::ELFDATA2MSB); in writeHeader()
426 W.OS << char(ELF::EV_CURRENT); // e_ident[EI_VERSION] in writeHeader()
431 W.OS.write_zeros(ELF::EI_NIDENT - ELF::EI_PAD); in writeHeader()
433 W.write<uint16_t>(ELF::ET_REL); // e_type in writeHeader()
437 W.write<uint32_t>(ELF::EV_CURRENT); // e_version in writeHeader()
446 W.write<uint16_t>(is64Bit() ? sizeof(ELF::Elf64_Ehdr) in writeHeader()
447 : sizeof(ELF::Elf32_Ehdr)); in writeHeader()
453 W.write<uint16_t>(is64Bit() ? sizeof(ELF::Elf64_Shdr) in writeHeader()
454 : sizeof(ELF::Elf32_Shdr)); in writeHeader()
460 assert(StringTableIndex < ELF::SHN_LORESERVE); in writeHeader()
490 case ELF::STT_GNU_IFUNC: in mergeTypeForSet()
491 if (Type == ELF::STT_FUNC || Type == ELF::STT_OBJECT || in mergeTypeForSet()
492 Type == ELF::STT_NOTYPE || Type == ELF::STT_TLS) in mergeTypeForSet()
493 Type = ELF::STT_GNU_IFUNC; in mergeTypeForSet()
495 case ELF::STT_FUNC: in mergeTypeForSet()
496 if (Type == ELF::STT_OBJECT || Type == ELF::STT_NOTYPE || in mergeTypeForSet()
497 Type == ELF::STT_TLS) in mergeTypeForSet()
498 Type = ELF::STT_FUNC; in mergeTypeForSet()
500 case ELF::STT_OBJECT: in mergeTypeForSet()
501 if (Type == ELF::STT_NOTYPE) in mergeTypeForSet()
502 Type = ELF::STT_OBJECT; in mergeTypeForSet()
504 case ELF::STT_TLS: in mergeTypeForSet()
505 if (Type == ELF::STT_OBJECT || Type == ELF::STT_NOTYPE || in mergeTypeForSet()
506 Type == ELF::STT_GNU_IFUNC || Type == ELF::STT_FUNC) in mergeTypeForSet()
507 Type = ELF::STT_TLS; in mergeTypeForSet()
560 if (Sym.getType() == ELF::STT_GNU_IFUNC) in isWeak()
566 case ELF::STB_LOCAL: in isWeak()
568 case ELF::STB_GLOBAL: in isWeak()
570 case ELF::STB_WEAK: in isWeak()
571 case ELF::STB_GNU_UNIQUE: in isWeak()
604 if (Symbol.getType() == ELF::STT_SECTION) in isInSymtab()
618 unsigned EntrySize = is64Bit() ? ELF::SYMENTRY_SIZE64 : ELF::SYMENTRY_SIZE32; in computeSymbolTable()
620 Ctx.getELFSection(".symtab", ELF::SHT_SYMTAB, 0, EntrySize, ""); in computeSymbolTable()
653 bool Local = Symbol.getBinding() == ELF::STB_LOCAL; in computeSymbolTable()
657 MSD.SectionIndex = ELF::SHN_ABS; in computeSymbolTable()
660 MSD.SectionIndex = ELF::SHN_COMMON; in computeSymbolTable()
664 if (MSD.SectionIndex >= ELF::SHN_LORESERVE) in computeSymbolTable()
667 MSD.SectionIndex = ELF::SHN_UNDEF; in computeSymbolTable()
680 ELF::STT_SECTION); in computeSymbolTable()
690 if (MSD.SectionIndex >= ELF::SHN_LORESERVE) in computeSymbolTable()
697 if (Symbol.getType() != ELF::STT_SECTION) { in computeSymbolTable()
713 Ctx.getELFSection(".symtab_shndxr", ELF::SHT_SYMTAB_SHNDX, 0, 4, ""); in computeSymbolTable()
728 ELF::STT_FILE | ELF::STB_LOCAL, 0, 0, ELF::STV_DEFAULT, in computeSymbolTable()
729 ELF::SHN_ABS, true); in computeSymbolTable()
740 unsigned StringIndex = MSD.Symbol->getType() == ELF::STT_SECTION in computeSymbolTable()
754 assert(MSD.Symbol->getBinding() != ELF::STB_LOCAL); in computeSymbolTable()
792 EntrySize = is64Bit() ? sizeof(ELF::Elf64_Rela) : sizeof(ELF::Elf32_Rela); in createRelocationSection()
794 EntrySize = is64Bit() ? sizeof(ELF::Elf64_Rel) : sizeof(ELF::Elf32_Rel); in createRelocationSection()
797 if (Sec.getFlags() & ELF::SHF_GROUP) in createRelocationSection()
798 Flags = ELF::SHF_GROUP; in createRelocationSection()
801 RelaSectionName, hasRelocationAddend() ? ELF::SHT_RELA : ELF::SHT_REL, in createRelocationSection()
813 is64Bit() ? sizeof(ELF::Elf32_Chdr) : sizeof(ELF::Elf64_Chdr); in maybeWriteCompression()
819 write(static_cast<ELF::Elf64_Word>(ELF::ELFCOMPRESS_ZLIB)); in maybeWriteCompression()
820 write(static_cast<ELF::Elf64_Word>(0)); // ch_reserved field. in maybeWriteCompression()
821 write(static_cast<ELF::Elf64_Xword>(Size)); in maybeWriteCompression()
822 write(static_cast<ELF::Elf64_Xword>(Alignment)); in maybeWriteCompression()
825 write(static_cast<ELF::Elf32_Word>(ELF::ELFCOMPRESS_ZLIB)); in maybeWriteCompression()
826 write(static_cast<ELF::Elf32_Word>(Size)); in maybeWriteCompression()
827 write(static_cast<ELF::Elf32_Word>(Alignment)); in maybeWriteCompression()
887 Section.setFlags(Section.getFlags() | ELF::SHF_COMPRESSED); in writeSectionData()
929 if (OWriter.TargetObjectWriter->getEMachine() == ELF::EM_MIPS) { in writeRelocations()
937 struct ELF::Elf64_Rela ERE64; in writeRelocations()
946 struct ELF::Elf32_Rela ERE32; in writeRelocations()
953 if (OWriter.TargetObjectWriter->getEMachine() == ELF::EM_MIPS) { in writeRelocations()
992 case ELF::SHT_DYNAMIC: in writeSection()
995 case ELF::SHT_REL: in writeSection()
996 case ELF::SHT_RELA: { in writeSection()
1004 case ELF::SHT_SYMTAB: in writeSection()
1009 case ELF::SHT_SYMTAB_SHNDX: in writeSection()
1010 case ELF::SHT_LLVM_CALL_GRAPH_PROFILE: in writeSection()
1011 case ELF::SHT_LLVM_ADDRSIG: in writeSection()
1015 case ELF::SHT_GROUP: in writeSection()
1021 if (Section.getFlags() & ELF::SHF_LINK_ORDER) { in writeSection()
1040 (NumSections + 1) >= ELF::SHN_LORESERVE ? NumSections + 1 : 0; in writeSectionHeader()
1046 if (Type != ELF::SHT_GROUP) in writeSectionHeader()
1054 if (Type == ELF::SHT_NOBITS) in writeSectionHeader()
1069 Ctx.getELFSection(".strtab", ELF::SHT_STRTAB, 0); in writeObject()
1132 ELF::SHT_LLVM_CALL_GRAPH_PROFILE, in writeObject()
1133 ELF::SHF_EXCLUDE, 16, ""); in writeObject()
1145 write(uint32_t(ELF::GRP_COMDAT)); in writeObject()
1162 AddrsigSection = Ctx.getELFSection(".llvm_addrsig", ELF::SHT_LLVM_ADDRSIG, in writeObject()
1163 ELF::SHF_EXCLUDE); in writeObject()
1219 (SectionTable.size() + 1 >= ELF::SHN_LORESERVE) ? (uint16_t)ELF::SHN_UNDEF in writeObject()
1229 offsetof(ELF::Elf64_Ehdr, e_shoff)); in writeObject()
1230 NumSectionsOffset = offsetof(ELF::Elf64_Ehdr, e_shnum); in writeObject()
1235 offsetof(ELF::Elf32_Ehdr, e_shoff)); in writeObject()
1236 NumSectionsOffset = offsetof(ELF::Elf32_Ehdr, e_shnum); in writeObject()
1355 case ELF::STB_LOCAL: in shouldRelocateWithSymbol()
1357 case ELF::STB_WEAK: in shouldRelocateWithSymbol()
1362 case ELF::STB_GLOBAL: in shouldRelocateWithSymbol()
1378 if (Flags & ELF::SHF_MERGE) { in shouldRelocateWithSymbol()
1392 if (Flags & ELF::SHF_TLS) in shouldRelocateWithSymbol()