-
Notifications
You must be signed in to change notification settings - Fork 2
/
elf.h
60 lines (45 loc) · 1.26 KB
/
elf.h
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
#ifndef PKGDEPDB_ELF_H__
#define PKGDEPDB_ELF_H__
namespace pkgdepdb {
struct Elf {
size_t refcount_ = 0;
// path + name separated
string dirname_;
string basename_;
// classification:
unsigned char ei_class_; // 32/64 bit
unsigned char ei_data_; // endianess
unsigned char ei_osabi_; // freebsd/linux/...
// requirements:
bool rpath_set_ = false;
bool runpath_set_ = false;
bool interpreter_set_ = false;
string rpath_;
string runpath_;
string interpreter_;
vec<string> needed_;
// non-serialized {
// not serialized INSIDE the object, but as part of the DB
// (for compatibility with older database dumps)
ObjectSet req_found_;
StringSet req_missing_;
// NOT SERIALIZED:
struct {
size_t id;
} json_;
Package *owner_;
// }
Elf();
Elf(const Elf& cp);
static Elf* Open(const char* data, size_t size, bool *err, const char *name,
const Config&);
// utility functions while loading
void SolvePaths(const string& origin);
bool CanUse(const Elf &other, bool strict) const;
// utility functions for printing stuff
const char *classString() const;
const char *dataString() const;
const char *osabiString() const;
};
} // ::pkgdepdb
#endif