1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-06 01:28:12 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-10-20 15:44:26 +09:00
parent 6550494926
commit ac01c06170

23
mold.h
View File

@ -173,6 +173,8 @@ public:
StringRef name;
OutputSection *output_section;
int64_t offset = -1;
uint64_t flags;
uint32_t type;
uint32_t alignment = 1;
};
@ -201,6 +203,27 @@ public:
uint64_t get_size() const override { return 0; }
};
class GenericSection : public InputChunk {
public:
GenericSection(StringRef name, ArrayRef<uint8_t> data,
uint64_t flags, uint32_t type, uint32_t alignment)
: data(data) {
this->name = name;
this->flags = flags;
this->type = type;
this->alignment = alignment;
}
void copy_to(uint8_t *buf) override {
memcpy(buf + offset, &data[0], data.size());
}
uint64_t get_size() const override { return data.size(); }
private:
ArrayRef<uint8_t> data;
};
std::string toString(InputSection *isec);
inline uint64_t align_to(uint64_t val, uint64_t align) {