From b7e53bf9d091874d8028b37f6e4940b504cc9234 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 29 Mar 2020 16:14:55 +0200 Subject: Code and data segment --- elf.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'elf.h') diff --git a/elf.h b/elf.h index abcbca0..260f86f 100644 --- a/elf.h +++ b/elf.h @@ -42,10 +42,10 @@ struct FileHeader uint32_t e_flags{}; uint16_t e_ehsize{0x40}; // size of this header uint16_t e_phentsize{0x38}; // size of program header - uint16_t e_phnum{1}; // 1 program header + uint16_t e_phnum{2}; // program headers: .text, .data uint16_t e_shentsize{0x40}; // size of section header - uint16_t e_shnum{3}; // number of section headers - uint16_t e_shstrndx{2}; // 1st section header contains section names + uint16_t e_shnum{4}; // number of section headers + uint16_t e_shstrndx{3}; // 1st section header contains section names }; // Segment @@ -76,7 +76,7 @@ struct SectionHeader }; #pragma pack(pop) -void Write(const std::filesystem::path& path, const std::vector&); +void Write(const std::filesystem::path& path, const std::vector& code, const std::vector& data); std::vector Read(const std::filesystem::path& path); } -- cgit v1.2.3