Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Mod03 linking and accelerating

453 views

Published on

Application Migration to HP NonStop H- und J-Series Operating Systems

Published in: Technology, Education
  • Be the first to comment

  • Be the first to like this

Mod03 linking and accelerating

  1. 1. Linking and AcceleratingLinking and AcceleratingModule 3
  2. 2. eld Basic Operationeld Basic OperationInputs◦ Code 800 files◦ LinkfilesOutputs◦ Code 800 files◦ Linkfiles◦ Loadfile◦ Dynamic-link library (DLL)3 - Linking and Accelerating 2
  3. 3. Linking a Multi-Module C programLinking a Multi-Module C program◦ C program Guardian environment: eld –o outfile $system.system.ccplmaininmod1 inmod2 -lcrtl –lcre OSS from Guardian environment: eld –o outfile –set systype oss $system.system.ccplmaininmod1 inmod2 -l crtl –l cre◦ C++ Version 3 eld –o outfile inmod1 inmod2 $system.system.ccplmain-lzcppcdll –lzcpp3dll3 - Linking and Accelerating 3
  4. 4. Linking a Multi-Module COBOL ProgramLinking a Multi-Module COBOL Program3 - Linking and Accelerating 41> ecobol /in callprog/callo;symbols2> ecobol /in mainprog/maino;symbols3> eld -o myexe callo maino -l cobecobolecoboleldmainprogcallprog callomainomyexe123zcobdll
  5. 5. eld and Symbolseld and SymbolsMissing Symbols◦ Unlike nld, eld knows which procedures exist insystem library◦ By default, eld considers it an error if you refer toa 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 toa symbol that does not exist. You can change this with the–set rld_unresolved option: error, warn, ignore3 - Linking and Accelerating 5
  6. 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
  7. 7. Unresolved References — Optional BehaviorUnresolved References — Optional Behavior 61> eld -o myexe maino -l cob -unres_symbols warn 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. **** WARNING **** [1254]: maino: In function `CONCEPTS-REQ:maino(.text_1+0x1202):unresolved reference to GET-SECOND-NUMBER. Output file: myexe (program file) Output file timestamp: Aug 5 12:57:03 2008 No errors reported. 1 warning reported. 2 informational messages reported.3 - Linking and Accelerating 7
  8. 8. Unresolved References — Optional BehaviorUnresolved References — Optional Behavior 62> run myexe *** RLD ERROR ***: Unresolved Text Symbol GET-SECOND-NUMBER infile RUBY.$FC1.TERRYG.MYEXE. *ERROR* PROCESS_CREATE_ Error: 74 63>3 - Linking and Accelerating 8
  9. 9. Unresolved References — Additional OptionUnresolved References — Additional Option 63> eld -o myexe maino -l cob -unres_symbols warn -set rld_unresolvedwarn 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. **** WARNING **** [1254]: maino: In function `CONCEPTS-REQ:maino(.text_1+0x1202):unresolved reference to GET-SECOND-NUMBER. Output file: myexe (program file) Output file timestamp: Aug 5 12:57:50 2008 No errors reported. 1 warning reported. 2 informational messages reported.3 - Linking and Accelerating 9
  10. 10. Unresolved References — Additional OptionUnresolved References — Additional Option 64> run myexe *** RLD WARNING ***: Unresolved Text Symbol GET-SECOND-NUMBER infile RUBY.$FC1.TERRYG.MYEXE. Undefined externals YOU HAVE JUST STARTED THE PROCESS. ENTER FIRST NUMBER (max. 3 digits) [or 0 to stop]: ?12 RUBY.$:1:956:4925776 - *** Run-time Error 003 *** RUBY.$:1:956:4925776 - Instruction failure RUBY.$:1:956:4925776 - From --- RUBY.$:1:956:4925776 - UNRESOLVED_PROCEDURE_CALLED_ + 0x2 (SLr) RUBY.$:1:956:4925776 - CONCEPTS-REQ + 0x1210 (UCr) ABENDED: 1,956 CPU time: 0:00:00.004 3: Premature process termination with fatal errors or diagnostics 65>3 - Linking and Accelerating 10
  11. 11. Creating a DLLCreating a DLL eld inmod1 inmod2 -dll -dllname dllfilename [–set floattype neutral] [-set cppdialect cppneutral] –export_all3 - Linking and Accelerating 11
  12. 12. Changing Object AttributesChanging Object AttributesUpdates existing code 800 file: eld –change <attribute> <value> <filename>◦ Example: eld –change inspect off myprog3 - Linking and Accelerating 12
  13. 13. PublicPublic Libraries (from SRL to DLL)Libraries (from SRL to DLL)◦ All NonStop H-series libraries are packaged as DLLs ratherthan SRLs - SRLs are not supported onTNS/E systems◦ TheTNS/E libraries have different names - Change buildprocedures that specifically refer to the librariesLibrary TNS/R TNS/E*COBOL run-time library COBSRL ZCOBDLLCommon Run-time Environment (CRE) ZCRESRL ZCREDLLC run-time library ZCRTSRL ZCREDLLC++ VERSION1 ZCPLGSRL Not supportedC++ VERSION2 ZCPLSRL +ZRWSLSRLZCPPCDLL +ZCPP2DLLTools.H++ 7.0 ZTLHSRL ZTLH7DLLC++ VERSION3(ANSI/ISO Standard)ZSTDSRL ZCPPCDLL +ZCPP3DLL133 - Linking and Accelerating
  14. 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 -> log3 - Linking and Accelerating 14
  15. 15. enoft Examplesenoft Examples 34> enoft TNS/E Native Object File Tool [T2823 - Jul 9 2008] enoft> file cobex Object File: RUBY.$FC1.TGTNSE.cobex Format Type: ELF64-bit, Big_Endian, IA64, PIC_Program (loadfile) enoft> listproc * ******** List of Procedures UwNdx Proc_Addr Proc_Name ----------------------------------------------------------------- 0 0x700008c0 #import_stubs 1 0x70000a40 CALCULATOR 2 0x700027c0 __INIT__0_CALCULATOR_ 3 0x70002900 __INIT__1_CALCULATOR_ 4 0x70002a40 GET-SECOND-NUMBER 5 0x700035c0 __INIT__0_GET-SECOND-NUMBER_ 6 0x70003700 #end_of_code3 - Linking and Accelerating 15
  16. 16. enoft Examplesenoft Examples enoft> la ******** List of Common File Attributes Name: RUBY.$FC1.TGTNSE.cobex File Format: ELF64-bit, Big_Endian, IA64 Type: PIC_Program (loadfile) Debugging Symbols: Yes Float-Point Type: NEUTRAL_FLOAT ----------------------------------------------------------------- Float-overrule: No System Type: Guardian Creation Timestamp: 2008-11-11 08:57:35 Process Subtype: 0 Highrequestors: Yes Runnamed: No Highpin: Yes Saveabend: No PRIV or CALLABLE Main: No CALLABLE Procs: No Default Debugger: Visual Inspect Languages and Dialects: Asm Cobol Ptal C Instrumented File: No3 - Linking and Accelerating 16
  17. 17. enoft Examplesenoft Examples enoft> ls * detail ******** List of Source Files (Compilation Units) Source: 0 RUBY.$FC1.TGTNSE.MAINCOB Compiler: Cobol85 Descript: HP TNS/E COBOL T0356H01_01AUG2008_20JUL2008_AAU +T1246H01_01AUG2008_1 8JUL2008_PRODUCT_AAM_GRD_E_10_1 Compiled: 2008-11-11 08:57:29 (TimeStamp at Compile site) File: 1 RUBY.$FC1.TGTNSE.MAINCOB Time: 2008-11-11 08:56:50 Size: 1718 Source: 1 RUBY.$FC1.TGTNSE.CALLCOB Compiler: Cobol85 Descript: HP TNS/E COBOL T0356H01_01AUG2008_20JUL2008_AAU +T1246H01_01AUG2008_1 8JUL2008_PRODUCT_AAM_GRD_E_10_1 Compiled: 2008-11-11 08:57:19 (TimeStamp at Compile site) File: 1 RUBY.$FC1.TGTNSE.CALLCOB Time: 2008-11-11 08:57:11 Size: 11543 - Linking and Accelerating 17
  18. 18. enoft Examplesenoft Examples enoft> lu * ******** List of Unresolved (undefined) Symbols SymNdx Symbol_Name ----------------------------------------------------------------- 30 COBLIB_ACCEPT_ 31 _SharedMilli_MOVB_FWD_NOOVERLAP 32 COBLIB_INITIALIZER_ 35 COBLIB_ABEND_ 37 COBLIB_DISPLAY_ 38 COBLIB_INITIALIZATION_COMPLETE_ 43 COBLIB_ERROR_ 48 _SharedMilli_CQA 49 COBLIB_INIT_PROG_ 51 COBLIB_STOP_ 52 COBLIB_COMP_ALL_1_ Number of symbols matching scope: 113 - Linking and Accelerating 18
  19. 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 acceleration3 - Linking and Accelerating 19
  20. 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 ability3 - Linking and Accelerating 20
  21. 21. Object Code Accelerator — ExampleObject Code Accelerator — Example3 - Linking and Accelerating 216> ocaOCA - T0448H01 - 01MAY05 - (May 28 2008 15:55:33)Copyright Hewlett-Packard, 1988-2005OCA Syntax Summaryoca [/run-options/] input-file [; option-list ]input-file is the name of a fully bound, runnable,type-100 TNS code file.option-listis one or more command line options:[ { SL }{ UL }
  22. 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 563 - Linking and Accelerating 22
  23. 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: UNSPECIFIED3 - Linking and Accelerating 23Not accelerated
  24. 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:153 - Linking and Accelerating 24TNS/R acceleratedTNS/E acceleratedTNS/E accelerated
  25. 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 SYSTEMRUBY @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>, IPF3 - Linking and Accelerating 25
  26. 26. TNSVUTNSVU ——Accelerated Object ExaminerAccelerated Object Examiner3 - Linking and Accelerating 2628> tnsvu talexTNSVU - May 28 2008 16:13:21Copyright Hewlett-Packard, 2000-2005Viewing on Tue Nov 11 08:01:05 2008Opened file talextalex>
  27. 27. TNSVU HelpTNSVU Help3 - Linking and Accelerating 27talex> helpTNSVU Command SummaryCommands 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 textLOGAPPEND 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 fileLOCAL - Displays the names of local millicode routinesMILLICODE - Displays the names of emulation and shared millicoderoutines.EXTERNALS - Displays the names of external (system or user)library routines.ICODE - Displays Itanium and TNS instructions.HISTORY - Displays previously-issued commands.
  28. 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 byICODE procname. COMPARE - Compare IPF code from the current filewith 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. 29. TNSVU Example — FILEINFOTNSVU Example — FILEINFO3 - Linking and Accelerating 29talex> fileinfoExamining file talexOccupies code segment 0 through 0 in User Codespace 0x1bd Itanium bundlesTranslated on Nov 11 2008 07:58:15using an OCA built on May 28 2008 15:55:33Accelerator region: 0x0 for 0x0 bytesItanium region: 0x4000 for 0x3008 bytesSymbols region: 0x2000 for 0xb12 bytesBinder region: 0x2c00 for 0x1088 bytestalex>
  30. 30. TNSVU Example — PROCSTNSVU Example — PROCS3 - Linking and Accelerating 30talex> procsProcedures:DISPLAY_INITIAL_REQ_MESSAGECSEG 0 PEP# 02 TNS Base: 05 TNS Size: 071 TNS Entry: 05Itanium code: 0x70420480 Itanium bundles: 0x3a Itanium entry:0x70420480Implemented in TAL in source file RUBY.$FC1.TGTNSE.MAINPline 36.0 to 44.0GET_SECOND_NUMBERCSEG 0 PEP# 04 TNS Base: 0345 TNS Size: 0154 TNS Entry: 0345Itanium code: 0x70421500 Itanium bundles: 0x6d Itanium entry:0x70421500Implemented in TAL in source file RUBY.$FC1.TGTNSE.CALLPline 10.0 to 27.0MAIN_PROGCSEG 0 PEP# 03 TNS Base: 076 TNS Size: 0247 TNS Entry: 076Itanium code: 0x70420820 Itanium bundles: 0xce Itanium entry:0x70420820Implemented in TAL in source file RUBY.$FC1.TGTNSE.MAINPline 46.0 to 84.0talex>
  31. 31. TNSVU Example — LOCALTNSVU Example — LOCAL3 - Linking and Accelerating 31talex> localLocal millicode routines:Entry: 0x70420090 NumBundles: 0x4 0 _LocalMilli_RPMispredictedEntry: 0x704200d0 NumBundles: 0x4 0 _LocalMilli_ToOCIEntry: 0x70420110 NumBundles: 0xe 0 _LocalMilli_EXITEntry: 0x704201f0 NumBundles: 0x6 0 _LocalMilli_MapTNStoIPF_CalcEntry: 0x70420250 NumBundles: 0x8 0 _LocalMilli_MapTNStoIPFEntry: 0x704202d0 NumBundles: 0x4 0 _LocalMilli_BTSTEntry: 0x70420310 NumBundles: 0x2 0 _LocalMilli_TNSArithOverflowEntry: 0x70420330 NumBundles: 0x4 0 _LocalMilli_64bitAddArithOvEntry: 0x70420370 NumBundles: 0x8 0 _LocalMilli_QMPYEntry: 0x70420000 NumBundles: 0x3 0 _LocalMilli_OCATraceEnterEntry: 0x70420030 NumBundles: 0x3 0 _LocalMilli_OCATraceExitEntry: 0x70420060 NumBundles: 0x3 0 _LocalMilli_OCATracePmapJumpEntry: 0x704203f0 NumBundles: 0x9 0 _LocalMilli_CallSharedMillitalex>
  32. 32. TNSVU Example — EXTERNALSTNSVU Example — EXTERNALS3 - Linking and Accelerating 32talex> externalsLibrary procedures external to this code spaceWRITEREADWRITESTOPPROCESS_GETINFO_PROCESS_DEBUG_NUMOUTNUMININITIALIZERFILE_OPEN_FILE_GETINFO_FILE_CLOSE_talex>
  33. 33. TNSVU Example — ICODETNSVU Example — ICODE3 - Linking and Accelerating 33icode DISPLAY_INITIAL_REQ_MESSAGEFC>Procedure DISPLAY_INITIAL_REQ_MESSAGE (from source file RUBY.$FC1.TGTNSE.MAINP)Itanium virtual address 0x70420480 for 0x3a Itanium bundlesCSEG 0 TNS offset 05 for 071 TNS instructions...37.0 write_count := @p - @s;016: 0x70420570:LADR G+0106,I {LADR G+0105,I + ld2 r46 = [r35]LSUB ld2 r45 = [r34]STOR G+0102 nop.i 00h ;;}{sub r45 = r45, r46adds r46 = 01ah, r0nop.i 00h ;;}{nop.m 00hzxt2 r45 = r45 ;;nop.i 00h}
  34. 34. Questions ?Questions ?34
  35. 35. 3 - Linking and Accelerating 35

×