diff options
Diffstat (limited to 'src/driver/pe_amain.c')
-rw-r--r-- | src/driver/pe_amain.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/driver/pe_amain.c b/src/driver/pe_amain.c index fb68e30..a766dba 100644 --- a/src/driver/pe_amain.c +++ b/src/driver/pe_amain.c @@ -10,12 +10,11 @@ #include <perk/perk_output.h> #include "perk_driver_impl.h" #include "perk_dprintf_impl.h" +#include "perk_ar_impl.h" #ifndef PERK_DRIVER_FLAGS #define PERK_DRIVER_FLAGS PERK_DRIVER_VERBOSITY_ERRORS \ | PERK_DRIVER_VERBOSITY_UTILITY \ - | PERK_DRIVER_AR_STRICT_PE \ - | PERK_DRIVER_AR_STRICT_PE_ARCH \ | PERK_DRIVER_AR_OBJECT_VECTOR #endif @@ -65,6 +64,10 @@ int pe_main(char ** argv, char ** envp, const struct pe_fd_ctx * fdctx) uint64_t flags; struct pe_driver_ctx * dctx; const char ** unit; + const char * posname; + const char * arname; + const char ** arfiles; + uint64_t arflags; flags = PERK_DRIVER_FLAGS; fdout = fdctx ? fdctx->fdout : STDOUT_FILENO; @@ -85,7 +88,20 @@ int pe_main(char ** argv, char ** envp, const struct pe_fd_ctx * fdctx) break; case PERK_CMD_AR: - pe_cmd_ar(dctx,0,0,0,0); + arflags = dctx->cctx->drvflags; + + if (arflags & AR_POSNAME_MASK) { + posname = dctx->units[0]; + arname = posname ? dctx->units[1] : 0; + arfiles = arname ? &dctx->units[2] : 0; + } else { + posname = 0; + arname = dctx->units[0]; + arfiles = arname ? &dctx->units[1] : 0; + } + + pe_cmd_ar(dctx,arflags,posname,arname,arfiles); + break; default: |