Redesign data structures, make basic reladd work.
[centaur.git] / src / main.c
index 2c6268c6cd9e5a56ae0f1aba511fa60a59f9e219..a179fcd82a0097e57a0e960d31390d917757025f 100644 (file)
@@ -38,26 +38,14 @@ int main(int argc, char **argv)
   }
 
 
-  /* Now that we have a (hopefully) sane environment, execute commands.
-   * Printing will have to be reimplemented based on the memory model.
-   */
-  if (opts.printHeader) {
-    printHeader(hIn.e);
-  }
-
-  if (opts.printSegments) {
-    printSegments(hIn.e);
-  }
-
-  if (opts.printSections) {
-    printSections(hIn.e);
-  }
-
-
+  /* Now that we have a (hopefully) sane environment, execute commands. */
   me = elfu_mFromElf(hIn.e);
   if (me) {
     closeElf(&hIn);
     printf("Model successfully loaded.\n");
+
+    elfu_mDumpElf(me);
+
     elfu_mCheck(me);
     printf("Input model checked.\n");
   } else {
@@ -71,18 +59,6 @@ int main(int argc, char **argv)
   if (!opts.fnOutput) {
     printf("No output file specified - no further operations performed.\n");
   } else {
-    if (opts.expandNobitsOffs) {
-      elfu_mExpandNobits(me, opts.expandNobitsOffs);
-    }
-
-    if (opts.insertBeforeSz) {
-      elfu_mInsertSpaceBefore(me, opts.insertBeforeOffs, opts.insertBeforeSz);
-    }
-
-    if (opts.insertAfterSz) {
-      elfu_mInsertSpaceAfter(me, opts.insertAfterOffs, opts.insertAfterSz);
-    }
-
     if (opts.fnReladd) {
       ELFHandles hRel = { 0 };
       ElfuElf *mrel = NULL;
@@ -102,12 +78,12 @@ int main(int argc, char **argv)
           elfu_mReladd(me, mrel);
         }
       }
-
     }
 
     elfu_mCheck(me);
     printf("Output model checked.\n");
 
+    elfu_mDumpElf(me);
 
     openElf(&hOut, opts.fnOutput, ELF_C_WRITE);
     if (!hOut.e) {