binary/elf/elf_binaries

elf_section_type(Name:symbol, Code:unsigned)

This module defines predicates and rules specific of ELF binaries

elf_pointer_array_section_type(SectionTypeName:symbol)

ELF section types that contain an array of code pointers.

plt_section(name:symbol)

got_section(name:symbol)

plt_entry(EA:address, function:symbol)

There is a PLT jump at address ‘EA’ to external function ‘Function’.

get_pc_thunk(EA:address, Reg:register)

cie_entry(CieAddr: address, Length:unsigned, CodeAlignmentFactor:unsigned, DataAlignmentFactor:number)

A CIE can be associated to multiple FDEs and it contains information common to all of them. ‘CieAddr’ uniquely identifies the CIE.

cie_encoding(CieAddr: address, FdeEncoding:unsigned, LsdaEncoding:unsigned)

cie_encoding complements cie_entry and defines the encodings of the pointers in the FDEs and in the LSDAs associated to this CIE.

cie_personality(CieAddr:address, Personality:address, PersonalityPos:address, PersonalitySize:unsigned, Encoding:unsigned)

The personality routine associated to a CIE entry. This is the procedure that takes care of unwinding the stack and exceptions. For C++ it is typically: ‘__gxx_personality_v0’.

fde_entry(FdeAddr: address, Length:unsigned, Cie:address, Start:address, End:address, Lsda:address)

A FDE entry defines how stack unwinding is done in a region of code from ‘start’ to ‘end’. Each FDE points to a parent CIE that contains properties common to multiple FDEs. ‘FdeAddr’ and ‘Length’ determine the location of the FDE entry in the eh_frame section. A FDE entry can have ‘Lsda’ associated that contains exception handling information.

fde_pointer_locations(addr:address, startLocation:address, endLocation:address, endSize:unsigned, lsdaLocation:address, lsdaSize:unsigned)

Ancillary predicate that specifies the actual locations of the symbolic expressions in the FDE entry.

fde_instruction(FdeAddr:address, Index:unsigned, Size:unsigned, InsnAddr:address, Insn:symbol, Op1:number, Op2:number)

The instructions for stack unwinding are encoded into a dwarf program formed by a list of instructions. Each FDE corresponds to a region in the code and it has its own program. This predicate captures one instruction in that program.

  • FdeAddr is the address of the FDE and indentifies it uniquely.

  • Index identifies the instruction within the FDE uniquely.

  • Size is the size of the instruction in bytes.

  • InsnAddr is the address where the instruction is located

  • Insn is the actual opcode of the instruction

  • Op1 and Op2 are the operands of the instruction.

lsda(lsdaAddress:address, callsiteTable:address, callsiteTableEncoding:unsigned, callSiteTableLength:unsigned, typeTable:address, typeTableEncoding:unsigned, landingPadBaseAddress: address)

A LSDA defines the exception information of a region of code (typically a procedure). This is located in section ‘.gcc_except_table’. A LSDA entry contains two main elements a callsite table (see lsda_callsite) and a type table (see lsda_type_entry).

lsda_pointer_locations(lsdaAddress:address, typeTablePointerLocation:address, callsiteTablePointerLoc:address)

Complementary predicate with the locations of the various pointers in a LSDA used for symbolization.

lsda_callsite(CallSiteTable_address:address, EA_start:address, Start:address, EA_end:address, End:address, EA_landingPad:address, LandingPad:address, EA_endLandindPad:address)

The range [Start,End) corresponds to the try block and ‘LandingPad’ to the location where the catch block is located. ‘EA_start’, ‘EA_end’ and ‘EA_landingPad’ a the locations of the symbolic expressions in the .gcc_except_table that point to ‘Start’, ‘End’ and ‘LandingPad’ respectively.

lsda_type_entry(lsdaTypeTableAddress:address, index:unsigned, address:address)

The exception handling mechanism chooses which catch block catches an given exception based on the type of the exception. This is done by having references to the types which are encoded in the type table. A lsda_type_entry is an entry in the type table. The “type” is represented as a symbolic expression pointing to ‘address’.

arm_exidx_entry(FunctionStart:address, CantUnwind:unsigned)

Address where a function starts according to the ARM exidx table.

This address does not set the low bit for Thumb functions.

fde_addresses(start:address, end:address)

misaligned_fde_start(start:address, start_adjusted:address)

FDE start points can on occasion be misaligned with the actual start of the function. This has been seen on glibc restore_rt which generates code as follows:

.text .align 16 __restore_rt:

movl $15, %rax syscall

lsda_callsite_addresses(Start:address, End:address, LandingPad:address)

special_encoding(Code:unsigned, Name:symbol)