}
- /* 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");
}
}
" --print-segments Print program headers\n"
" --print-sections Print sections\n"
"\n"
- " --copy Copy input to output\n"
"\n");
}
{"print-header", 0, 0, 10001},
{"print-segments", 0, 0, 10002},
{"print-sections", 0, 0, 10003},
- {"copy", 0, 0, 10004},
{NULL, 0, NULL, 0}
};
case 10003:
opts->printSections = 1;
break;
- case 10004:
- opts->copy = 1;
- break;
case '?':
default:
goto USAGE;