16-bit relocations in 32-bit code
Andrew Zabolotny
zap@homelink.ru
Mon Mar 15 22:59:00 GMT 2010
From Mon, 15 Mar 2010 12:44:26 -0700
Richard Henderson <rth@redhat.com> wrote:
> There is no solution that is generally portable.
I understand, but I can live with platform-specific macros.
> 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.
I don't quite get the idea. ".short SYM-." won't generate any
relocation at all, how this can help me? But I tried a simple example
like this:
.reloc .,R_386_PC16,PLUS
.short 0
and this at least does not generate the linker warning about overflow.
Can I turn my initial statement:
.short PLUS-0x610000
into a PC16 relocation somehow?
Some platforms support the modificator lo16(addr). This is the ideal
solution for my problem; unfortunately, i386 does not support it.
> 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.
That's what I'm trying to avoid by using binutils as the swiss army
knife :)
--
Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20100315/e6785916/attachment.sig>
More information about the Binutils
mailing list