LLVM 20.0.0git
|
Classes | |
struct | AuxSymbol |
class | COFFReader |
class | COFFWriter |
struct | Object |
struct | Relocation |
struct | Section |
struct | Symbol |
Functions | |
Error | executeObjcopyOnBinary (const CommonConfig &Config, const COFFConfig &, object::COFFObjectFile &In, raw_ostream &Out) |
Apply the transformations described by Config and COFFConfig to In and writes the result into Out . | |
static bool | isDebugSection (const Section &Sec) |
static uint64_t | getNextRVA (const Object &Obj) |
static Expected< std::vector< uint8_t > > | createGnuDebugLinkSectionContents (StringRef File) |
static void | addSection (Object &Obj, StringRef Name, ArrayRef< uint8_t > Contents, uint32_t Characteristics) |
static Error | addGnuDebugLink (Object &Obj, StringRef DebugLinkFile) |
static uint32_t | flagsToCharacteristics (SectionFlag AllFlags, uint32_t OldChar) |
static Error | dumpSection (Object &O, StringRef SectionName, StringRef FileName) |
static Error | handleArgs (const CommonConfig &Config, const COFFConfig &COFFConfig, Object &Obj) |
template<class Symbol1Ty , class Symbol2Ty > | |
void | copySymbol (Symbol1Ty &Dest, const Symbol2Ty &Src) |
template<class PeHeader1Ty , class PeHeader2Ty > | |
void | copyPeHeader (PeHeader1Ty &Dest, const PeHeader2Ty &Src) |
Definition at line 85 of file COFFObjcopy.cpp.
References addSection(), createGnuDebugLinkSectionContents(), llvm::COFF::IMAGE_SCN_CNT_INITIALIZED_DATA, llvm::COFF::IMAGE_SCN_MEM_DISCARDABLE, llvm::COFF::IMAGE_SCN_MEM_READ, llvm::Error::success(), and llvm::Expected< T >::takeError().
Referenced by handleArgs().
|
static |
Definition at line 61 of file COFFObjcopy.cpp.
References llvm::objcopy::coff::Object::addSections(), llvm::alignTo(), llvm::object::pe32plus_header::FileAlignment, getNextRVA(), llvm::COFF::IMAGE_SCN_MEM_EXECUTE, llvm::COFF::IMAGE_SCN_MEM_READ, llvm::COFF::IMAGE_SCN_MEM_WRITE, llvm::objcopy::coff::Object::IsPE, Name, llvm::objcopy::coff::Object::PeHeader, and llvm::objcopy::coff::Section::setOwnedContents().
Referenced by addGnuDebugLink(), and handleArgs().
void llvm::objcopy::coff::copyPeHeader | ( | PeHeader1Ty & | Dest, |
const PeHeader2Ty & | Src | ||
) |
Definition at line 175 of file COFFObject.h.
void llvm::objcopy::coff::copySymbol | ( | Symbol1Ty & | Dest, |
const Symbol2Ty & | Src | ||
) |
Definition at line 161 of file COFFObject.h.
|
static |
Definition at line 44 of file COFFObjcopy.cpp.
References llvm::alignTo(), llvm::crc32(), llvm::createFileError(), llvm::StringRef::data(), llvm::Data, llvm::objcopy::File, llvm::sys::path::filename(), llvm::ErrorOr< T >::getError(), llvm::MemoryBuffer::getFile(), llvm::StringRef::size(), and llvm::support::endian::write32le().
Referenced by addGnuDebugLink().
|
static |
Definition at line 134 of file COFFObjcopy.cpp.
References B, llvm::copy(), llvm::FileOutputBuffer::create(), llvm::createStringError(), E, llvm::objcopy::coff::Section::getContents(), llvm::objcopy::coff::Section::Name, llvm::ArrayRef< T >::size(), and llvm::Error::success().
Referenced by handleArgs().
Error llvm::objcopy::coff::executeObjcopyOnBinary | ( | const CommonConfig & | Config, |
const COFFConfig & | COFFConfig, | ||
object::COFFObjectFile & | In, | ||
raw_ostream & | Out | ||
) |
Apply the transformations described by Config
and COFFConfig
to In
and writes the result into Out
.
Definition at line 322 of file COFFObjcopy.cpp.
References assert(), Config, llvm::objcopy::coff::COFFReader::create(), llvm::createFileError(), E, llvm::Expected< T >::get(), handleArgs(), llvm::Error::success(), and llvm::Expected< T >::takeError().
Referenced by llvm::objcopy::executeObjcopyOnBinary().
|
static |
Definition at line 98 of file COFFObjcopy.cpp.
References llvm::COFF::IMAGE_SCN_ALIGN_1024BYTES, llvm::COFF::IMAGE_SCN_ALIGN_128BYTES, llvm::COFF::IMAGE_SCN_ALIGN_16BYTES, llvm::COFF::IMAGE_SCN_ALIGN_1BYTES, llvm::COFF::IMAGE_SCN_ALIGN_2048BYTES, llvm::COFF::IMAGE_SCN_ALIGN_256BYTES, llvm::COFF::IMAGE_SCN_ALIGN_2BYTES, llvm::COFF::IMAGE_SCN_ALIGN_32BYTES, llvm::COFF::IMAGE_SCN_ALIGN_4096BYTES, llvm::COFF::IMAGE_SCN_ALIGN_4BYTES, llvm::COFF::IMAGE_SCN_ALIGN_512BYTES, llvm::COFF::IMAGE_SCN_ALIGN_64BYTES, llvm::COFF::IMAGE_SCN_ALIGN_8192BYTES, llvm::COFF::IMAGE_SCN_ALIGN_8BYTES, llvm::COFF::IMAGE_SCN_CNT_CODE, llvm::COFF::IMAGE_SCN_CNT_INITIALIZED_DATA, llvm::COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA, llvm::COFF::IMAGE_SCN_LNK_REMOVE, llvm::COFF::IMAGE_SCN_MEM_DISCARDABLE, llvm::COFF::IMAGE_SCN_MEM_EXECUTE, llvm::COFF::IMAGE_SCN_MEM_READ, llvm::COFF::IMAGE_SCN_MEM_SHARED, llvm::COFF::IMAGE_SCN_MEM_WRITE, llvm::objcopy::SecAlloc, llvm::objcopy::SecCode, llvm::objcopy::SecData, llvm::objcopy::SecDebug, llvm::objcopy::SecExclude, llvm::objcopy::SecLoad, llvm::objcopy::SecNoload, llvm::objcopy::SecReadonly, and llvm::objcopy::SecShare.
Referenced by handleArgs().
Definition at line 35 of file COFFObjcopy.cpp.
References llvm::alignTo(), llvm::objcopy::coff::Object::getSections(), llvm::objcopy::coff::Object::IsPE, llvm::Last, llvm::objcopy::coff::Object::PeHeader, and llvm::object::pe32plus_header::SectionAlignment.
Referenced by addSection().
|
static |
Definition at line 157 of file COFFObjcopy.cpp.
References addGnuDebugLink(), addSection(), llvm::objcopy::All, llvm::object::coff_section::Characteristics, Config, llvm::createStringError(), dumpSection(), E, llvm::objcopy::File, llvm::find_if(), flagsToCharacteristics(), llvm::objcopy::coff::Object::getMutableSections(), llvm::objcopy::coff::Object::getMutableSymbols(), llvm::objcopy::coff::Section::Header, I, if(), llvm::COFF::IMAGE_SCN_ALIGN_1BYTES, llvm::COFF::IMAGE_SCN_CNT_CODE, llvm::COFF::IMAGE_SCN_CNT_INITIALIZED_DATA, llvm::COFF::IMAGE_SYM_CLASS_STATIC, llvm::invalid_argument, isDebugSection(), llvm::objcopy::coff::Object::IsPE, llvm::objcopy::COFFConfig::MajorSubsystemVersion, llvm::object::pe32plus_header::MajorSubsystemVersion, llvm::objcopy::coff::Object::markSymbols(), llvm::objcopy::COFFConfig::MinorSubsystemVersion, llvm::object::pe32plus_header::MinorSubsystemVersion, llvm::objcopy::coff::Section::Name, llvm::objcopy::coff::Symbol::Name, llvm::objcopy::coff::Object::PeHeader, llvm::objcopy::coff::Symbol::Referenced, llvm::objcopy::coff::Section::Relocs, llvm::objcopy::coff::Object::removeSections(), llvm::objcopy::coff::Object::removeSymbols(), llvm::objcopy::NewSectionInfo::SectionData, llvm::objcopy::NewSectionInfo::SectionName, llvm::object::coff_symbol< SectionNumberType >::SectionNumber, llvm::object::coff_symbol< SectionNumberType >::StorageClass, llvm::StringRef::str(), llvm::objcopy::COFFConfig::Subsystem, llvm::object::pe32plus_header::Subsystem, llvm::Error::success(), Sym, llvm::objcopy::coff::Symbol::Sym, ToRemove, and llvm::objcopy::coff::Object::truncateSections().
Referenced by executeObjcopyOnBinary().
Definition at line 31 of file COFFObjcopy.cpp.
References llvm::objcopy::coff::Section::Name, and llvm::StringRef::starts_with().
Referenced by handleArgs().