gtirb.symbolicexpression module

class gtirb.symbolicexpression.SymAddrAddr(scale, offset, symbol1, symbol2, attributes={})[source]

Bases: SymbolicExpression

Represents a symbolic expression of the form “(Sym1 - Sym2) / Scale + Offset”.

Variables:
  • ~.scale – Constant scale factor.

  • ~.offset – Constant offset.

  • ~.symbol1 – Symbol representing the base address.

  • ~.symbol2 – Symbol to subtract from symbol1.

__eq__(other)[source]

Return self==value.

Return type:

bool

__hash__()[source]

Return hash(self).

Return type:

int

__init__(scale, offset, symbol1, symbol2, attributes={})[source]
Parameters:
deep_eq(other)[source]
Return type:

bool

property symbols: Iterable[Symbol]

Get all the symbols involved with this symbolic expression, regardless of role.

class gtirb.symbolicexpression.SymAddrConst(offset, symbol, attributes={})[source]

Bases: SymbolicExpression

Represents a symbolic expression of the form “Sym + Offset”.

Variables:
  • ~.offset – Constant offset.

  • ~.symbol – Symbol representing an address.

__eq__(other)[source]

Return self==value.

Return type:

bool

__hash__()[source]

Return hash(self).

Return type:

int

__init__(offset, symbol, attributes={})[source]
Parameters:
deep_eq(other)[source]
Return type:

bool

property symbols: Iterable[Symbol]

Get all the symbols involved with this symbolic expression, regardless of role.

class gtirb.symbolicexpression.SymbolicExpression(attributes={})[source]

Bases: object

Base class of symbolic expression types.

class Attribute(value)[source]

Bases: Enum

Attributes representing a known property of a symbolic expression. See https://grammatech.github.io/gtirb/md__symbolic_expression.html

ABS = 2015
CALL = 22
DISP = 3003
DTPMOD = 19
DTPOFF = 17
DTPREL = 16
G0 = 2001
G1 = 2002
G2 = 2003
G3 = 2004
GOT = 0
GOTNTPOFF = 1000
GOTOFF = 2
GOTPC = 1
GOTREL = 3
GPREL = 3002
H = 4000
HA = 4002
HI = 24
HI12 = 2010
HI16 = 3000
HI21 = 2011
HIGH = 4003
HIGHA = 4004
HIGHER = 25
HIGHERA = 4005
HIGHEST = 26
HIGHESTA = 4006
INDNTPOFF = 1001
L = 4001
LO = 23
LO12 = 2007
LO14 = 2009
LO15 = 2008
LO16 = 3001
LOWER16 = 2006
NC = 2014
NOTOC = 4009
NTPOFF = 18
OFST = 3004
PAGE = 20
PAGEOFF = 21
PCREL = 6
PG = 2013
PLT = 4
PLTOFF = 5
PREL = 2016
PREL31 = 2017
S = 2012
SBREL = 2020
SECREL = 7
TARGET1 = 2018
TARGET2 = 2019
TLS = 8
TLSCALL = 12
TLSDESC = 13
TLSGD = 9
TLSLD = 10
TLSLDM = 11
TLSLDO = 2021
TOC = 4008
TOCBASE = 4007
TPOFF = 15
TPREL = 14
UPPER16 = 2005
__int__()[source]
Return type:

int

__init__(attributes={})[source]
deep_eq(other)[source]
Return type:

bool

property symbols: Iterable[Symbol]

Get all the symbols involved with this symbolic expression, regardless of role.