LLVM  15.0.0git
Macros | Functions
COFFObjectFile.cpp File Reference
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/BinaryFormat/COFF.h"
#include "llvm/Object/Binary.h"
#include "llvm/Object/COFF.h"
#include "llvm/Object/Error.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Support/BinaryStreamReader.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemoryBufferRef.h"
#include <algorithm>
#include <cassert>
#include <cinttypes>
#include <cstddef>
#include <cstring>
#include <limits>
#include <memory>
#include <system_error>
Include dependency graph for COFFObjectFile.cpp:

Go to the source code of this file.


#define RETURN_IF_ERROR(Expr)


static bool checkSize (MemoryBufferRef M, std::error_code &EC, uint64_t Size)
template<typename T >
static Error getObject (const T *&Obj, MemoryBufferRef M, const void *Ptr, const uint64_t Size=sizeof(T))
static bool decodeBase64StringEntry (StringRef Str, uint32_t &Result)
static uint32_t getNumberOfRelocations (const coff_section *Sec, MemoryBufferRef M, const uint8_t *base)
static const coff_relocation * getFirstReloc (const coff_section *Sec, MemoryBufferRef M, const uint8_t *Base)
static Error ignoreStrippedErrors (Error E)
static imported_symbol_iterator makeImportedSymbolIterator (const COFFObjectFile *Object, uintptr_t Ptr, int Index)
static imported_symbol_iterator importedSymbolBegin (uint32_t RVA, const COFFObjectFile *Object)
static imported_symbol_iterator importedSymbolEnd (uint32_t RVA, const COFFObjectFile *Object)

Macro Definition Documentation


#define LLVM_COFF_SWITCH_RELOC_TYPE_NAME (   reloc_type)
case COFF::reloc_type: \
return #reloc_type;

Definition at line 1264 of file COFFObjectFile.cpp.


#define RETURN_IF_ERROR (   Expr)
do { \
Error E = (Expr); \
if (E) \
return std::move(E); \
} while (0)

Definition at line 1752 of file COFFObjectFile.cpp.

Function Documentation

◆ checkSize()

static bool checkSize ( MemoryBufferRef  M,
std::error_code &  EC,
uint64_t  Size 

Definition at line 47 of file COFFObjectFile.cpp.

References M, and llvm::object::unexpected_eof.

◆ decodeBase64StringEntry()

static bool decodeBase64StringEntry ( StringRef  Str,
uint32_t Result 

Definition at line 69 of file COFFObjectFile.cpp.

References assert(), and llvm::max().

Referenced by llvm::object::COFFObjectFile::getSectionName().

◆ getFirstReloc()

static const coff_relocation* getFirstReloc ( const coff_section *  Sec,
MemoryBufferRef  M,
const uint8_t *  Base 

◆ getNumberOfRelocations()

static uint32_t getNumberOfRelocations ( const coff_section *  Sec,
MemoryBufferRef  M,
const uint8_t *  base 

◆ getObject()

template<typename T >
static Error getObject ( const T *&  Obj,
MemoryBufferRef  M,
const void *  Ptr,
const uint64_t  Size = sizeof(T) 

Definition at line 58 of file COFFObjectFile.cpp.

References Addr, llvm::object::Binary::checkOffset(), E, M, and llvm::Error::success().

◆ ignoreStrippedErrors()

static Error ignoreStrippedErrors ( Error  E)

Definition at line 778 of file COFFObjectFile.cpp.

References llvm::consumeError(), E, move, and llvm::Error::success().

◆ importedSymbolBegin()

static imported_symbol_iterator importedSymbolBegin ( uint32_t  RVA,
const COFFObjectFile *  Object 

◆ importedSymbolEnd()

static imported_symbol_iterator importedSymbolEnd ( uint32_t  RVA,
const COFFObjectFile *  Object 

◆ makeImportedSymbolIterator()

static imported_symbol_iterator makeImportedSymbolIterator ( const COFFObjectFile *  Object,
uintptr_t  Ptr,
int  Index 

Definition at line 1400 of file COFFObjectFile.cpp.

References llvm::Object, and P.

Referenced by importedSymbolBegin().

static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546