The instructions for jonesforth say to call gcc like so:
gcc -m32 -nostdlib -static -Wl,-Ttext,0 -Wl,--build-id=none -o
jonesforth jonesforth.S
However, the resulting binary doesn't seem to work correctly:
$ cat jonesforth.f - | ./jonesforth
Killed
On the other hand, this produces a binary which runs:
gcc -m32 -nostdlib -static -Wl,--build-id=none -o jonesforth
jonesforth.S
Anybody else run into this?
Ed
Haven't tried it. It's probably a typo though. The -Ttext argument for gcc
is set to the loading address of an executable. Zero in this case. e.g.,
-Ttext=0
HTH,
Rod Pemberton
There have been some recent Linux kernel changes that forbid programs
from mapping memory at address zero.
Andrew.
Here's a comment from the program mentioning the placement of the text
segment at 0:
One minor point here. Because DOCOL is the first bit of assembly
actually to be defined in this file (the others were just macros), and
because I usually compile this code with the text segment starting at
address 0, DOCOL has address 0. So if you are disassembling the code
and see a word with a codeword of 0, you will immediately know that
the word is written in FORTH (it's not an assembler primitive) and so
uses DOCOL as the interpreter.
Ed