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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
use super::prelude::*;
#[derive(Debug)]
pub enum LLVMOpaqueSectionIterator {}
pub type LLVMSectionIteratorRef = *mut LLVMOpaqueSectionIterator;
#[derive(Debug)]
pub enum LLVMOpaqueSymbolIterator {}
pub type LLVMSymbolIteratorRef = *mut LLVMOpaqueSymbolIterator;
#[derive(Debug)]
pub enum LLVMOpaqueRelocationIterator {}
pub type LLVMRelocationIteratorRef = *mut LLVMOpaqueRelocationIterator;
#[derive(Debug)]
pub enum LLVMOpaqueBinary {}
pub type LLVMBinaryRef = *mut LLVMOpaqueBinary;
#[repr(C)]
#[derive(Debug)]
pub enum LLVMBinaryType {
LLVMBinaryTypeArchive,
LLVMBinaryTypeMachOUniversalBinary,
LLVMBinaryTypeCOFFImportFile,
LLVMBinaryTypeIR,
LLVMBinaryTypeWinRes,
LLVMBinaryTypeCOFF,
LLVMBinaryTypeELF32L,
LLVMBinaryTypeELF32B,
LLVMBinaryTypeELF64L,
LLVMBinaryTypeELF64B,
LLVMBinaryTypeMachO32L,
LLVMBinaryTypeMachO32B,
LLVMBinaryTypeMachO64L,
LLVMBinaryTypeMachO64B,
LLVMBinaryTypeWasm,
}
#[deprecated(since = "LLVM 9.0")]
pub enum LLVMOpaqueObjectFile {}
#[allow(deprecated)]
#[deprecated(since = "LLVM 9.0")]
pub type LLVMObjectFileRef = *mut LLVMOpaqueObjectFile;
extern "C" {
pub fn LLVMCreateBinary(
MemBuf: LLVMMemoryBufferRef,
Context: LLVMContextRef,
ErrorMessage: *mut *mut ::libc::c_char,
) -> LLVMBinaryRef;
pub fn LLVMDisposeBinary(BR: LLVMBinaryRef);
pub fn LLVMBinaryCopyMemoryBuffer(BR: LLVMBinaryRef) -> LLVMMemoryBufferRef;
pub fn LLVMBinaryGetType(BR: LLVMBinaryRef) -> LLVMBinaryType;
pub fn LLVMMachOUniversalBinaryCopyObjectForArch(
BR: LLVMBinaryRef,
Arch: *const ::libc::c_char,
ArchLen: ::libc::size_t,
ErrorMessage: *mut *mut ::libc::c_char,
) -> LLVMBinaryRef;
pub fn LLVMObjectFileCopySectionIterator(BR: LLVMBinaryRef) -> LLVMSectionIteratorRef;
pub fn LLVMObjectFileIsSectionIteratorAtEnd(
BR: LLVMBinaryRef,
SI: LLVMSectionIteratorRef,
) -> LLVMBool;
pub fn LLVMObjectFileCopySymbolIterator(BR: LLVMBinaryRef) -> LLVMSymbolIteratorRef;
pub fn LLVMObjectFileIsSymbolIteratorAtEnd(
BR: LLVMBinaryRef,
SI: LLVMSymbolIteratorRef,
) -> LLVMBool;
pub fn LLVMDisposeSectionIterator(SI: LLVMSectionIteratorRef);
pub fn LLVMMoveToNextSection(SI: LLVMSectionIteratorRef);
pub fn LLVMMoveToContainingSection(Sect: LLVMSectionIteratorRef, Sym: LLVMSymbolIteratorRef);
pub fn LLVMDisposeSymbolIterator(SI: LLVMSymbolIteratorRef);
pub fn LLVMMoveToNextSymbol(SI: LLVMSymbolIteratorRef);
pub fn LLVMGetSectionName(SI: LLVMSectionIteratorRef) -> *const ::libc::c_char;
pub fn LLVMGetSectionSize(SI: LLVMSectionIteratorRef) -> u64;
pub fn LLVMGetSectionContents(SI: LLVMSectionIteratorRef) -> *const ::libc::c_char;
pub fn LLVMGetSectionAddress(SI: LLVMSectionIteratorRef) -> u64;
pub fn LLVMGetSectionContainsSymbol(
SI: LLVMSectionIteratorRef,
Sym: LLVMSymbolIteratorRef,
) -> LLVMBool;
pub fn LLVMGetRelocations(Section: LLVMSectionIteratorRef) -> LLVMRelocationIteratorRef;
pub fn LLVMDisposeRelocationIterator(RI: LLVMRelocationIteratorRef);
pub fn LLVMIsRelocationIteratorAtEnd(
Section: LLVMSectionIteratorRef,
RI: LLVMRelocationIteratorRef,
) -> LLVMBool;
pub fn LLVMMoveToNextRelocation(RI: LLVMRelocationIteratorRef);
pub fn LLVMGetSymbolName(SI: LLVMSymbolIteratorRef) -> *const ::libc::c_char;
pub fn LLVMGetSymbolAddress(SI: LLVMSymbolIteratorRef) -> u64;
pub fn LLVMGetSymbolSize(SI: LLVMSymbolIteratorRef) -> u64;
pub fn LLVMGetRelocationOffset(RI: LLVMRelocationIteratorRef) -> u64;
pub fn LLVMGetRelocationSymbol(RI: LLVMRelocationIteratorRef) -> LLVMSymbolIteratorRef;
pub fn LLVMGetRelocationType(RI: LLVMRelocationIteratorRef) -> u64;
pub fn LLVMGetRelocationTypeName(RI: LLVMRelocationIteratorRef) -> *const ::libc::c_char;
pub fn LLVMGetRelocationValueString(RI: LLVMRelocationIteratorRef) -> *const ::libc::c_char;
#[allow(deprecated)]
#[deprecated(since = "LLVM 9.0", note = "Use LLVMCreateBinary instead")]
pub fn LLVMCreateObjectFile(MemBuf: LLVMMemoryBufferRef) -> LLVMObjectFileRef;
#[allow(deprecated)]
#[deprecated(since = "LLVM 9.0", note = "Use LLVMDisposeBinary instead")]
pub fn LLVMDisposeObjectFile(ObjectFile: LLVMObjectFileRef);
#[allow(deprecated)]
#[deprecated(
since = "LLVM 9.0",
note = "Use LLVMObjectFileCopySectionIterator instead"
)]
pub fn LLVMGetSections(ObjectFile: LLVMObjectFileRef) -> LLVMSectionIteratorRef;
#[allow(deprecated)]
#[deprecated(
since = "LLVM 9.0",
note = "Use LLVMObjectFileIsSectionIteratorAtEnd instead"
)]
pub fn LLVMIsSectionIteratorAtEnd(
ObjectFile: LLVMObjectFileRef,
SI: LLVMSectionIteratorRef,
) -> LLVMBool;
#[allow(deprecated)]
#[deprecated(
since = "LLVM 9.0",
note = "Use LLVMObjectFileCopySymbolIterator instead"
)]
pub fn LLVMGetSymbols(ObjectFile: LLVMObjectFileRef) -> LLVMSymbolIteratorRef;
#[allow(deprecated)]
#[deprecated(
since = "LLVM 9.0",
note = "Use LLVMObjectFileIsSymbolIteratorAtEnd instead"
)]
pub fn LLVMIsSymbolIteratorAtEnd(
ObjectFile: LLVMObjectFileRef,
SI: LLVMSymbolIteratorRef,
) -> LLVMBool;
}