summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/options.h1
-rw-r--r--src/main.c26
-rw-r--r--src/options.c5
3 files changed, 10 insertions, 22 deletions
diff --git a/include/options.h b/include/options.h
index c43c811..f39f01e 100644
--- a/include/options.h
+++ b/include/options.h
@@ -8,7 +8,6 @@ typedef struct {
int printHeader;
int printSegments;
int printSections;
- int copy;
} CLIOpts;
diff --git a/src/main.c b/src/main.c
index bd6d294..68becad 100644
--- a/src/main.c
+++ b/src/main.c
@@ -59,26 +59,20 @@ int main(int argc, char **argv)
}
- /* Copy the input ELF to the output file */
- if (!opts.fnOutput) {
- if (opts.copy) {
- fprintf(stderr, "Error: Missing output file name for requested operation.\n");
- }
- } else {
- if (opts.copy) {
- ElfuElf *me;
+ /* Copy the input ELF to the output file if the latter is specified */
+ if (opts.fnOutput) {
+ ElfuElf *me;
- me = elfu_modelFromElf(hIn.e);
+ me = elfu_modelFromElf(hIn.e);
- if (me) {
- printf("Model successfully loaded.\n");
+ if (me) {
+ printf("Model successfully loaded.\n");
- elfu_modelToElf(me, hOut.e);
+ elfu_modelToElf(me, hOut.e);
- printf("Model converted to ELF, ready to be written.\n");
- } else {
- printf("Failed to load model.\n");
- }
+ printf("Model converted to ELF, ready to be written.\n");
+ } else {
+ printf("Failed to load model.\n");
}
}
diff --git a/src/options.c b/src/options.c
index 3975bad..1b258fe 100644
--- a/src/options.c
+++ b/src/options.c
@@ -18,7 +18,6 @@ static void printUsage(char *progname)
" --print-segments Print program headers\n"
" --print-sections Print sections\n"
"\n"
- " --copy Copy input to output\n"
"\n");
}
@@ -36,7 +35,6 @@ void parseOptions(CLIOpts *opts, int argc, char **argv)
{"print-header", 0, 0, 10001},
{"print-segments", 0, 0, 10002},
{"print-sections", 0, 0, 10003},
- {"copy", 0, 0, 10004},
{NULL, 0, NULL, 0}
};
@@ -58,9 +56,6 @@ void parseOptions(CLIOpts *opts, int argc, char **argv)
case 10003:
opts->printSections = 1;
break;
- case 10004:
- opts->copy = 1;
- break;
case '?':
default:
goto USAGE;