From wulf@cip.physik.uni-stuttgart.de Mon May 3 13:51:06 1993 Received: from calvin.sfasu.edu by umaxc.weeg.uiowa.edu (5.61.jnf/920629) on Mon, 3 May 93 13:50:53 -0500 id AA12582 with SMTP Received: from OSCAR.PHYSIK.UNI-STUTTGART.DE by calvin.sfasu.EDU with SMTP (5.59/25-eef) id AA06098; Fri, 30 Apr 93 07:48:42 CDT Return-Path: Received: by cip.physik.uni-stuttgart.de (MX V3.1C) id 28270; Fri, 30 Apr 1993 14:48:31 +0100 Date: Fri, 30 Apr 1993 14:49:37 +0100 From: Wulf Hofbauer To: hyperc-l@calvin.sfasu.edu Message-Id: <0096BCEF.234DB820.28270@cip.physik.uni-stuttgart.de> Subject: object modules&symbol tables Status: R Beejay wrote: >First, I reread the reference on ladd. All's kosher. ladd comes with >the package, I said to myself. So it must be in libc. I type at >the command line: sym -s libc. When ladd.o comes on the screen, what >do I see? A bunch of zeroes for text, data and bss sizes. Had I >inadvertently deleted the code somehow? Let me try the libc that came >with the fp package. Same thing! But as the data for the other >functions streamed past on the screen, I noticed that ladd.o was not alone. >There was xprintf.o, setjmp.o, setup.o, alloc.o, sysvars.o, conio.o, >exec.o, files.o, prtio.o, remove.o, rename.o, strings.o and sync.o - >all with a zero text size. [...] >Out went a help message to the doctor - Andy, that is. Well, he says, >ladd and all those other functions apparently missing in libc are opsys >functions. You can verify this easily by using "sym libc" (without the -s parameter). The sym utility lists all references and entry points declared in an object module, together with a character specifying the symbol type: T - TEXT entry. Specifies an externally accessible routine/function inside of the module. X - EXTERN. The module refers to this symbol, but it wasn't defined. It must be defined inside another module that is linked. A - ABSOLUTE. The symbol refers to an absolute address. This is the way how memory-resident routines are glued to your program. B - BSS entry. Specifies an uninitialized storage area D - DATA entry. Specifies an initialized storage area As you found out, it is perfectly possible for a module to contain neither coder nor data, but only symbol definitions. An example: extern INT printf(); /* creates an EXTERN symbol */ INT main() /* creates a TEXT entry */ { ... } INT mon() @0xff69; /* creates an ABSOLUTE symbol for address 0xff69 */ INT dummy; /* creates a BSS entry */ INT dummy2=1; /* creates a DATA entry */ Maybe this will clarify some things. - Wulf "Though this be madness, there is method in it." (Shakespeare) +-------------------------------------+-----------------------+ ! wulf@cip.physik.uni-stuttgart.de ! Apple // Enthusiast ! +-------------------------------------+-----------------------+ ! Wulf Hofbauer * Heilbronner Str. 12 * W-7146 Tamm * Germany ! ! Tel. 07141/602518 ! +-------------------------------------------------------------+