Browse Source

rename --loader-dir to --smol-loader-dir

reorganize
Shiz 2 years ago
parent
commit
b4e39ac8fc
2 changed files with 8 additions and 7 deletions
  1. +3
    -3
      README.md
  2. +5
    -4
      smold

+ 3
- 3
README.md View File

@ -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


+ 5
- 4
smold View File

@ -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)


Loading…
Cancel
Save