summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-03-28 11:05:54 +0100
committerRoland Reichwein <mail@reichwein.it>2020-03-28 11:05:54 +0100
commit7fdcbd50a35c17e8ea7d88fbcaa3080ee44351b3 (patch)
treec105e7b01c5e1a3c467a5c4de134bf716e19b0b9
parent02d391df5cb7a9cefcd6fec62c4392a8557b5dc8 (diff)
Prepare ELF file format implementation
-rw-r--r--Makefile2
-rw-r--r--elf.cpp1
-rw-r--r--elf.h22
-rw-r--r--test-elf.cpp34
4 files changed, 59 insertions, 0 deletions
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 <boost/algorithm/string.hpp>
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+#include <algorithm>
+#include <cctype>
+#include <deque>
+#include <map>
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
+
+using namespace std::string_literals;
+
+class ElfTest: public ::testing::Test
+{
+protected:
+ ElfTest() {
+ //debug = true;
+ }
+ ~ElfTest() {
+ }
+};
+
+TEST_F(ElfTest, read) {
+}
+
+TEST_F(ElfTest, write) {
+}