contributed by <kevin550029
>
$ ./as_exec -h
Usage: as_exec [-w] [-x] [-o <out_file>] <in_file>
-w Assemble <in_file> and write to an ELF file, see -o below
-o if -w is specifed, <out_file> is used to store the object code
-x Load <in_file> and execute it
$ ./as_exec tests/hello.s
Hello World
tests/hello.o
$ ./as_exec -w tests/hello.s
$ ./as_exec -o tests/hello.o -w tests/hello.s
$ ./as_exec -x tests/hello.o
Hello World
$ objdump -x tests/hello.o
tests/hello.o: file format elf64-little
tests/hello.o
architecture: UNKNOWN!, flags 0x00000102:
EXEC_P, D_PAGED
start address 0x0000000000000000
Program Header:
0x464c457f off 0x0000000000000000 vaddr 0x0000000100000002 paddr 0x0000000000000000 align 2**54
filesz 0x0000000000000000 memsz 0x0000000000000000 flags -w- 10100
INTERP off 0x0000000000000001 vaddr 0x00000000000000e8 paddr 0x0000000000000000 align 2**5
filesz 0x0000000000000000 memsz 0x0000000000000018 flags ---
0x20 off 0x0000000000000001 vaddr 0x0000000000000100 paddr 0x0000000000000000 align 2**5
filesz 0x0000000000000000 memsz 0x000000000000001c flags ---
Sections:
Idx Name Size VMA LMA File off Algn
SYMBOL TABLE:
no symbols
專案中包含幾個部份 driver, as, elf, opcode 和 vm