LLVM 19.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/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 "llvm/TargetParser/Triple.h"
#include <algorithm>
#include <cassert>
#include <cinttypes>
#include <cstddef>
#include <cstring>
#include <limits>
#include <memory>
#include <system_error>

Go to the source code of this file.

Macros

#define LLVM_COFF_SWITCH_RELOC_TYPE_NAME(reloc_type)
 
#define RETURN_IF_ERROR(Expr)
 

Functions

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_relocationgetFirstReloc (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

◆ LLVM_COFF_SWITCH_RELOC_TYPE_NAME

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

Definition at line 1318 of file COFFObjectFile.cpp.

◆ RETURN_IF_ERROR

#define RETURN_IF_ERROR (   Expr)
Value:
do { \
Error E = (Expr); \
if (E) \
return std::move(E); \
} while (0)
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160

Definition at line 1808 of file COFFObjectFile.cpp.

Function Documentation

◆ checkSize()

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

Definition at line 47 of file COFFObjectFile.cpp.

References Size.

◆ decodeBase64StringEntry()

static bool decodeBase64StringEntry ( StringRef  Str,
uint32_t Result 
)
static

Definition at line 69 of file COFFObjectFile.cpp.

References assert().

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

◆ getFirstReloc()

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

◆ getNumberOfRelocations()

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

◆ getObject()

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

◆ ignoreStrippedErrors()

static Error ignoreStrippedErrors ( Error  E)
static

◆ importedSymbolBegin()

static imported_symbol_iterator importedSymbolBegin ( uint32_t  RVA,
const COFFObjectFile Object 
)
static

◆ importedSymbolEnd()

static imported_symbol_iterator importedSymbolEnd ( uint32_t  RVA,
const COFFObjectFile Object 
)
static

◆ makeImportedSymbolIterator()

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

Definition at line 1456 of file COFFObjectFile.cpp.

References P, and Ptr.

Referenced by importedSymbolBegin(), and importedSymbolEnd().