Closed pakls closed 7 years ago
To clarify the width of register file, I would suggest to restrict all registers to 32-bit by default.
Thank @pakls for implementing ELF support, which enables this VM embeddable to existing applications.
I just try to assemble a simple program as following instructions:
$ ./as_exec -w tests/hello.s
$ ./as_exec -x tests/hello.o
Hello World
It works as I expected! However, it looks weird when I check its information via file:
$ file tests/hello.o
tests/hello.o: ELF 64-bit LSB executable, no machine, version 1 (SYSV), statically linked, interpreter *empty*, corrupted section header size
Can we add extra information while generating ELF files?
In addition, we shall update README.md
to reflect recent changes.
Refer to pull request #37 .
Missed the comments here: I would suggest to restrict all registers to 32-bit by default.
For the register width issue, current source code uses 32-bit when compiled by 32-bit compiler. With 64-bit GCC, it becomes 64-bit but can be overridden by -m32 option.
'file' or 'objdump' should be able to show 32/64-bit successfully. Per test, they both work, too.
The message "corrupted section header size" is due to the tool incorrectly considers section size 0 as error.
In our case, '0' is simply not implemented. The implementation is not added because it is not needed yet. It would be needed when we plan to support section. Currently, segments are enough as the vm internal structure is fixed to 3 segments and with fixed purpose.
"no machine" is correct as the full-stack-vm is not recognized by the tool. So I filled no-machine to ELF file header for now.
I will update README.md later.
Related: #32 (new name for ISA)
Add more info to ELF when needed. Close for now.
Hi, All, I am implementing the support of this. :)
Currently, the instruction set implementation is host specific. That is, if current host is 64 bits, then the in VM and everything will be 64 bits, and vice versa.