Lines Matching refs:ELF

139       return sizeof(llvm::ELF::Elf32_Ehdr) +  in sectionStartOffset()
140 elfSegmentTable().size() * sizeof(llvm::ELF::Elf32_Phdr); in sectionStartOffset()
142 return sizeof(llvm::ELF::Elf64_Ehdr) + in sectionStartOffset()
143 elfSegmentTable().size() * sizeof(llvm::ELF::Elf64_Phdr); in sectionStartOffset()
596 elfSegmentTable().find(llvm::ELF::PT_LOAD, 0x0, 0x0); in finalizeStandardSymbols()
609 elfSegmentTable().find(llvm::ELF::PT_LOAD, in finalizeStandardSymbols()
610 llvm::ELF::PF_X, in finalizeStandardSymbols()
611 llvm::ELF::PF_W); in finalizeStandardSymbols()
642 elfSegmentTable().find(llvm::ELF::PT_LOAD, llvm::ELF::PF_W, 0x0); in finalizeStandardSymbols()
697 elfSegmentTable().find(llvm::ELF::PT_TLS, llvm::ELF::PF_R, 0x0); in finalizeTLSSymbol()
849 sizeof(llvm::ELF::Elf32_Word); in sizeNamePools()
874 sizeof(llvm::ELF::Elf32_Sym)); in sizeNamePools()
877 sizeof(llvm::ELF::Elf64_Sym)); in sizeNamePools()
897 file_format->getSymTab().setSize(symtab*sizeof(llvm::ELF::Elf32_Sym)); in sizeNamePools()
899 file_format->getSymTab().setSize(symtab*sizeof(llvm::ELF::Elf64_Sym)); in sizeNamePools()
918 void GNULDBackend::emitSymbol32(llvm::ELF::Elf32_Sym& pSym, in emitSymbol32()
941 void GNULDBackend::emitSymbol64(llvm::ELF::Elf64_Sym& pSym, in emitSymbol64()
983 llvm::ELF::Elf32_Sym* symtab32 = NULL; in emitRegNamePools()
984 llvm::ELF::Elf64_Sym* symtab64 = NULL; in emitRegNamePools()
986 symtab32 = (llvm::ELF::Elf32_Sym*)symtab_region.begin(); in emitRegNamePools()
988 symtab64 = (llvm::ELF::Elf64_Sym*)symtab_region.begin(); in emitRegNamePools()
1058 llvm::ELF::Elf32_Sym* symtab32 = NULL; in emitDynNamePools()
1059 llvm::ELF::Elf64_Sym* symtab64 = NULL; in emitDynNamePools()
1061 symtab32 = (llvm::ELF::Elf32_Sym*)symtab_region.begin(); in emitDynNamePools()
1063 symtab64 = (llvm::ELF::Elf64_Sym*)symtab_region.begin(); in emitDynNamePools()
1115 (*dt_need)->setValue(llvm::ELF::DT_NEEDED, strtabsize); in emitDynNamePools()
1123 (*dt_need)->setValue(llvm::ELF::DT_RPATH, strtabsize); in emitDynNamePools()
1125 (*dt_need)->setValue(llvm::ELF::DT_RUNPATH, strtabsize); in emitDynNamePools()
1178 hash::StringHash<hash::ELF> hash_func; in emitELFHashTab()
1377 if (0 == (pSectHdr.flag() & llvm::ELF::SHF_ALLOC)) in getSectionOrder()
1380 bool is_write = (pSectHdr.flag() & llvm::ELF::SHF_WRITE) != 0; in getSectionOrder()
1381 bool is_exec = (pSectHdr.flag() & llvm::ELF::SHF_EXECINSTR) != 0; in getSectionOrder()
1407 if ((pSectHdr.flag() & llvm::ELF::SHF_TLS) != 0x0) { in getSectionOrder()
1414 if ((pSectHdr.flag() & llvm::ELF::SHF_TLS) != 0x0) in getSectionOrder()
1473 bind = llvm::ELF::STB_LOCAL; in getSymbolInfo()
1475 bind = llvm::ELF::STB_GLOBAL; in getSymbolInfo()
1477 bind = llvm::ELF::STB_WEAK; in getSymbolInfo()
1480 bind = llvm::ELF::STB_GLOBAL; in getSymbolInfo()
1484 (pSymbol.visibility() == llvm::ELF::STV_INTERNAL || in getSymbolInfo()
1485 pSymbol.visibility() == llvm::ELF::STV_HIDDEN)) in getSymbolInfo()
1486 bind = llvm::ELF::STB_LOCAL; in getSymbolInfo()
1510 return llvm::ELF::SHN_ABS; in getSymbolShndx()
1512 return llvm::ELF::SHN_COMMON; in getSymbolShndx()
1514 return llvm::ELF::SHN_UNDEF; in getSymbolShndx()
1517 return llvm::ELF::SHN_ABS; in getSymbolShndx()
1674 (llvm::ELF::SHF_WRITE | in updateSectionFlags()
1675 llvm::ELF::SHF_ALLOC | in updateSectionFlags()
1676 llvm::ELF::SHF_EXECINSTR)); in updateSectionFlags()
1679 if (0 == (pFrom.flag() & llvm::ELF::SHF_MERGE)) in updateSectionFlags()
1680 flags &= ~llvm::ELF::SHF_MERGE; in updateSectionFlags()
1683 if (0 == (pFrom.flag() & llvm::ELF::SHF_STRINGS)) in updateSectionFlags()
1684 flags &= ~llvm::ELF::SHF_STRINGS; in updateSectionFlags()
1691 bool GNULDBackend::readRelocation(const llvm::ELF::Elf32_Rel& pRel, in readRelocation()
1712 bool GNULDBackend::readRelocation(const llvm::ELF::Elf32_Rela& pRel, in readRelocation()
1736 bool GNULDBackend::readRelocation(const llvm::ELF::Elf64_Rel& pRel, in readRelocation()
1757 bool GNULDBackend::readRelocation(const llvm::ELF::Elf64_Rela& pRel, in readRelocation()
1781 void GNULDBackend::emitRelocation(llvm::ELF::Elf32_Rel& pRel, in emitRelocation()
1791 void GNULDBackend::emitRelocation(llvm::ELF::Elf32_Rela& pRel, in emitRelocation()
1803 void GNULDBackend::emitRelocation(llvm::ELF::Elf64_Rel& pRel, in emitRelocation()
1813 void GNULDBackend::emitRelocation(llvm::ELF::Elf64_Rela& pRel, in emitRelocation()
1832 elfSegmentTable().produce(llvm::ELF::PT_PHDR); in createProgramHdrs()
1834 ELFSegment* interp_seg = elfSegmentTable().produce(llvm::ELF::PT_INTERP); in createProgramHdrs()
1849 if (0 == (sect->flag() & llvm::ELF::SHF_ALLOC) && in createProgramHdrs()
1865 (prev_flag & llvm::ELF::PF_W) ^ (cur_flag & llvm::ELF::PF_W)) { in createProgramHdrs()
1891 load_seg = elfSegmentTable().produce(llvm::ELF::PT_LOAD, cur_flag); in createProgramHdrs()
1906 ELFSegment* dyn_seg = elfSegmentTable().produce(llvm::ELF::PT_DYNAMIC, in createProgramHdrs()
1907 llvm::ELF::PF_R | in createProgramHdrs()
1908 llvm::ELF::PF_W); in createProgramHdrs()
1914 ELFSegment* relro_seg = elfSegmentTable().produce(llvm::ELF::PT_GNU_RELRO); in createProgramHdrs()
1917 if (llvm::ELF::PT_LOAD != (*seg)->type()) in createProgramHdrs()
1934 ELFSegment* eh_seg = elfSegmentTable().produce(llvm::ELF::PT_GNU_EH_FRAME); in createProgramHdrs()
1940 ELFSegment* tls_seg = elfSegmentTable().produce(llvm::ELF::PT_TLS); in createProgramHdrs()
1949 elfSegmentTable().produce(llvm::ELF::PT_GNU_STACK, in createProgramHdrs()
1950 llvm::ELF::PF_R | in createProgramHdrs()
1951 llvm::ELF::PF_W | in createProgramHdrs()
1962 if ((*sect)->type() != llvm::ELF::SHT_NOTE || in createProgramHdrs()
1963 ((*sect)->flag() & llvm::ELF::SHF_ALLOC) == 0) in createProgramHdrs()
1970 (cur_flag & llvm::ELF::PF_W) != (prev_flag & llvm::ELF::PF_W)) in createProgramHdrs()
1971 note_seg = elfSegmentTable().produce(llvm::ELF::PT_NOTE, cur_flag); in createProgramHdrs()
1993 if ((*seg)->type() == llvm::ELF::PT_LOAD && in setupProgramHdrs()
1999 if ((*seg)->type() == llvm::ELF::PT_LOAD && in setupProgramHdrs()
2030 elfSegmentTable().find(llvm::ELF::PT_LOAD, null_sect); in setupProgramHdrs()
2036 if ((*seg)->type() == llvm::ELF::PT_LOAD) in setupProgramHdrs()
2090 elfSegmentTable().find(llvm::ELF::PT_PHDR, llvm::ELF::PF_R, 0x0); in setupProgramHdrs()
2094 elfSegmentTable().find(llvm::ELF::PT_LOAD, null_sect); in setupProgramHdrs()
2098 offset = sizeof(llvm::ELF::Elf32_Ehdr); in setupProgramHdrs()
2099 phdr_size = sizeof(llvm::ELF::Elf32_Phdr); in setupProgramHdrs()
2101 offset = sizeof(llvm::ELF::Elf64_Ehdr); in setupProgramHdrs()
2102 phdr_size = sizeof(llvm::ELF::Elf64_Phdr); in setupProgramHdrs()
2121 if ((pSectionFlag & llvm::ELF::SHF_ALLOC) != 0x0) in getSegmentFlag()
2122 flag |= llvm::ELF::PF_R; in getSegmentFlag()
2123 if ((pSectionFlag & llvm::ELF::SHF_WRITE) != 0x0) in getSegmentFlag()
2124 flag |= llvm::ELF::PF_W; in getSegmentFlag()
2125 if ((pSectionFlag & llvm::ELF::SHF_EXECINSTR) != 0x0) in getSegmentFlag()
2126 flag |= llvm::ELF::PF_X; in getSegmentFlag()
2138 flag = llvm::ELF::SHF_EXECINSTR; in setupGNUStackInfo()
2153 if (0 != (llvm::ELF::SHF_EXECINSTR & sect->flag())) { in setupGNUStackInfo()
2154 flag = llvm::ELF::SHF_EXECINSTR; in setupGNUStackInfo()
2166 if (llvm::ELF::SHF_EXECINSTR != flag && object_count != stack_note_count) in setupGNUStackInfo()
2168 flag = llvm::ELF::SHF_EXECINSTR; in setupGNUStackInfo()
2237 seg = elfSegmentTable().find(llvm::ELF::PT_LOAD, cur); in setOutputSectionAddress()
2261 } else if ((cur->flag() & llvm::ELF::SHF_ALLOC) != 0) { in setOutputSectionAddress()
2337 if ((cur->flag() & llvm::ELF::SHF_ALLOC) != 0 && in setOutputSectionAddress()
2466 matched = ((*it)->flag() & llvm::ELF::SHF_WRITE) == 0; in placeOutputSections()
2469 matched = ((*it)->flag() & llvm::ELF::SHF_WRITE) != 0; in placeOutputSections()
2658 if (llvm::ELF::SHT_REL == output_sect->type()) in preLayout()
2660 else if (llvm::ELF::SHT_RELA == output_sect->type()) in preLayout()
2955 if (0 == (flag & llvm::ELF::SHF_WRITE)) in symbolNeedsCopyReloc()
3001 if (0 == (flag & llvm::ELF::SHF_WRITE) && (flag & llvm::ELF::SHF_ALLOC)) in checkAndSetHasTextRel()