binary/elf/symbolization

ELF-specific rules and relations for symbolization

reg_has_got(EA:address, Reg:register)

Value of register ‘Reg’ at address ‘EA’ is a GOT-relative base reference.

got_reference_pointer(EA:address)

Address ‘EA’ is used as a GOT-relative base reference. ‘EA’ is the beginning of either the .got or .got.plt section.

got_relative_operand(EA:address, Index:operand_index, Dest:address)

Operand instruction at ‘EA’ at index ‘Index’ is a GOT-relative reference to an address ‘Dest’.

start_function(ea:address)

do_infer_main_function()

Decide whether the main function should be inferred.

WARNING: Predicate not present in compiled Datalog program (Dead Code)

inferred_main_dispatch(EA:address)

Locate where main() is dispatched (i.e., where __libc_start_main is called.)

inferred_main_in_reg(EA:address, Reg:register)

The location and register where the address of main is loaded.

inferred_main_function(Main_location:address)

Infer the location of the main function.

reloc_type_relpc(Type:symbol)

Type of relocation relevant to pc-relative attribute

reloc_type_with_name(Type:symbol)

Type of relocation possibly with non-empty Symbol name

reloc_type_nameless(Type:symbol)

Type of relocation possibly with empty Symbol name

copy_relocated_symbol(EA:address, Name:symbol)

Collect all the symbols whose address, size and type are the same as the symbol with COPY relocation.

best_ifunc_symbol(EA:address, SymbolName:symbol)

Best GNU_IFUNC symbol for plt entries. Uses ifunc_symbol_score to deterministically select a single ifunc symbol for each EA.

ifunc_symbol_score(EA:address, SymbolName:symbol, Score:unsigned)

Provide a score to GNU_IFUNC symbols based on scope, visibility, and their table index.

ifunc_scope_score(Scope:symbol, Score:unsigned)

Auxiliary predicate to define ifunc_symbol_score Prefer symbols with LOCAL over GLOBAL, and with GLOBAl over anything else (WEAK).