This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: 16-bit relocations in 32-bit code
- From: Richard Henderson <rth at redhat dot com>
- To: Andrew Zabolotny <zap at homelink dot ru>
- Cc: binutils at sourceware dot org
- Date: Mon, 15 Mar 2010 12:44:26 -0700
- Subject: Re: 16-bit relocations in 32-bit code
- References: <20100313234927.7d026a04@zap.home.lan>
On 03/13/2010 12:49 PM, Andrew Zabolotny wrote:
> Are there any ideas how my goal could be achieved? It would be good to
> find at least some hack for i386 targets (elf_i386 and pei_i386 would
> be ideal), since on x86_64 everything works fine with the first
> approach.
There is no solution that is generally portable. However,
given the existance of R_386_PC16, you should be able to
represent ".short SYM-." for any SYM on both i386 and x86_64.
For portability to other machines, you might consider writing
your own trivial assembler and linker for the forth. You
can then include the linked forth program into the native
binary via .incbin or the like.
r~