[comp.sys.hp] Looking for HP Pascal Compiler Documentation

paul@mecazh.UUCP (Paul Breslaw) (11/17/89)

We have recently become aware of strange names that the HP Pascal
compiler under HP-UX6.5 gives to local text objects, eg local
procedures and functions.

These names are of the form module_nnn, but what the nnn is beats us.

Is this stuff documented anywhere? 

Thanks in advance.


Paul Breslaw 
Gerard Mohler

-- 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Paul Breslaw, Mecasoft SA,          |  telephone :  41 1 362 2040
Guggachstrasse 10, CH-8057 Zurich,  |  e-mail    :  mcvax!mecazh!paul
Switzerland.                        |               paul@mecazh.UUCP

bigelow@hpfcso.HP.COM (Jim Bigelow) (11/21/89)

>We have recently become aware of strange names that the HP Pascal
>compiler under HP-UX6.5 gives to local text objects, eg local
>procedures and functions.

>These names are of the form module_nnn, but what the nnn is beats us.

The 6.5 release of Pascal introduced procedure/function prolog and epilog code,
i.e. code produced by the compiler before and after every routine.  This
code contains the framework to save and restore floating point registers. The
strange names are names generated by the complier that are unique for each 
each module.  The module name is place on the front to avoid conflicts between 
modules.  These names are placed in the linker symbol table of the a.out so 
that the linker can fix up references at run time.  The linker symbol names
in the a.out's linker symbol table that are made from the module names without
any other text, is the start of the global dtat area for that module.  If you
look at the listing file with the compiler directive, tables, turned on, you
can see the size of the data area and each variables offset in it.  In the
linker symbol table of the a.out the dtat area is maked as undefined, but has
a size the same as that reported in the listing.

For example:

$ nm t6718.o
0x00000000 U  _asm_initproc		# resolved in libpc.a
0x00000000 U  _asm_wrapup               # resolved in libpc.a
0x00000000 U  _fs_fwriteint		# resolved in libpc.a
0x00000000 U  _fs_fwriteln		# resolved in libpc.a
0x00000000 U  _fs_fwritepaoc		# resolved in libpc.a
0x00000608 T  _main			# duplicate name for your program
0x00000608 T  _t6p7p1d8_t6p7p1d8	# program name,note sizes are the same
0x00000000 U  asm_closefiles		# resolved in libpc.a
0x00000000 U  asm_esc			# resolved in libpc.a
0x00000000 U  asm_false			# resolved in libpc.a
0x00000000 U  asm_input			# resolved in libpc.a
0x00000000 U  asm_ioresult		# resolved in libpc.a
0x00000000 U  asm_keyboard		# resolved in libpc.a
0x00000000 U  asm_line			# resolved in libpc.a
0x00000000 U  asm_output		# resolved in libpc.a
0x00000000 U  asm_setcheck		# resolved in libpc.a
0x00000000 U  asm_stderr		# resolved in libpc.a
0x00000000 U  asm_strlenfieldwidth	# resolved in libpc.a
0x00000000 U  asm_true			# resolved in libpc.a
0x00000000 U  asm_xadelement		# resolved in libpc.a
0x00000000 U  float_loc			# resolved in crt0.o
0x00000000 U  float_soft		# resolved in crt0.o
0x00000158 U  t6p7p1d8			# name of common/data area, note size
0x000003A0 T  t6p7p1d8_10b		# The following are "labels" for 
0x0000043C T  t6p7p1d8_12b		# prolog and epilog code
0x0000051C T  t6p7p1d8_14b
0x000005FA T  t6p7p1d8_16b
0x000009B2 T  t6p7p1d8_17b
0x0000001A T  t6p7p1d8_2b
0x000000DA T  t6p7p1d8_4b
0x0000021C T  t6p7p1d8_6b
0x000002DA T  t6p7p1d8_8b
  

Hope, this helps answers you questions.

Jim Bigelow
S300 Pascal
Colorado Language Lab.
Hewlett Packard