-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsignature.fbs
More file actions
60 lines (49 loc) · 1.35 KB
/
signature.fbs
File metadata and controls
60 lines (49 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
include "type.fbs";
include "symbol.fbs";
namespace SigBin;
struct BasicBlockGUID {
value:[ubyte:16];
}
struct ConstraintGUID {
value:[ubyte:16];
}
struct FunctionGUID {
value:[ubyte:16];
}
table BasicBlock {
guid:BasicBlockGUID (required);
// TODO: successors:[BasicBlockGUID];
// TODO: predecessors:[BasicBlockGUID];
}
table Constraint {
guid:ConstraintGUID (required);
// The byte offset from the start of the constrained function.
// A negative number would indicate that the constraint occurs before the start of the function.
offset:long;
}
table FunctionComment {
offset:int64;
text:string (required);
}
// TODO: This is extremely naive, cant handle stack slot re-use.
table FunctionVariable {
offset:int64;
name:string;
location:TypeBin.LocationClass (required);
type:TypeBin.Type;
// TODO: Possible value set. (to assert a value)
}
table Function {
// TODO: Add architecture, this is required to support multi-arch binaries...
// TODO: Make guid a key when https://github.com/google/flatbuffers/issues/8603 is fixed.
guid:FunctionGUID (required);
symbol:SymbolBin.Symbol;
type:TypeBin.Type;
constraints:[Constraint];
comments:[FunctionComment];
variables:[FunctionVariable];
}
table SignatureChunk {
functions:[Function] (required);
}
root_type SignatureChunk;