I am trying to port a version of Forth to a RPi 3 in assembler and I am being plagued by segmentation faults. Most of them I can find a cause and correct it but I am geting a number of elusive faults which I cannot resolve. I have a block of code which is working but ofter when I try to add code or date words the existing code creates segmentation faults at places which have worked well. Often the new code is in a different part of the program which has not even been run at the time of the fault.
The effect seems to be that adding code or data is moving parts of the program to far from each other and causing trouble although I can't see why this is not picked up by the linker.
I am using as to assemble and ld to link the program.
I know I have not given many details of the actual code as I don't expect anyone to struggle through several hundred lines of threaded code but if anyone has any thoughts on possible causes I would be very grateful.
Many thanks in advance,