Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

All Finagle Laws may be bypassed by learning the simple art of doing without thinking.


devel / comp.os.msdos.programmer / link order

SubjectAuthor
* link ordermuta...@gmail.com
`- Re: link ordermuta...@gmail.com

1
link order

<f551520b-cd72-4c53-9880-f932a80c4400n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10024&group=comp.os.msdos.programmer#10024

  copy link   Newsgroups: comp.os.msdos.programmer
X-Received: by 2002:ae9:dfc7:0:b0:75c:eff8:8665 with SMTP id t190-20020ae9dfc7000000b0075ceff88665mr3832157qkf.8.1687507192630;
Fri, 23 Jun 2023 00:59:52 -0700 (PDT)
X-Received: by 2002:a9d:6344:0:b0:6b2:ad56:2f5c with SMTP id
y4-20020a9d6344000000b006b2ad562f5cmr4137504otk.6.1687507192311; Fri, 23 Jun
2023 00:59:52 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.msdos.programmer
Date: Fri, 23 Jun 2023 00:59:52 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=111.90.198.52; posting-account=CeHKkQoAAAAowY1GfiJYG55VVc0s1zaG
NNTP-Posting-Host: 111.90.198.52
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f551520b-cd72-4c53-9880-f932a80c4400n@googlegroups.com>
Subject: link order
From: mutazi...@gmail.com (muta...@gmail.com)
Injection-Date: Fri, 23 Jun 2023 07:59:52 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4103
 by: muta...@gmail.com - Fri, 23 Jun 2023 07:59 UTC

I am using Visual C++ 1.52 to create a 16-bit DOS executable
and my link command starts:

link /cp:1 /noi /nod /map /nologo /dosseg ploadst.obj+pload.obj+int13x.obj+

The map shows:

Start Stop Length Name Class
00000H 00788H 00789H PLOADST_TEXT CODE
0078AH 0078AH 00000H PLOAD_TEXT CODE
0078AH 007F9H 00070H INT13X_TEXT CODE
007FAH 00C64H 0046BH DOSSUPA_TEXT CODE
00C66H 00C66H 00000H DOSSUPC_TEXT CODE
00C66H 00C66H 00000H BOS_TEXT CODE
00C66H 00F45H 002E0H SUPPORT_TEXT CODE
00F46H 00F46H 00000H MINIFAT_TEXT CODE
00F46H 00F46H 00000H STRING_TEXT CODE
00F46H 00F46H 00000H PDOSLOAD_TEXT CODE
00F46H 01091H 0014CH LLDOS_TEXT CODE
01092H 01214H 00183H PROTINTA_TEXT CODE
01218H 012BDH 000A6H _TEXT32 CODE
012BEH 012BEH 00000H FILE_TEXT CODE
012BEH 012BEH 00000H PROTINT_TEXT CODE
012BEH 012BEH 00000H CTYPE_TEXT CODE
012C0H 09455H 08196H COMDAT_SEG1 CODE
09456H 09B1FH 006CAH _DATA DATA
09B20H 09B20H 00000H CONST CONST
09B20H 0A39BH 0087CH _BSS BSS
0A3A0H 0A94BH 005ACH c_common BSS
0A950H 0B94FH 01000H STACK STACK

which is the correct order, with pload coming second.

But this:

Address Publics by Value

0000:0700 __startup
0000:0758 _clrbss
0000:0775 _displayc
0000:0784 __exita
0078:000A _int13x
007F:000A ___open
007F:0031 ___creat
007F:0058 ___read
007F:0084 ___write
007F:00B0 ___seek
....
0121:0008 _rtop_stage2
0121:008A _runreal
012C:0000 _main
012C:0546 _dstart
012C:0BD4 _readAbs
012C:0DDA _dumpbuf
012C:0E20 _dumplong
012C:0EC8 ___divide
012C:0FBE ___modulo
012C:10BE ___subhphp
012C:1128 _BosSetCursorPosition
012C:1156 _BosScrollWindowUp
012C:1198 _BosWriteText

shows that other things ended up being earlier than
the stuff in pload:

C:\devel\pdos\src>grep main pload.c
pload.c: /* Released to the Public Domain */
pload.c: int main(void)
pload.c: /* we need to enter here to avoid Watcom name mangling of main() */
pload.c: main();

C:\devel\pdos\src>grep dstart pload.c
pload.c: void dstart(int drive, char *edata)

C:\devel\pdos\src>grep dumplong pload.c
pload.c: void dumplong(unsigned long x);
pload.c: /* now you can do debugging with dumplong/dumpbuf, without
pload.c: void dumplong(unsigned long x)

C:\devel\pdos\src>

Almost everything appears to have been moved to here:

012C0H 09455H 08196H COMDAT_SEG1 CODE

and then rearranged in an order that I don't actually want.

Any idea what is happening?

I have no idea what "COMDAT_SEG1" means.

I looked at all the link options and didn't see anything
that might keep things in the right order.

Thanks. Paul.

Re: link order

<bea74e90-0107-4a1b-8b90-bb843b91f985n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10025&group=comp.os.msdos.programmer#10025

  copy link   Newsgroups: comp.os.msdos.programmer
X-Received: by 2002:ac8:58c3:0:b0:3f3:641b:85f with SMTP id u3-20020ac858c3000000b003f3641b085fmr7228654qta.10.1687514378456; Fri, 23 Jun 2023 02:59:38 -0700 (PDT)
X-Received: by 2002:a05:6830:468f:b0:6b7:27ec:311d with SMTP id ay15-20020a056830468f00b006b727ec311dmr95633otb.0.1687514378105; Fri, 23 Jun 2023 02:59:38 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!69.80.99.14.MISMATCH!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.msdos.programmer
Date: Fri, 23 Jun 2023 02:59:37 -0700 (PDT)
In-Reply-To: <f551520b-cd72-4c53-9880-f932a80c4400n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=111.90.198.52; posting-account=CeHKkQoAAAAowY1GfiJYG55VVc0s1zaG
NNTP-Posting-Host: 111.90.198.52
References: <f551520b-cd72-4c53-9880-f932a80c4400n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bea74e90-0107-4a1b-8b90-bb843b91f985n@googlegroups.com>
Subject: Re: link order
From: mutazi...@gmail.com (muta...@gmail.com)
Injection-Date: Fri, 23 Jun 2023 09:59:38 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 10
 by: muta...@gmail.com - Fri, 23 Jun 2023 09:59 UTC

Switching from -O2 to -Ox solved the problem.

I think because -O2 must have -Gy which separates
functions into separate segments (or something like
that) so that the linker can eliminate dead code.

So now I have a bigger executable, but at least it is
in the right order so that I can minimize the number
of sectors that the boot sector needs to load.

BFN. Paul.


devel / comp.os.msdos.programmer / link order

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor