Article View: comp.lang.asm.x86
Article #88DOSSEG and TLINK
From: assassin17
Date: Fri, 14 May 1999 00:00
Date: Fri, 14 May 1999 00:00
108 lines
3945 bytes
3945 bytes
i'm a little confused about how linkers (mainly TLINK) handle the DOSSEG
directive. several documents state that DOSSEG causes the segments
to be ordered this way:
1. All segments with a class name ending in CODE
2. Far data segments (segments outside DGROUP)
3. Near data (DGROUP) segments, in the following order:
a. Segments of class BEGDATA (reserved for Microsoft use)
b. Any segments not of class BEGDATA, BSS, or STACK
c. Segments of class BSS
d. Segments of class STACK
however, TLINK seems to always put segments with class 'STACK' at the
end, even if they're _not_ in DGROUP. MASM's LINK behaves according to
the above list. is there any standard to how other linkers handle
DOSSEG, or can they arrange the different classed segments however they
want?
the next question is a little longer.. i was experimenting with this
file:
----------
DOSSEG
DGROUP GROUP OERP,AAAA,xaaa,LOPE,FBSS,DARK
xaaa SEGMENT 'CODE'
xaaa ENDS
CBF SEGMENT
CBF ENDS
FBSS SEGMENT 'DATA'
FBSS ENDS
LOSER SEGMENT 'STACK'
LOSER ENDS
ztr SEGMENT 'DATA'
ztr ENDS
aab SEGMENT 'BSS'
aab ENDS
OERP SEGMENT 'BEGDATA'
OERP ENDS
AAAA SEGMENT 'ARPA'
AAAA ENDS
LOPE SEGMENT 'STACK'
LOPE ENDS
ZZZU SEGMENT 'ARPA'
ZZZU ENDS
DARK SEGMENT 'CODE'
DARK ENDS
END
-----
strangely, TLINK outputted the segments in this order:
00000H 00000H 00000H XAAA CODE
00000H 00000H 00000H DARK CODE
00000H 00000H 00000H CBF
00000H 00000H 00000H ZTR DATA
00000H 00000H 00000H AAB BSS
00000H 00000H 00000H AAAA ARPA
00000H 00000H 00000H ZZZU ARPA
00000H 00000H 00000H OERP BEGDATA
00000H 00000H 00000H FBSS DATA
00000H 00000H 00000H LOSER STACK
00000H 00000H 00000H LOPE STACK
segment AAAA is a member of DGROUP, and *should* be after OERP based on
the aforementioned DOSSEG list. even stranger, the segments will be
outputted in the expected order if segment AAB is moved to the end of
the source file:
00000H 00000H 00000H XAAA CODE
00000H 00000H 00000H DARK CODE
00000H 00000H 00000H CBF
00000H 00000H 00000H ZTR DATA
00000H 00000H 00000H ZZZU ARPA
00000H 00000H 00000H AAB BSS
00000H 00000H 00000H OERP BEGDATA
00000H 00000H 00000H FBSS DATA
00000H 00000H 00000H AAAA ARPA
00000H 00000H 00000H LOSER STACK
00000H 00000H 00000H LOPE STACK
any idea what steps TLINK is going through when ordering these segments?
sometimes its behavior matches the documentation on DOSSEG; other times
not. very confusing..
thanks
p.s. i apologize for the length of this post. :)
--
=-= assassin17@rocketmail.com =-=
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
Technical Details
Message-ID:
<7hg7kq$ksb$1@autumn.news.rcn.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: feaef,dda8022d1c19bc63,start X-Google-Attributes: gidfeaef,public X-Google-Thread: f7d8d,dda8022d1c19bc63,start X-Google-Attributes: gidf7d8d,public X-Google-Thread: 114917,dda8022d1c19bc63,start X-Google-Attributes: gid114917,public From: assassin17@rocketmail.com Subject: DOSSEG and TLINK Date: 1999/05/14 Message-ID: <7hg7kq$ksb$1@autumn.news.rcn.net> X-Deja-AN: 477677748 Approved: <johnfine@erols.com> X-Http-User-Agent: Mozilla/4.08 [en] (Win95; I) X-Complaints-To: abuse@rcn.com X-Trace: asGkADw7b8+0ni54nOmOpn6TgOO3RSlnu7O73qXeNfI= X-Http-Proxy: 1.0 x43.deja.com:80 (Squid/1.1.22) for client 206.68.208.232 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Fri May 14 03:37:06 1999 GMT NNTP-Posting-Date: 14 May 1999 04:08:58 GMT Newsgroups: comp.lang.asm.x86,borland.public.tasm,alt.lang.asm