The document describes linking and accelerating programs in the TNS/E environment. It discusses using the eld linker to link multiple modules into an executable, how to handle unresolved symbols, and how to create dynamic link libraries (DLLs). It also covers using the Object Code Accelerator (OCA) to optimize Guardian code files for the Itanium architecture, and tools like enoft and fileinfo for examining object files and determining if a program has been accelerated.
5. eld and Symbolseld and Symbols
Missing Symbols
◦ Unlike nld, eld knows which procedures exist in
system library
◦ By default, eld considers it an error if you refer to
a symbol and the symbol does not exist
You can change this with the
-unres_symbols option: error, warn, ignore
◦ By default, your program cannot run if it refers to
a symbol that does not exist.
You can change this with the
–set rld_unresolved option: error, warn, ignore
3 - Linking and Accelerating 5
6. Unresolved References — Default BehaviorUnresolved References — Default Behavior
60> eld -o myexe maino -l cob
eld - TNS/E Native Mode Linker - T0608H01^AAG - 26JAN2007
**** INFORMATIONAL MESSAGE **** [1019]:
Using DLL RUBY.$SYSTEM.zdll002a.zcobdll.
**** INFORMATIONAL MESSAGE **** [1530]:
Using the zimpimp file RUBY.$SYSTEM.SYS00.ZIMPIMP.
**** ERROR **** [1210]:
maino: In function `CONCEPTS-REQ':
maino(.text_1+0x1202):
unresolved reference to GET-SECOND-NUMBER.
No output file created.
1 error reported.
No warnings reported.
2 informational messages reported.
3 - Linking and Accelerating 6
13. PublicPublic Libraries (from SRL to DLL)Libraries (from SRL to DLL)
◦ All NonStop H-series libraries are packaged as DLLs rather
than SRLs - SRLs are not supported onTNS/E systems
◦ TheTNS/E libraries have different names - Change build
procedures that specifically refer to the libraries
Library TNS/R TNS/E*
COBOL run-time library COBSRL ZCOBDLL
Common Run-time Environment (CRE) ZCRESRL ZCREDLL
C run-time library ZCRTSRL ZCREDLL
C++ VERSION1 ZCPLGSRL Not supported
C++ VERSION2 ZCPLSRL +
ZRWSLSRL
ZCPPCDLL +
ZCPP2DLL
Tools.H++ 7.0 ZTLHSRL ZTLH7DLL
C++ VERSION3
(ANSI/ISO Standard)
ZSTDSRL ZCPPCDLL +
ZCPP3DLL
133 - Linking and Accelerating
14. Examining an Object FileExamining an Object File
◦ New tool — enoft
◦ Many commands identical to noft
listproc, listsource, listcompilers, listattribute,
listoptimize, listunresolved, dumpproc, and so forth
◦ Some commands changed
listsrlinfo -> liblist
set out -> log
3 - Linking and Accelerating 14
19. Object Code Accelerator (OCA)Object Code Accelerator (OCA)
◦ Operates on Guardian-based code 100 files
May already be TNS/R accelerated
◦ Adds Itanium Processor Family (IPF) instructions
Adds calls to millicode routines
◦ Uses symbols region, if present
Produces more efficient code
Can strip after acceleration
◦ Controllable by Binder options
◦ Use SQLCOMP after acceleration
3 - Linking and Accelerating 19
20. OCA Items to Watch forOCA Items to Watch for
◦ Disabled overflow traps
Should test for overflow using $OVERFLOW or ONSIZE
◦ Trap handlers
Register contents are not precise
◦ P-relative addresses
Cannot be passed as parameters in UC
◦ References to system global data
Instruction Failure exception
◦ Odd-byte references
Various behaviors
◦ Single-word shift statements with dynamic shift count
Shift count > 31 gives undefined result
◦ May affect debugging ability
3 - Linking and Accelerating 20
21. Object Code Accelerator — ExampleObject Code Accelerator — Example
3 - Linking and Accelerating 21
6> oca
OCA - T0448H01 - 01MAY05 - (May 28 2008 15:55:33)
Copyright Hewlett-Packard, 1988-2005
OCA Syntax Summary
oca [/run-options/] input-file [; option-list ]
input-file is the name of a fully bound, runnable,
type-100 TNS code file.
option-list
is one or more command line options:
[ { SL }
{ UL }
22. Object Code Accelerator — ExampleObject Code Accelerator — Example
TALEX 100 15496 11NOV2008 7:57 34,26 OOOO 14 14
26> oca talex
OCA - T0448H01 - 01MAY05 - (May 28 2008 15:55:33)
Copyright Hewlett-Packard, 1988-2005
Option summary: No options
262 TNS instruction words; 524 bytes
445 Itanium bundles; 7120 bytes
13.59 inline code expansion factor
1.70 Itanium bundles per TNS instruction
TNS file name: talex
Binder region present
Symbols region present
Mips region not present
Accelerated as User Code segment 0 through 0
0 Errors were detected
0 Warnings were issued
Accelerated file name: talex
Accelerated for TNS/E on Nov 11 2008 07:58:15
Acceleration completed on Nov 11 2008 07:58:15
CPU Time 0:00:00.050
TALEX 100 30720 11NOV2008 7:58 34,26 OOOO 56 56
3 - Linking and Accelerating 22
23. Determining If Program AcceleratedDetermining If Program Accelerated
23> fileinfo obj*
$FC1.TERRYG
CODE EOF LAST MODIFIED OWNER RWEP
OBJC 100 12282 08AUG2008 12:32 34,26 OOOO
OBJCE 100 28672 08AUG2008 12:34 34,26 OOOO
OBJCR 100 24576 08AUG2008 12:33 34,26 OOOO
OBJCRE 100 40960 08AUG2008 12:35 34,26 OOOO
24> vproc objc
VPROC - T9617H01 - (01 OCT 2004) SYSTEM RUBY Date 08 AUG 2008, 12:37:03
$FC1.TERRYG.OBJC
Binder timestamp: 08AUG2008 12:32:44
Version procedure: >> NO T9xxx PROC <<
Target CPU: UNSPECIFIED
3 - Linking and Accelerating 23
Not accelerated
24. Determining If Program AcceleratedDetermining If Program Accelerated
25> vproc objce
VPROC - T9617H01 - (01 OCT 2004) SYSTEM RUBY Date 08 AUG 2008, 12:37:27
$FC1.TERRYG.OBJCE
Binder timestamp: 08AUG2008 12:32:44
Version procedure: >> NO T9xxx PROC <<
Target CPU: UNSPECIFIED
OCA timestamp: 08AUG2008 12:34:51
26> vproc objcre
VPROC - T9617H01 - (01 OCT 2004) SYSTEM RUBY Date 08 AUG 2008, 12:38:10
$FC1.TERRYG.OBJCRE
Binder timestamp: 08AUG2008 12:32:44
Version procedure: >> NO T9xxx PROC <<
Target CPU: UNSPECIFIED
AXCEL timestamp: 08AUG2008 12:33:28
OCA timestamp: 08AUG2008 12:35:15
3 - Linking and Accelerating 24
TNS/R accelerated
TNS/E accelerated
TNS/E accelerated
25. BINDER – Disabling AccelerationBINDER – Disabling Acceleration
◦ Display current setting:
SHOW OCA ENABLE FROM <file-name>
◦ Control whether program can be accelerated:
CHANGE OCA ENABLE ON|OFF IN <file-name>
6> bind
BINDER - OBJECT FILE BINDER - T9621H01 SYSTEM
RUBY
@change oca enable off in objc
@exit
7> oca objc output_file objce
OCA - T0448H01 - 01MAY05 - (Mar 19 2007 14:40:27)
*** Error 9:Translation of file objc is inhibited.
◦ Strip accelerated region:
STRIP <file-name>, IPF
3 - Linking and Accelerating 25
26. TNSVUTNSVU ——
Accelerated Object ExaminerAccelerated Object Examiner
3 - Linking and Accelerating 26
28> tnsvu talex
TNSVU - May 28 2008 16:13:21
Copyright Hewlett-Packard, 2000-2005
Viewing on Tue Nov 11 08:01:05 2008
Opened file talex
talex>
27. TNSVU HelpTNSVU Help
3 - Linking and Accelerating 27
talex> help
TNSVU Command Summary
Commands are not case-sensitive; file and procedure names are.
More information is available using "HELP command-name".
LOG - Opens a text file in which TNSVU records all text
LOGAPPEND written to the screen (including typed commands).
ENDLOG - Closes a log file.
OPEN - Opens a type-100 TNS object file for viewing.
FILEINFO - Displays general information about the open file.
PROCINFO - Displays general information about a procedure.
PROCS - Displays the names of procedures in the object file
LOCAL - Displays the names of local millicode routines
MILLICODE - Displays the names of emulation and shared millicode
routines.
EXTERNALS - Displays the names of external (system or user)
library routines.
ICODE - Displays Itanium and TNS instructions.
HISTORY - Displays previously-issued commands.
28. TNSVU HelpTNSVU Help
TNSHEADER - Displays the TNS file header.
OCAHEADER - Displays the Itanium region header.
AXCELHEADER - Displays the Axcel region header.
DUMPPMAPS - Displays Pmaps.
OPTIONS - Displays translation options.
TNStoIPF - Converts TNS address to Itanium.
IPFtoTNS - Converts Itanium address to TNS.
XEP - Displays proc targets of XEP entries.
VERSION - Displays the OCAVersion field of the OCAHeader.
EXACTPTS - Displays the exact points in the given procedure.
OBEY - Reads TNSVU commands from the given text file.
LIMIT - Overrides limit on # of TNS instrs printed by
'ICODE procname'.
COMPARE - Compare IPF code from the current file
with the given file.
LINENUMTOTNS - Converts a source line number to a TNS code location.
TNSTOLINENUM - Converts a TNS code location to a source line number.
SOURCESUBVOL - Display source from files in the given subvol.
SOURCE OFF - Turn off source code display.
SOURCE ON - Turn on source code display (on by default).
3 - Linking and Accelerating 28
29. TNSVU Example — FILEINFOTNSVU Example — FILEINFO
3 - Linking and Accelerating 29
talex> fileinfo
Examining file talex
Occupies code segment 0 through 0 in User Code
space 0x1bd Itanium bundles
Translated on Nov 11 2008 07:58:15
using an OCA built on May 28 2008 15:55:33
Accelerator region: 0x0 for 0x0 bytes
Itanium region: 0x4000 for 0x3008 bytes
Symbols region: 0x2000 for 0xb12 bytes
Binder region: 0x2c00 for 0x1088 bytes
talex>
30. TNSVU Example — PROCSTNSVU Example — PROCS
3 - Linking and Accelerating 30
talex> procs
Procedures:
DISPLAY_INITIAL_REQ_MESSAGE
CSEG 0 PEP# 02 TNS Base: 05 TNS Size: 071 TNS Entry: 05
Itanium code: 0x70420480 Itanium bundles: 0x3a Itanium entry:
0x70420480
Implemented in TAL in source file RUBY.$FC1.TGTNSE.MAINP
line 36.0 to 44.0
GET_SECOND_NUMBER
CSEG 0 PEP# 04 TNS Base: 0345 TNS Size: 0154 TNS Entry: 0345
Itanium code: 0x70421500 Itanium bundles: 0x6d Itanium entry:
0x70421500
Implemented in TAL in source file RUBY.$FC1.TGTNSE.CALLP
line 10.0 to 27.0
MAIN_PROG
CSEG 0 PEP# 03 TNS Base: 076 TNS Size: 0247 TNS Entry: 076
Itanium code: 0x70420820 Itanium bundles: 0xce Itanium entry:
0x70420820
Implemented in TAL in source file RUBY.$FC1.TGTNSE.MAINP
line 46.0 to 84.0
talex>