RuntimeDyld invariant checker for verifying that RuntimeDyld has correctly applied relocations.

Synopsis

Declared in <llvm/ExecutionEngine/RuntimeDyldChecker.h>

class RuntimeDyldChecker;

Description

The RuntimeDyldChecker class evaluates expressions against an attached RuntimeDyld instance to verify that relocations have been applied correctly.

The expression language supports basic pointer arithmetic and bit‐masking, and has limited disassembler integration for accessing instruction operands and the next PC (program counter) address for each instruction.

The language syntax is:

check = expr '=' expr

expr = binary_expr | sliceable_expr

sliceable_expr = '*{' number '}' load_addr_expr [slice] | '(' expr ')' [slice] | ident_expr [slice] | number [slice]

slice = '[' high‐bit‐index ':' low‐bit‐index ']'

load_addr_expr = symbol | '(' symbol '+' number ')' | '(' symbol '‐' number ')'

ident_expr = 'decode_operand' '(' symbol ',' operand‐index ')' | 'next_pc' '(' symbol ')' | 'stub_addr' '(' stub‐container‐name ',' symbol ')' | 'got_addr' '(' stub‐container‐name ',' symbol ')' | 'section_addr' '(' stub‐container‐name ',' symbol ')' | symbol

binary_expr = expr '+' expr | expr '‐' expr | expr '&' expr | expr '|' expr | expr '<<' expr | expr '>>' expr

Types

Name

Description

MemoryRegionInfo

Content and target address for a symbol or section region.

Type Aliases

Name

Description

GetGOTInfoFunction

Callback that returns memory‐region info for a GOT entry.

GetSectionInfoFunction

Callback that returns memory‐region info for a named section.

GetStubInfoFunction

Callback that returns memory‐region info for a stub.

GetSymbolInfoFunction

Callback that returns memory‐region info for a named symbol.

IsSymbolValidFunction

Callback that reports whether a named symbol is valid.

Member Functions

Name

Description

RuntimeDyldChecker [constructor]

Construct a RuntimeDyldChecker with the given lookup callbacks.

~RuntimeDyldChecker [destructor]

Destroy the RuntimeDyldChecker and its implementation.

check

Check a single expression against the attached RuntimeDyld instance.

checkAllRulesInBuffer

Evaluate all check‐rule lines in a memory buffer.

getSectionAddr

Returns the address of the requested section (or an error message in the second element of the pair if the address cannot be found).

getSectionLoadAddress

If there is a section at the given local address, return its load address, otherwise return std::nullopt.

Created with MrDocs