Initial work on copying an ELF file
[centaur.git] / src / copy / sections.c
diff --git a/src/copy/sections.c b/src/copy/sections.c
new file mode 100644 (file)
index 0000000..046b590
--- /dev/null
@@ -0,0 +1,25 @@
+#include <stdio.h>
+
+#include <libelf.h>
+#include <gelf.h>
+
+#include <libelfu/libelfu.h>
+
+
+
+void elfu_copySection(Elf *eo, Elf_Scn *scn);
+
+
+
+void elfu_copySections(Elf *eo, Elf *ei)
+{
+  Elf_Scn *scn;
+
+  scn = elf_getscn(ei, 1);
+
+  while (scn) {
+    elfu_copySection(eo, scn);
+
+    scn = elf_nextscn(ei, scn);
+  }
+}