Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FIX_OFF16

11 views
Skip to first unread message

muta...@gmail.com

unread,
Apr 19, 2021, 6:34:56 AM4/19/21
to
jwasm has these defines:

enum fixup_types {
FIX_SEG, /* 0 */
FIX_LOBYTE, /* 1, OMF only */
FIX_HIBYTE, /* 2, OMF only */
FIX_RELOFF8, /* 3 */
FIX_RELOFF16, /* 4 */
FIX_RELOFF32, /* 5 */
FIX_OFF16, /* 6 */
FIX_OFF32, /* 7 */
FIX_PTR16, /* 8, OMF only */
FIX_PTR32, /* 9, OMF only */
FIX_OFF32_IMGREL, /* 10, COFF+ELF only */
FIX_OFF32_SECREL /* 11, COFF+ELF only */
};

And it seems from here:

https://github.com/JWasm/JWasm/blob/master/elf.c

#if GNURELOCS
case FIX_OFF16: em->extused = TRUE; elftype = R_386_16; break;

that FIX_OFF16 is non-standard for ELF.

Is there a reason for that?

This is the code that I am assembling:

https://sourceforge.net/p/pdos/gitcode/ci/master/tree/pdpclib/smlstart.asm

I'm planning on adding the above code to my
version of jwasm 1.94c.

But I'm wondering what it actually means.

Any ideas?

Thanks. Paul.

JJ

unread,
Apr 19, 2021, 8:25:26 AM4/19/21
to
On Mon, 19 Apr 2021 03:34:54 -0700 (PDT), muta...@gmail.com wrote:
> jwasm has these defines:
>
> enum fixup_types {
> FIX_SEG, /* 0 */
> FIX_LOBYTE, /* 1, OMF only */
> FIX_HIBYTE, /* 2, OMF only */
> FIX_RELOFF8, /* 3 */
> FIX_RELOFF16, /* 4 */
> FIX_RELOFF32, /* 5 */
> FIX_OFF16, /* 6 */
> FIX_OFF32, /* 7 */
> FIX_PTR16, /* 8, OMF only */
> FIX_PTR32, /* 9, OMF only */
> FIX_OFF32_IMGREL, /* 10, COFF+ELF only */
> FIX_OFF32_SECREL /* 11, COFF+ELF only */
> };
>
> And it seems from here:
>
> https://github.com/JWasm/JWasm/blob/master/elf.c
>
> #if GNURELOCS
> case FIX_OFF16: em->extused = TRUE; elftype = R_386_16; break;
>
> that FIX_OFF16 is non-standard for ELF.
>
> Is there a reason for that?

Probably for supporting 16-bit code within 32-bit module.

muta...@gmail.com

unread,
Apr 20, 2021, 2:59:14 PM4/20/21
to
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.
0 new messages