From 7fdcbd50a35c17e8ea7d88fbcaa3080ee44351b3 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 28 Mar 2020 11:05:54 +0100 Subject: Prepare ELF file format implementation --- Makefile | 2 ++ elf.cpp | 1 + elf.h | 22 ++++++++++++++++++++++ test-elf.cpp | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 elf.cpp create mode 100644 elf.h create mode 100644 test-elf.cpp diff --git a/Makefile b/Makefile index 23b7457..aff378e 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,8 @@ SRC=\ test-lexer.cpp \ minicc.cpp \ test-minicc.cpp \ + elf.cpp \ + test-elf.cpp \ googletest/src/gtest-all.cpp \ googlemock/src/gmock-all.cpp diff --git a/elf.cpp b/elf.cpp new file mode 100644 index 0000000..c94f2f5 --- /dev/null +++ b/elf.cpp @@ -0,0 +1 @@ +#include "elf.h" diff --git a/elf.h b/elf.h new file mode 100644 index 0000000..0b47fb6 --- /dev/null +++ b/elf.h @@ -0,0 +1,22 @@ +#pragma once + +#pragma pack(push, 1) + +namespace Elf { + +// ELF 64 bit only + +struct FileHeader +{ +}; + +struct ProgramHeader +{ +}; + +struct SectionHeader +{ +}; + +} +#pragma pack(pop) diff --git a/test-elf.cpp b/test-elf.cpp new file mode 100644 index 0000000..d1aebd3 --- /dev/null +++ b/test-elf.cpp @@ -0,0 +1,34 @@ +#include "elf.h" +#include "minicc.h" + +#include + +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std::string_literals; + +class ElfTest: public ::testing::Test +{ +protected: + ElfTest() { + //debug = true; + } + ~ElfTest() { + } +}; + +TEST_F(ElfTest, read) { +} + +TEST_F(ElfTest, write) { +} -- cgit v1.2.3