From b4e39ac8fc849d4f99139d69a50fbc8382e24349 Mon Sep 17 00:00:00 2001 From: Shiz Date: Wed, 24 Apr 2019 02:31:13 +0200 Subject: [PATCH] rename --loader-dir to --smol-loader-dir --- README.md | 6 +++--- smold | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 512aea1..a7b0345 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Possible `smol-opt`s: ``` usage: smold [-h] [-m TARGET] [-l LIB] [-L DIR] [--smol-opt OPT] - [--loader-dir LOADER_DIR] [--nasm NASM] [--ld LD] [--cc CC] + [--smol-loader-dir DIR] [--nasm NASM] [--ld LD] [--cc CC] [--scanelf SCANELF] [--readelf READELF] [-o OUT] input [input ...] @@ -54,8 +54,8 @@ optional arguments: libraries to link against -L DIR, --libdir DIR directories to search libraries in --smol-opt OPT optimization flags for smol - --loader-dir LOADER_DIR - path to loader files + --smol-loader-dir DIR + path to smol loader files --nasm NASM which nasm binary to use --ld LD which ld binary to use --cc CC which cc binary to use diff --git a/smold b/smold index d75c566..8e4f180 100755 --- a/smold +++ b/smold @@ -24,8 +24,9 @@ def main(): parser.add_argument('--smol-opt', metavar='OPT', default=['use_interp'], action='append', help='optimization flags for smol') - parser.add_argument('--loader-dir', default=path.join(path.dirname(__file__), 'ldr'), - help='path to loader files') + parser.add_argument('--smol-loader-dir', metavar='DIR', + default=path.join(path.dirname(__file__), 'ldr'), help='path to smol loader files') + parser.add_argument('--nasm', default=os.getenv('NASM') or shutil.which('nasm'), help='which nasm binary to use') parser.add_argument('--ld', default=os.getenv('LD') or shutil.which('ld'), @@ -91,8 +92,8 @@ def main(): output_table(arch, symbols, table) table.flush() try: - subprocess.check_call([args.nasm] + as_args + ['-I', args.loader_dir + '/', '-f', 'elf{}'.format(bits), table.name, '-o', tableobj.name]) - subprocess.check_call([args.ld, '-T', os.path.join(args.loader_dir, 'link.ld'), '--oformat=binary', '-o', args.output, tableobj.name] + ld_args + args.input) + subprocess.check_call([args.nasm] + as_args + ['-I', args.smol_loader_dir + '/', '-f', 'elf{}'.format(bits), table.name, '-o', tableobj.name]) + subprocess.check_call([args.ld, '-T', os.path.join(args.smol_loader_dir, 'link.ld'), '--oformat=binary', '-o', args.output, tableobj.name] + ld_args + args.input) except subprocess.CalledProcessError: sys.exit(1)