From: grog@lemis.uucp (Greg Lehey)
Newsgroups: comp.unix.wizards,comp.unix.sysv386,comp.unix.sys5.r3,comp.unix.pc-clone.32bit
Subject: ISC V.3.2 COFF executables?
Keywords: object,coff,compatibility,shared libraries
Date: 13 Oct 92 13:02:26 GMT
Followup-To: comp.unix.wizards
Organization: LEMIS, W-6324 Feldatal, Germany

I'm currently looking at emulation of COFF executables under BSD, and
have been examining the files supplied with ISC 2.2 (which is V.3.2).
According to the documentation I have, both from ISC and from O'Reilly
("Understanding and Using COFF"), the main segment types of interest
for executable files are text, data, bss and library segments - this
last only when shared libraries are implemented.

I wrote a little program to examine the executables supplied by ISC
and found:

1. A large number of executables have a library segment, though it is
   my understanding that ISC 2.2 does not support shared libraries.
   The library section usually consists of a 24-byte structure: {int,
   int, char [];}. The ints are small numbers (typically 6 and 2 or 7
   and 2), the char [] is a library name such as /shlib/libX11_s.v1.
   I have been unable to find these files on the system, though the
   executables work. Can anybody tell me:
       - the meaning of the digits
       - whether the pathname of the library should be considered to
         be absolute or relative.
       - how the system survives the lack of these libraries.

2. In addition, many executables contain segments with flags 0x22 or
   0x42. Nearly all the X executables have:

/adagio/usr/bin/X11/xsetroot: 
unknown segment: name .fka000, type 22, load address a0000000, file address 0, size 19352
unknown segment: name .fka040, type 42, load address a0400000, file address 0, size 1576
unknown segment: name .fka080, type 22, load address a0800000, file address 0, size 96604
unknown segment: name .fka0c0, type 42, load address a0c00000, file address 0, size 26644
unknown segment: name .fka100, type 22, load address a1000000, file address 0, size 13788
unknown segment: name .fka140, type 42, load address a1400000, file address 0, size 1528

   Of interest here is that the last 4 characters of the segment name
   correspond to the first four characters of the load address, that
   they seem to alternate in flags between 0x22 and 0x42, have no file
   offset, but load addresses starting at 0xa0000000 and incrementing
   by 0x400000. The lengths differ wildly. I am guessing that these
   might be Fortran common sections, but I don't understand the flag
   numbers. Any help (and suggestions about how to handle them) would
   be well received. My intention here would be to treat them as .bss
   segments, since they don't have any data attached.

Disclaimer: I do not intend to execute these files on a different
platform: firstly, the license probably prohibits it, and secondly
they would probably not work anyway. My intention is just to be able
to support any kind of executable which would come my way.
-- 
Greg Lehey                       | Tel: +49-6637-1488              
LEMIS                            | Fax: +49-6637-1489
Schellnhausen 2, W-6324 Feldatal, Germany
Xref: sparky comp.unix.wizards:4326 comp.unix.admin:5688