On Monday, April 19, 2021 at 10:25:26 PM UTC+10, JJ wrote:
> > that FIX_OFF16 is non-standard for ELF.
> >
> > Is there a reason for that?
> Probably for supporting 16-bit code within 32-bit module.
I've made this change to jwasm 1.94c:
C:\devel\jwasm>cvs diff
cvs diff: Diffing .
Index: elf.c
===================================================================
RCS file: c:\cvsroot/jwasm/elf.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 elf.c
760a761,764
> case FIX_OFF16:
> printf("unusual FIX_OFF16 encountered\n");
> elftype = R_386_16;
> break;
cvs diff: Diffing H
Index: H/elf.h
===================================================================
RCS file: c:\cvsroot/jwasm/H/elf.h,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 elf.h
277a278
> #define R_386_16 20
And then I went to find out what caused messages like:
unusual FIX_OFF16 encountered
I was expecting this:
mov esi, offset __start__relot
or this:
mov esi, offset ___start__
But it was actually this:
rt:
dd offset rt
ie it is already a 32-bit value (dd). Seems to me it could
have been done with a normal FIX_OFF32/R_386_32?
BFN. Paul.