Use C++ 14 alignas(), init some struct fields just because of good practice.
This commit is contained in:
+31
-31
@@ -36,32 +36,32 @@ class ElfLinker : private noncopyable {
|
||||
friend class Packer;
|
||||
|
||||
public:
|
||||
const N_BELE_RTP::AbstractPolicy *bele; // target endianness
|
||||
const N_BELE_RTP::AbstractPolicy *bele = nullptr; // target endianness
|
||||
protected:
|
||||
struct Section;
|
||||
struct Symbol;
|
||||
struct Relocation;
|
||||
|
||||
upx_byte *input;
|
||||
int inputlen;
|
||||
upx_byte *output;
|
||||
int outputlen;
|
||||
upx_byte *input = nullptr;
|
||||
int inputlen = 0;
|
||||
upx_byte *output = nullptr;
|
||||
int outputlen = 0;
|
||||
|
||||
Section *head;
|
||||
Section *tail;
|
||||
Section *head = nullptr;
|
||||
Section *tail = nullptr;
|
||||
|
||||
Section **sections;
|
||||
Symbol **symbols;
|
||||
Relocation **relocations;
|
||||
Section **sections = nullptr;
|
||||
Symbol **symbols = nullptr;
|
||||
Relocation **relocations = nullptr;
|
||||
|
||||
unsigned nsections;
|
||||
unsigned nsections_capacity;
|
||||
unsigned nsymbols;
|
||||
unsigned nsymbols_capacity;
|
||||
unsigned nrelocations;
|
||||
unsigned nrelocations_capacity;
|
||||
unsigned nsections = 0;
|
||||
unsigned nsections_capacity = 0;
|
||||
unsigned nsymbols = 0;
|
||||
unsigned nsymbols_capacity = 0;
|
||||
unsigned nrelocations = 0;
|
||||
unsigned nrelocations_capacity = 0;
|
||||
|
||||
bool reloc_done;
|
||||
bool reloc_done = false;
|
||||
|
||||
protected:
|
||||
void preprocessSections(char *start, char *end);
|
||||
@@ -116,32 +116,32 @@ protected:
|
||||
};
|
||||
|
||||
struct ElfLinker::Section : private noncopyable {
|
||||
char *name;
|
||||
void *input;
|
||||
upx_byte *output;
|
||||
unsigned size;
|
||||
upx_uint64_t offset;
|
||||
unsigned p2align; // log2
|
||||
Section *next;
|
||||
char *name = nullptr;
|
||||
void *input = nullptr;
|
||||
upx_byte *output = nullptr;
|
||||
unsigned size = 0;
|
||||
upx_uint64_t offset = 0;
|
||||
unsigned p2align = 0; // log2
|
||||
Section *next = nullptr;
|
||||
|
||||
Section(const char *n, const void *i, unsigned s, unsigned a = 0);
|
||||
~Section();
|
||||
};
|
||||
|
||||
struct ElfLinker::Symbol : private noncopyable {
|
||||
char *name;
|
||||
Section *section;
|
||||
upx_uint64_t offset;
|
||||
char *name = nullptr;
|
||||
Section *section = nullptr;
|
||||
upx_uint64_t offset = 0;
|
||||
|
||||
Symbol(const char *n, Section *s, upx_uint64_t o);
|
||||
~Symbol();
|
||||
};
|
||||
|
||||
struct ElfLinker::Relocation : private noncopyable {
|
||||
const Section *section;
|
||||
unsigned offset;
|
||||
const char *type;
|
||||
const Symbol *value;
|
||||
const Section *section = nullptr;
|
||||
unsigned offset = 0;
|
||||
const char *type = nullptr;
|
||||
const Symbol *value = nullptr;
|
||||
upx_uint64_t add; // used in .rela relocations
|
||||
|
||||
Relocation(const Section *s, unsigned o, const char *t, const Symbol *v, upx_uint64_t a);
|
||||
|
||||
Reference in New Issue
Block a user