1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-23 02:49:12 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-10-25 12:10:21 +09:00
parent 3486f94eb5
commit 64e85738ba
2 changed files with 5 additions and 7 deletions

6
mold.h
View File

@ -259,7 +259,11 @@ public:
// Program header
class OutputPhdr : public OutputChunk {
public:
void copy_to(uint8_t *buf) override;
void copy_to(uint8_t *buf) override {
auto *p = (ELF64LE::Phdr *)(buf + offset);
for (Phdr &ent : entries)
*p++ = ent.phdr;
}
uint64_t get_size() const override {
return entries.size() * sizeof(ELF64LE::Phdr);

View File

@ -33,12 +33,6 @@ void OutputEhdr::relocate(uint8_t *buf) {
hdr->e_shstrndx = out::shstrtab->index;
}
void OutputPhdr::copy_to(uint8_t *buf) {
auto *p = (ELF64LE::Phdr *)buf;
for (Phdr &ent : entries)
*p++ = ent.phdr;
}
static uint32_t to_phdr_flags(uint64_t sh_flags) {
uint32_t ret = PF_R;
if (sh_flags & SHF_WRITE)