noft Manual Abstract This publication explains how to use the TNS/R native object file utilities noft (T9626), which displays object files, and ar (T8629), which creates and maintains archives of object files. Product Version noft D45 ar D43 Supported Release Updates (RVUs) This publication supports G06.26 and all subsequent D-series and G-series RVUs until otherwise indicated by its replacement publication.
Document History Part Number Product Version 528273-001 noft D45 ar D43 Published April 2005
noft Manual Glossary Index Examples What’s New in This Manual vii Manual Information vii New and Changed Information About This Manual ix Audience ix Related Reading ix Notation Conventions Tables vii x 1. Introduction Native Object Files noft 1-2 ar 1-3 1-1 2. noft Utility Running the noft Utility in the Guardian Environment 2-1 Running the noft Utility in the OSS Environment 2-2 Listing Object Files 2-4 Dumping Object Files 2-4 Controlling the noft Environment 2-5 Debugging With noft 2-7 3.
3. noft Options (continued) Contents 3.
A. Sample nld and noft Session Contents A.
C. Native Object File Structure Contents C. Native Object File Structure Code and Data Segments MDEBUG Section C-2 C-1 Glossary Index Examples Example 2-1. Example 2-2. Example 2-3. Example 2-4. Example 2-5. Example 2-6. Example 3-1. Example 3-2. Example 3-3. Example 3-4. Example 3-5. Example 3-6. Example 3-7. Example 3-8. Example 3-9. Example 3-10. Example 3-11. Example 3-12. Example 3-13. Example 3-14. Example 3-15. Example 3-16. Example 3-17. Example 3-18. Example 3-19. Example 3-20. Example 3-21.
Examples (continued) Contents Examples (continued) Example 3-26. Example 3-27. Example 3-28. Example 3-29. Example 3-30. Example 3-31. Example 3-32. Example 3-33. Example 3-34. Example 3-35. Example 3-36. Example 3-37. Example 3-38. Example 3-39. Example 3-40. Example 3-41. Example 3-42. Example 3-43. Example 3-44. Example A-1. Example A-2. Example A-3. Example A-4. Example A-5. Example A-6. Example A-7. Example A-8. Example A-9. Example A-10. Example A-11. Example A-12. Example A-13. Example A-14.
Examples (continued) Contents Examples (continued) Example A-17. Example A-18. Example A-19. Example A-20. Example A-21. Example A-22. Example A-23. Example A-24. Example A-25. Example A-26. Example A-27. Example A-28. Example A-29. Example A-30. Example A-31. Example A-32. Example A-33. Example A-34. Example A-35. Example A-36.
What’s New in This Manual Manual Information noft Manual Abstract This publication explains how to use the TNS/R native object file utilities noft (T9626), which displays object files, and ar (T8629), which creates and maintains archives of object files. Product Version noft D45 ar D43 Supported Release Updates (RVUs) This publication supports G06.26 and all subsequent D-series and G-series RVUs until otherwise indicated by its replacement publication.
New and Changed Information What’s New in This Manual noft Manual— 528273-001 viii
About This Manual This manual explains how to use these TNS/R native object file utilities: • • noft, which displays object files ar, which creates and maintains archives of object files Topics: • • • Audience on page ix Related Reading on page ix Notation Conventions on page x Audience This manual is intended for systems programmers and application programmers who are familiar with: • • • HP NonStop™ servers HP NonStop operating system Reference manuals and programmer’s guides for the languages in
Notation Conventions About This Manual Notation Conventions • • • • Hypertext Links on page x General Syntax Notation on page -x Example Notation on page xii Change Bar Notation on page xii Hypertext Links Blue underline is used to indicate a hypertext link within text. By clicking a passage of text with a blue underline, you are taken to the location described. For example: This requirement is described under Backup DAM Volumes and Physical Disk Drives on page 3-2.
General Syntax Notation About This Manual { } Braces. A group of items enclosed in braces is a list from which you are required to choose one item. The items in the list may be arranged either vertically, with aligned braces on each side of the list, or horizontally, enclosed in a pair of braces and separated by vertical lines. For example: LISTOPENS PROCESS { $appl-mgr-name } { $process-name } ALLOWSU { ON | OFF } | Vertical Line.
Example Notation About This Manual Line Spacing. If the syntax of a command is too long to fit on a single line, each continuation line is indented three spaces and is separated from the preceding line by a blank line. This spacing distinguishes items in a continuation line from items in a vertical list of selections. For example: ALTER [ / OUT file-spec / ] CONTROLLER [ , attribute-spec ]...
1 Introduction The noft utility (or native object file tool) displays object files. The ar utility (or archive tool) creates and maintains archives of object files. The noft and ar utilities operate in the TNS/R native mode development environment on TNS/R native object files—both PIC (position-independent code) and non-PIC (nonposition-independent code) files. PIC and non-PIC native object files are generated by the native C, native C++, native COBOL, and pTAL compilers.
noft Introduction noft The noft utility reads and displays information from native object files.
ar Introduction ar Use the ar utility to: • • Create archives from groups of files Modify archives by: ° ° ° ° Adding files Extracting files Deleting files Replacing files Archives created by the ar utility can be used by the nld and ld utilities. When an archive contains one or more native (TNS/R) files, nld and ld can use that archive as an object file library. If an archive contains both TNS and TNS/R files, nld and ld cannot use that archive.
ar Introduction noft Manual— 528273-001 1 -4
2 noft Utility The noft utility, the native object file tool, displays all portions of native object files.
Running the noft Utility in the OSS Environment noft Utility output-filename specifies a Guardian file name to which noft writes its output. If you specify a disk file name and the file does not exist, noft creates an edit file. If the specified disk file exists, noft appends to the file. If you omit the OUT option, noft writes its output to your current default output file. option is one or more noft flags with their parameters, if any.
Running the noft Utility in the OSS Environment noft Utility • If an option includes an asterisk (*) or question mark (?) as a parameter, do either of: ° Enclose the option and its parameters in quotation marks; for example: noft -file sample "-listproc *" ° Enclose the entire sequence of options in quotation marks; for example noft "-file sample -listproc *" • • Do not include these options, which work only in an interactive session: ° ° ! (Exclamation Point) on page 3-4 FC on page 3-15 Do not
Listing Object Files noft Utility Listing Object Files Table 2-1. noft Listing Options Option Lists ...
Controlling the noft Environment noft Utility Controlling the noft Environment Table 2-3. noft Control Options (page 1 of 2) Option Description Break Key on page 3-3 Interrupts the processing of the current option. ! (Exclamation Point) on page 3-4 Executes a previously executed command line. CD on page 3-5 Changes the current working directory used to search for relative filenames. (Use only in OSS environment.) COMMENT on page 3-5 Allows comments in noft command files.
Controlling the noft Environment noft Utility Table 2-3.
Debugging With noft noft Utility Debugging With noft The dumping options (listed in Table 2-2 on page 2-4) can be useful when debugging optimized native object code, especially when you must debug code at the RISC instruction-level. Note. You must use Visual Inspect, rather than Inspect, to debug PIC executable files. Example 2-3.
Debugging With noft noft Utility Example 2-4 shows the noft output for the compute() function in Example 2-3 on page 2-7 compiled at optimize 0. The native compilers perform no optimizations at optimize 0. Example 2-4.
Debugging With noft noft Utility Example 2-5 shows the noft output for the compute() function in Example 2-3 on page 2-7 compiled at optimize 1. The native compilers perform many optimizations at optimize 1. Example 2-5.
Debugging With noft noft Utility Example 2-6 shows the noft output for the compute() function in Example 2-3 on page 2-7 compiled at optimize 2. The native compilers perform all possible optimizations at optimize 2. The “+” and “-” characters in the leftmost column indicate code that has been moved forward or backward in the execution stream. Example 2-6.
Debugging With noft noft Utility At optimization level 1, the native compiler: • • • Optimizes across statement boundaries to remove nop instructions. Uses registers instead of memory. Optimizes by finding common subexpressions. At optimization level 2, the native compiler: • • • • • Replaces the variable i with a derived pointer expression or an induction variable. Eliminates the parameter load and store operations at the procedure entrance by placing the code inline.
Debugging With noft noft Utility noft Manual— 528273-001 2- 12
3 noft Options An option is a flag and its parameters, if any. Use the noft options to specify the input object file, control the noft environment, and control the format of noft output. This section describes the syntax and semantics of noft options and provides examples of each option. Table 3-1 on page 3-1 lists the noft flags in alphabetic order.
noft Options Table 3-1. noft Flag Summary (page 2 of 3) Flag Description LIBLIST on page 3-22 Displays the library list of an object file created by the ld utility. LISTATTRIBUTE or LA on page 3-23 Lists process-specific information associated with an object file. LISTCOMPILERS or LC on page 3-25 Lists version information about the native compiler components and nld utility used to create an object file. LISTOPTIMIZE or LO on page 3-27 Lists procedures based on the optimization level.
Break Key noft Options Table 3-1.
! (Exclamation Point) noft Options ! (Exclamation Point) Note. This option works only in an interactive session. The ! (exclamation point) option executes a previously executed command. ! [ history-number | -history-offset | text ] history-number is the history-buffer number of the command to be reexecuted. -history-offset is a negative offset from the command that history-number represents. The immediately preceding command is -1. text is a string of characters.
CD noft Options CD Note. OSS environment only. Similar Guardian commands are SYSTEM or VOLUME on page 3-49. The CD option changes the current working directory, which noft searches for relative pathnames. CD [ pathname ] pathname is the OSS directory pathname of the directory that is to become the current working directory. The maximum size of pathname is 255 characters. The default pathname is the startup directory. Note. The noft utility does not verify the validity of the specified pathname.
DUMPADDRESS or DA noft Options DUMPADDRESS or DA The DUMPADDRESS option displays code and data from a virtual address inside an object file’s memory space. Because all sections in linkfiles start at zero, use DUMPOFFSET or DO on page 3-8 to display section other than the text section. [ DUMPADDRESS | DA ] start-address [ range-specifier ] [ IN format-specifier ] start-address is the starting virtual address in hexadecimal format.
DUMPADDRESS or DA noft Options { HEX | H } displays portions of the object file in hexadecimal format. { ICODE | IC } displays portions of the object file in disassembled program code. This is the default. { INNERLIST | IN } displays portions of the object file in disassembled program code and displays the source code interspersed with the code. Use this option for displaying text. { OCTAL | O } displays portions of the object file in octal format.
DUMPOFFSET or DO noft Options DUMPOFFSET or DO The DUMPOFFSET option displays code and data from a physical offset within an object file. { DUMPOFFSET | DO } start-address [range-specifier] [IN format-specifier] start-address is the starting virtual address in hexadecimal format. range-specifier is the amount of information to display: { TO end-address | FOR { number { BYTES | B | WORDS | W } | * }} end-address is an ending virtual address in hexadecimal format.
DUMPOFFSET or DO noft Options { ICODE | IC } displays portions of the object file in disassembled program code. This is the default. { INNERLIST | IN } displays portions of the object file in disassembled program code and displays the source code interspersed with the code. Use this option for displaying text. { OCTAL | O } displays portions of the object file in octal format.
DUMPPROC or DP noft Options DUMPPROC or DP The DUMPPROC option displays the contents of a procedure or part of a procedure. { DUMPPROC | DP } { proc-spec | proc-num } [ { offset } [range-specifier]] [IN format-specifier] proc-spec specifies the procedure name, which is case-sensitive in C and C++ but not in other languages. procedure-spec is one of: proc-name limits the scope to the specified procedure and subprocedures. proc-name.subproc-name limits the scope to the specified subprocedure.
DUMPPROC or DP noft Options Considerations: • • The range of offsets must appear entirely within one of the specified procedures. If the offset range is outside the procedure, the output stops at the end of the procedure and noft emits an error message. The address of a code section is rounded up to a whole number of words. format-specifier specifies how the information is to be formatted. format-specifier is one of: { ASCII | A } displays portions of the object file in ASCII format.
DUMPPROC or DP noft Options Example 3-4. DUMPPROC Option noft> dumpproc rollem in innerlist ******** Innerlist Dump Of Procedure: rollem ******** Procedure Src Line Address Long Word Instructions ------------------------------------------------------------------------Source File: $GUEST.GAMES.
DYNSTR2 noft Options DYNSTR2 Note. Use this option only with an object file created by the ld utility, which does not have a Dynstr2 Section (see Example 3-6 on page 3-14). The DYNSTR2 option displays the target object file’s Dynstr2 Section (if any). The Dynstr2 Section contains the dynamic string information to which the library list and the rld search lists point. This string information is specified by the ld options -lib, -rld_first_l, and -rld_l when the object file is built.
ENV noft Options Example 3-5. DYNSTR2 Option With Object File Created by ld Utility (page 2 of 2) noft session > noft;file junc110;dynstr2 Object File File Format Scope Case ******** : : : : \SPEEDY.$DATA06.KMZPICEX.junc110 ELF (none) Sensitive Readable Dump of Dynstr2 Section ******** Index Value ------------------000000 000001 L1FSH1 000008 L2FSL1 000015 $data06.kmztacl:$data06.kmzens 000046 kmzepc:$data06.kmzpicp2:$data06.
EXIT or E noft Options EXIT or E The EXIT option stops the noft process. { EXIT | E } The noft process stops if you enter the EXIT option. When noft is run noninteractively as a process, it also stops when the command-line arguments are exhausted or when it reaches the end-of-file in an OBEY command file (see OBEY on page 3-40) or a TACL RUN command IN parameter input file. FC Note. This option works only in an interactive session.
FILE or F noft Options FILE or F Note. When you run noft from the command line, you must include this option. The FILE option specifies the name of the target object file you want to use with noft. A subsequent FILE option closes the current object file and opens the specified object file. { FILE | F } { filename | ? } filename specifies the name of the target object file. filename is a Guardian file name when noft is running in the Guardian environment.
HELP or ? noft Options • • • • Any FILE option clears the current scope and case target file parameters. (Target file parameters are described in SET on page 3-43.) The FILE option sets the case target file parameter, depending on the source files inside the object file. noft resolves Guardian file names by using the default volume and subvolume established with the option SYSTEM or VOLUME on page 3-49. noft resolves OSS filenames by using the default directory established with CD on page 3-5.
HELP or ? noft Options Example 3-9. HELP ALL Option noft> help all NOFT Help...
HELP or ? noft Options Example 3-10. HELP SET HISTORYBUFFER noft> help set historybuffer SET HISTORYBUFFER This option changes the amount of commands held in memory and available for the user to access via a FC or HISTORY command. The default buffer size is 50 commands. Syntax: { SET HISTORYBUFFER | SHB } [ number | ? ] HISTORYBUFFER number changes the NOFT command buffer to hold the specified number of commands.
HISTORY or H noft Options HISTORY or H Note. Use this parameter only in interactive sessions, because options given in the command line are not stored in the history buffer. The HISTORY option displays previously entered noft command lines. { HISTORY | H } [ number ] number specifies the number of command lines to be displayed. The default is 10 lines. Example 3-12. HISTORY Option noft> HISTORY 7 8> file /G/qtal/jasonoft/testo 9> set historywindow 7 10> listproc * sss $qtal.jasonoft.
LAYOUT noft Options LAYOUT The LAYOUT option lists the parts of an object file in order by file offset. LAYOUT Example 3-13.
LIBLIST noft Options LIBLIST Note. This option is useful only with an object file created by the ld utility, which does not have a Liblist Section (see Example 3-15 on page 3-22). The LIBLIST option displays the object file’s Liblist Section (if any). The Liblist section contains the dynamic string information to which the library list points. This string information is specified by the ld option -lib when the object file is built.
LISTATTRIBUTE or LA noft Options LISTATTRIBUTE or LA The LISTATTRIBUTE option lists process-specific information associated with an object file.
LISTATTRIBUTE or LA noft Options Example 3-17.
LISTCOMPILERS or LC noft Options LISTCOMPILERS or LC The LISTCOMPILERS option lists version information about the native compiler components and nld utility used to create an object file. { LISTCOMPILERS | LC } [ BRIEF | B | DETAIL | D] BRIEF B provides minimal information about each source file. This is the default. DETAIL D provides detailed information about each object file. The version information includes the product T-number, the product version, and the platform on which the product was run.
LISTCOMPILERS or LC noft Options Example 3-19. LISTCOMPILERS Option (DETAIL) (page 2 of 3) Filename File Number R_REFSHFT Compiler Front End Back End Optimizer Back End Code Generator Back End Assembler : : : : : : \CYCLONE.$PTAL.KMZMAIN.PROGHDRQ 4 (not available) (not available) (not available) (not available) Filename File Number R_REFSHFT Compiler Front End Back End Optimizer Back End Code Generator Back End Assembler : : : : : : \CYCLONE.$PTAL.KMZMAIN.
LISTOPTIMIZE or LO noft Options Example 3-19. LISTCOMPILERS Option (DETAIL) (page 3 of 3) Filename T8432,D44AAD/T8432/./rtversn.c File Number C Compiler Front End Back End Optimizer Back End Code Generator Back End Assembler : /tmp_mnt/designs/runtime/natived40/ : : : : : 62 T9577D43_T9225D43_30AUG97_CFE_20MAR97_ T8304DX1_01NOV96_06JAN97_SUN T8304DX1_01NOV96_06JAN97_SUN T8304DX1_01NOV96_06JAN97_SUN noft> LISTOPTIMIZE or LO The LISTOPTIMIZE option lists procedures based on their optimization level.
LISTPROC or LP noft Options LISTPROC or LP The LISTPROC option lists procedures and their subprocedures. { LISTPROC | LP } { proc-spec | proc-num | * } [ SUBPROC | SP | NOSUBPROC | NSP ] [ BRIEF | B | DETAIL | D] proc-spec specifies the procedure name, which is case-sensitive in C and C++ but not in pTAL. proc-spec is one of: proc-name limits the scope to the specified procedure and subprocedures.
LISTPROC or LP noft Options BRIEF B provides minimal information about procedures and subprocedures. This is the default. DETAIL D provides detailed information about procedures and subprocedures. For C++ functions, DETAIL provides the “demangled” (original) names as well as the “mangled” internal equivalents. The scope settings apply only to the list of procedures. Example 3-21.
LISTSOURCE or LS noft Options LISTSOURCE or LS The LISTSOURCE option lists the source files in an object file. { LISTSOURCE | LS } source-spec [ BRIEF | B | DETAIL | D ] source-spec { source-name | source-number | * } source-name is the name of a source file to be listed. source-number is the number of a source file to be listed. * lists every source file in the object file. BRIEF B displays minimal information about source files. This is the default.
LISTSRLEXPORTS or LLE noft Options Example 3-24. LISTSOURCE Option (DETAIL) noft> listsource * detail ******** List of Source Files Number Name Size Address of First Procedure Language Optimization Level Default Symbols Compilation Timestamp Modification Timestamp ******** : : : : : : : : : 0 \CYCLONE.$PTAL.KMZRLD.DLL1C 432 bytes 0x76100390 C++ 0 Yes 2000 June 27, 17:32:06 2000 June 27, 17:32:00 noft> LISTSRLEXPORTS or LLE The LISTSRLEXPORTS or LLE option lists all the symbols exported by an SRL.
LISTSRLINFO or LLI noft Options LISTSRLINFO or LLI The LISTSRLINFO option lists the SRLs linked into an object file. { LISTSRLINFO | LLI } [ BRIEF | B | DETAIL | D] BRIEF displays minimal information about SRLs. This is the default. DETAIL displays detailed information about SRLs. Example 3-25. LISTSRLINFO Option (BRIEF) noft> listsrlinfo SRL Name : ZCRESRL : ZCRTLSRL : # 0 1 Example 3-26.
LISTUNREFERENCED or LUR noft Options LISTUNREFERENCED or LUR The LISTUNREFERENCED or LUR option lists the undefined and unreferenced symbols in a pTAL object file. These symbols must be linked before the object file can be executed. (Compare this option with the option LISTUNRESOLVED or LU on page 3-36.) To find the functions in an object file that are never referenced, use the option XREFPROC or XP on page 3-50.
LISTUNREFERENCED or LUR noft Options The pTAL program in Example 3-27 explicitly declares two external functions, unresolved and unreferenced. The program also refers implicitly to the function stop. The program uses the function unresolved, but does not use the function unreferenced. Example 3-27.
LISTUNREFERENCED or LUR noft Options The C program in Example 3-29 is equivalent to the pTAL program in Example 3-27 on page 3-34. Example 3-29.
LISTUNRESOLVED or LU noft Options LISTUNRESOLVED or LU The LISTUNRESOLVED option lists the unresolved symbols in an object file. These references must be resolved before the file can be executed. (Compare this option with the option LISTUNREFERENCED or LUR on page 3-33.) { LISTUNRESOLVED | LU } { PROC | P | DATA | D | * } [ BRIEF | B | DETAIL | D | EXCLUDE | E ] PROC P displays unresolved procedures. DATA D displays unresolved data items. * displays all unresolved items.
LISTUNRESOLVED or LU noft Options Example 3-31. LISTUNRESOLVED Option (BRIEF) noft> # 4 5 10 11 listunresolved * brief Unresolved Name proc4__Fv proc3__Fv __nw__FUi __dl__FPv noft> Example 3-32.
LISTUNRESOLVED or LU noft Options If the program in Example 3-27 on page 3-34 is compiled and made executable and the program file is designated to noft with the option FILE or F on page 3-16, Example 3-33 shows the result of the LISTUNRESOLVED option. Compare Example 3-33 to Example 3-30 on page 3-35, which shows the result of the LISTUNREFERENCED option. Example 3-33.
LOG noft Options LOG The LOG option writes a copy of the current noft session’s input and output to a file named log. [ SET ] LOG { filename [B] | OFF | ? } filename specifies the name of the log file. If the file exists, noft appends the log output to it. If the file does not exist, noft creates it. filename is a Guardian file name when noft is running in the Guardian environment. filename is an OSS pathname when noft is running in the OSS environment.
OBEY noft Options OBEY The OBEY option directs noft to read command lines from a specified command file. OBEY filename filename is the name of the OBEY command file. filename is a Guardian file name when noft is running in the Guardian environment. filename is an OSS pathname when noft is running in the OSS environment. The maximum size of the OSS pathname is 255 characters. Considerations: • Additional OBEY options can appear within an OBEY command file.
QUIT or Q noft Options OFF redirects output to the standard output file. ? displays the name of the current output file. Because the name of the file is written to the file itself, you see the name only if the output file is the standard output file. See Example 3-38 on page 3-41. Consideration: • When sending large amounts of output to a log file in the Guardian environment, you might exceed the default file-size limits.
RESET noft Options RESET The RESET option resets one or more noft target object file parameters previously specified with SET on page 3-43 to their default values. RESET { set-param | *} set-param is one of these target object file parameters: CASE FORMAT HISTORYBUFFER HISTORYWINDOW LINES LOG OUT SCOPEPROC SCOPESOURCE SORT * specifies that all target object file parameters are reset to their default values. The target object file parameters are defined in SET on page 3-43. Example 3-39.
SET noft Options SET The SET option sets one or more noft target object file parameters to specified values.
SET noft Options OFF turns off case-sensitivity in the noft environment. If turned off, some files and procedures written in C or C++ are unavailable. ? returns the current case-sensitivity setting. FORMAT { ASCII | A |DECIMAL | D | HEX | H | ICODE | IC | INNERLIST | IN | OCTAL | O | ? } specifies the format to use to display the object file. ASCII A displays portions of the object file in ASCII format. DECIMAL D displays portions of the object file in decimal format.
SET noft Options HISTORYBUFFER [ history-buffer-number | ? ] Note. Use this parameter only in an interactive session, because options given in the command line are not stored in the history buffer. specifies the number of command lines in memory available to ! (Exclamation Point) on page 3-4, FC on page 3-15, and HISTORY or H on page 3-20. history-buffer-number is an integer in the range 0 through 65,535 that specifies the number of command lines in the history buffer. The default is 50.
SET noft Options LOG { filename [B] | OFF | ? } is described in LOG on page 3-39 (note that the keyword SET is optional with LOG). OUT { filename [B] | OFF | ? } is described in OUT on page 3-40 (note that the keyword SET is optional with OUT). SCOPEPROC { proc-spec | proc-num | * | ? } narrows the scope of noft options to a single procedure or subprocedure. Use this option to find unique items within a procedure or subprocedure and to limit output to a range within a single scope.
SET noft Options SCOPESOURCE { filename | file-number | * | ? } narrows the scope of noft options to a single source file. Use this option to find unique items within a source file and to limit the output to a range within the designated source file. filename is a Guardian file name when noft is running in the Guardian environment. filename is an OSS pathname when noft is running in the OSS environment. The maximum size of the OSS pathname is 255 characters.
SHOW noft Options ? returns the current sorting order. SHOW The SHOW option displays the current values of the noft program environment parameters and the target object file parameters. It is a superset of ENV on page 3-14. SHOW [ * ] Example 3-40.
SYSTEM or VOLUME noft Options SYSTEM or VOLUME Note. This option is valid only in the Guardian environment. A similar OSS command is CD on page 3-5. The SYSTEM or VOLUME option specifies the default node, volume, and subvolume names that noft uses to resolve partially qualified Guardian file names. { SYSTEM } [ \node-name { VOLUME } [ $volume-name [ subvolume-name [ $volume-name.subvolume-name [ \node-name.$volume-name [ \node-name.$volume-name.subvolume-name ] ] ] ] ] ] node-name is a node name.
XREFPROC or XP noft Options XREFPROC or XP The XREFPROC option displays an alphabetic cross-reference listing of procedures. These procedures are those shown by both the option LISTPROC or LP on page 3-28 and the option LISTUNRESOLVED or LU on page 3-36. { XREFPROC | XP } { proc-spec | proc-num | * } [ CALLEDBY | CALLS | BOTH ] [ BRIEF | B | DETAIL | D] proc-spec specifies the procedure name, which is case-sensitive in C and C++ but not in COBOL or pTAL.
XREFPROC or XP noft Options CALLS lists each procedure and the procedures it calls. A scope setting restricts the procedures who are the parents of the given procedure. BOTH list the information for both CALLEDBY and CALLS. BRIEF B lists the called or calling procedures referenced by the indicated procedures. This is the default. DETAIL D lists the called or calling procedures referenced by the indicated procedures and the addresses where the calls are made.
XREFPROC or XP noft Options Example 3-41.
XREFPROC or XP noft Options If the program in Example 3-29 on page 3-35 is compiled and made executable and the program file is designated to noft with the option FILE or F on page 3-16, Example 3-43 on page 3-53 shows the result of the XREFPROC option. Example 3-43.
XREFPROC or XP noft Options noft Manual— 528273-001 3- 54
4 noft Diagnostic Messages This section lists messages in numeric order and grouped by type. Missing numbers in message sequences are reserved for future development. Topics: • • • • Fatal Errors on page 4-1 Data Errors on page 4-5 Warnings on page 4-18 Syntax Errors on page 4-22 Fatal Errors *** FATAL ERROR *** [1]: Cannot begin to allocate memory for cross reference data. Cause. noft cannot allocate memory, probably because noft has an internal problem. Recovery.
Fatal Errors noft Diagnostic Messages *** FATAL ERROR *** [4]: Error reading object file: filename. Cause. A file input or output error occurred or there is a bad end-of-file. Recovery. Restart noft and then rebuild the object file. *** FATAL ERROR *** [6]: Integrity problem detected in function name. Cause. An integrity check failed in the function name, probably because of an internal error. Recovery.
Fatal Errors noft Diagnostic Messages *** FATAL ERROR *** [10]: More than one object file specified. Cause. Stated in message. Recovery. Reenter the noft run command, specifying only one object file for input. *** FATAL ERROR *** [11]: Unable to add text for token text. Cause. noft cannot allocate memory, probably because noft has an internal problem. Recovery. Give the object file being examined and the series of commands that you used to your service provider for analysis.
Fatal Errors noft Diagnostic Messages *** FATAL ERROR *** [15]: Unable to complete the command option: command-name. Cause. The specified flag, command-name, was not accepted on the same line. Recovery. Enter SET on a separate line, and then enter LIST or DUMP. *** FATAL ERROR *** [16]: Unable to continue getting cross reference data. Cause. noft cannot allocate memory, probably because noft has an internal problem. Recovery.
Data Errors noft Diagnostic Messages Data Errors *** DATA ERROR *** [1000]: Cannot dump out by procedure/source name because the object file does not contain full symbols. Cause. The object file was stripped of its symbol table. Recovery. Rebuild the object file with symbols information. *** DATA ERROR *** [1001]: Cannot find end of file. Cause. The object file was stripped of its symbol table. Recovery. Rebuild the object file with symbols information.
Data Errors noft Diagnostic Messages *** DATA ERROR *** [1005]: Could not find source file associated with procedure. Cause. LISTCOMPILERS could not find the appropriate source file, possibly the result of setting limits with SET SCOPEPROC or SET SCOPESOURCE. Recovery. Use SHOW on page 3-48 to see if there is any scoping. If there is, either reset the scope or change the scope. *** DATA ERROR *** [1006]: This duplicate function has been eliminated by the linker. Cause.
Data Errors noft Diagnostic Messages *** DATA ERROR *** [1009]: Did not find any ELF symbols belonging to source file, check options and full table-name table. Cause. Stated in message. Recovery. Stated in message. *** DATA ERROR *** [1010]: Did not find any external symbols belonging to name, check options and full external table. Cause. Stated in message. Recovery. Stated in message.
Data Errors noft Diagnostic Messages *** DATA ERROR *** [1014]: Did not find any runtime symbols belonging to source file, check options and rpd table. Cause. Stated in message. Recovery. Stated in message. *** DATA ERROR *** [1015]: Did not find any undefined symbols matching scope. Cause. No undefined symbols exist in the current scope. Recovery. Examine the entire object file (instead of a procedure or source file) for unresolved symbols information.
Data Errors noft Diagnostic Messages *** DATA ERROR *** [1020]: No object file open. Cause. The specified object file is not open. Recovery. Use FILE or F on page 3-16 to specify the object file, and then reissue the desired command. *** DATA ERROR *** [1021]: No optional header, not a valid COFF file. Cause. Stated in message. Recovery. Rebuild the object file. *** DATA ERROR *** [1022]: No procedures at specified optimization level. Cause. No procedures exist at the specified optimization level.
Data Errors noft Diagnostic Messages *** DATA ERROR *** [1026]: Not an ELF file: filename. Cause. The first few bytes of the object file are corrupt. Recovery. Rebuild the object file. *** DATA ERROR *** [1028]: Object file has been at least partially stripped, unable to continue. Cause. The object file is partially stripped of its symbols information. Recovery. Rebuild the object file with complete symbols information. *** DATA ERROR *** [1029]: PROC command only works on object files with symbols.
Data Errors noft Diagnostic Messages *** DATA ERROR *** [1033]: Procedure not found in object file: procedure-name. Cause. Stated in message. Recovery. Check the list of procedures to see if the procedure is actually in the object file. If not, rebuild the object file. *** DATA ERROR *** [1034]: Some problem printing text. Cause. An internal table is corrupt. Recovery. Restart noft and reissue the commands in question.
Data Errors noft Diagnostic Messages *** DATA ERROR *** [1037]: Specified address(es) not found. Cause. noft cannot find the specified addresses in the object file. Recovery. Verify that the addresses exist in the object file, and rebuild the object file with complete symbols information. *** DATA ERROR *** [1038]: This command only works on ELF files. Cause. A COFF file was specified for a command that works only on ELF files. Recovery. Specify an ELF file instead of the COFF file.
Data Errors noft Diagnostic Messages *** DATA ERROR *** [1042]: Unable to determine instruction. Cause. noft could not find the opcode for the last address. Recovery. Verify that the ICODE is dumped into a code section. *** DATA ERROR *** [1043]: Unable to dump some unresolved items. Cause. An internal table is corrupt. Recovery. Restart noft and reenter the command. *** DATA ERROR *** [1044]: Unable to locate current [directory|subvolume]. Cause.
Data Errors noft Diagnostic Messages *** DATA ERROR *** [1047]: Unable to read table-name procedure table, command ignored. Cause. Either the loadfile is stripped, or the procedure table is corrupted. Recovery. Rebuild the loadfile without stripping. *** DATA ERROR *** [1048]: Unable to reset option, please reset manually. Cause. FILE or F on page 3-16 encountered a problem when trying to SET SCOPEPROC, SET SCOPESOURCE, and SET CASE to their defaults. Recovery.
Data Errors noft Diagnostic Messages *** DATA ERROR *** [1052]: Unable to allocate memory for obey file: filename. Cause. noft cannot allocate memory, probably because noft has an internal problem. Recovery. Give the object file being examined and the series of commands that you used to your service provider for analysis. *** DATA ERROR *** [1053]: Cannot dump this ELF file because it has no section headers. Cause. Stated in message. Recovery. Rebuild the object file.
Data Errors noft Diagnostic Messages *** DATA ERROR *** [1057]: Unable to dump srl fixup item. Cause. LISTSRLEXPORTS or LLE on page 3-31 was limited by either SET SCOPEPROC or SET SCOPESOURCE. An error occurred while attempting to display the information. Recovery. Use RESET on page 3-42 to reset the scope to its default. *** DATA ERROR *** [1058]: Did not find any procedures matching scope. Cause. LISTPROC or LP on page 3-28 was limited by either SET SCOPEPROC or SET SCOPESOURCE.
Data Errors noft Diagnostic Messages *** DATA ERROR *** [1061]: The Guardian file system error number number occurred while trying to construct the filename qualifier. Cause. The Guardian file system error number occurred when the Guardian function FILENAME_RESOLVE_ tried to build a directory name from existing pieces as a result of processing the command SYSTEM or VOLUME on page 3-49. Recovery. Verify that SYSTEM or VOLUME on page 3-49 specifies a valid node, volume, and subvolume.
Warnings noft Diagnostic Messages *** DATA ERROR *** [1065]: RESET SCOPEPROC before using LISTUNRESOLVED command. Cause. You used LISTUNREFERENCED or LUR on page 3-33 while SET SCOPEPROC was active. These commands are incompatible. If the scope has been set to a specific procedure, the procedure must be resolved. Rather than show an empty list, noft issues this error so that you can reset the scope and reissue the command. Recovery.
Warnings noft Diagnostic Messages *** WARNING *** [2003]: Selected file has greater version number than noft. Cause. The specified object file was created with later versions of native mode compilers and linker than noft supports; therefore, noft might not be able to read the object file format. Recovery. Use a later version of noft. *** WARNING *** [2004]: Specified range jumps section boundaries, dumping to end of section. Cause.
Warnings noft Diagnostic Messages *** WARNING *** [2008]: No cross reference information available in this category for procedure procedure-name. Cause. LISTPROC or LP on page 3-28 or XREFPROC or XP on page 3-50 could not find the specified procedure. Recovery. Use LISTPROC * or XREFPROC * to see what procedures are available. *** WARNING *** [2009]: Cannot convert line number to Tandem edit line number. Cause.
Warnings noft Diagnostic Messages *** WARNING *** [2012]: SEGMENT_DEALLOCATE_ had the following result: result Cause. This error can occur only in the Guardian environment. Recovery. Check the result in the Guardian Procedure Calls Reference Manual (see SEGMENT_DEALLOCATE_). Based on that information, take appropriate action. *** WARNING *** [2013]: LISTUNRESOLVED Exclude option not supported on PIC objects, option ignored... Cause.
Syntax Errors noft Diagnostic Messages Syntax Errors *** SYNTAX ERROR *** [3000]: command requires a decimal number. Cause. You can only specify a decimal number for a procedure or source file. Recovery. Recompute the number in decimal format. *** SYNTAX ERROR *** [3001]: command number Event not found. Cause. Either the specified command number is higher than the current command number, or the command number specified is out of the history buffer. Recovery.
Syntax Errors noft Diagnostic Messages *** SYNTAX ERROR *** [3005]: Address specification not properly formed. Cause. Part of the syntax of an address range is missing. Recovery. Correct the syntax of DUMPADDRESS or DA on page 3-6. *** SYNTAX ERROR *** [3006]: Addresses are in the form 0xXXXXXXXX text. Cause. Supported address formats are only 8-digit hexadecimal numbers starting with “0x ”. Recovery. Recompute the addresses to hexadecimal in this format.
Syntax Errors noft Diagnostic Messages *** SYNTAX ERROR *** [3010]: Command COMMENT: end of file reached. Cause. COMMENT on page 3-5 has reached the end of the file. Recovery. Reenter the comment text. *** SYNTAX ERROR *** [3011]: Command specific option did not change settings, command aborted. Cause. noft cannot determine if the option is the one intended, so noft does not stream large amounts of output. Recovery. Do not respecify options or settings that have already been set with DUMP or LIST.
Syntax Errors noft Diagnostic Messages *** SYNTAX ERROR *** [3015]: Incorrect path specification syntax. Cause. You specified two or more subvolumes. Recovery. Specify only one subvolume. *** SYNTAX ERROR *** [3016]: Invalid formatting parameter, command ignored. Cause. SET FORMAT has an invalid option. Recovery. Reissue SET FORMAT, using a valid option (see SET on page 3-43). *** SYNTAX ERROR *** [3017]: Invalid optimization level specified. Cause. LISTOPTIMIZE or LO on page 3-27 has an invalid level.
Syntax Errors noft Diagnostic Messages *** SYNTAX ERROR *** [3021]: No SRL references in procedure, command ignored. Cause. This error occurs for the undocumented SRLINFO command. It indicates that no information was returned for the range restricted by either SET SCOPESOURCE or SET SCOPEPROC. Recovery. Either use RESET on page 3-42 to reset the scope to its default or use SET on page 3-43 to change the scope. To see the current scope, use SHOW on page 3-48.
Syntax Errors noft Diagnostic Messages *** SYNTAX ERROR *** [3025]: No symbol table available, command ignored. Cause. This error occurs for various undocumented commands. It indicates that either a SET SCOPESOURCE command or SET SCOPEPROC command was given, but there was no symbol table. Recovery. Either use RESET on page 3-42 to reset the scope to its default, use SET on page 3-43 to change the scope, or recompile the program with symbol information. To see the current scope, use SHOW on page 3-48.
Syntax Errors noft Diagnostic Messages *** SYNTAX ERROR *** [3029]: Unable to find procedure in object file. Cause. noft cannot find the specified procedure name. Recovery. Verify that the specified procedure exists in the object file and that its name is spelled correctly. Use LISTPROC * SET SCOPESOURCE source-file, where source-file is the name of the source file that contains the procedure or the number of the source file. (See LISTPROC or LP on page 3-28 and SET on page 3-43.
Syntax Errors noft Diagnostic Messages *** SYNTAX ERROR *** [3034]: Some problem dumping name. Cause. This error occurs for several undocumented commands and indicates that no information was found in the scope. Recovery. Either use RESET on page 3-42 to reset the scope to its default or use SET on page 3-43 to change the scope. To see the current scope, use SHOW on page 3-48. *** SYNTAX ERROR *** [3035]: Source file filename not in correct position. Cause.
Syntax Errors noft Diagnostic Messages *** SYNTAX ERROR *** [3038]: Specified range not within a text section. Cause. noft cannot find the specified addresses in the object file. Recovery. Verify that the addresses exist in the object file. Rebuild the object file with complete symbols information. *** SYNTAX ERROR *** [3039]: The CD command is not for the Guardian OS, try the SYSTEM and VOLUME commands. Cause. The CD command works only in the OSS environment. Recovery.
Syntax Errors noft Diagnostic Messages *** SYNTAX ERROR *** [3043]: Unable to find ELF symbol to correspond with correct procedure. Cause. This error occurs for the undocumented RELOC command. It indicates that a SET SCOPEPROC command was given, but no symbol table was found. Recovery. Either use RESET on page 3-42 to reset the scope to its default, use SET on page 3-43 to change the scope, or recompile the module with symbols. To see the current scope, use SHOW on page 3-48.
Syntax Errors noft Diagnostic Messages *** SYNTAX ERROR *** [3048]: Unable to find line number in history. Cause. The number is out of the history buffer range. Recovery. Use the SET HISTORYBUFFER command to set the size of the history buffer (see SET on page 3-43). *** SYNTAX ERROR *** [3049]: Unable to find string string in history. Cause. The string was not found at the beginning of any lines in the current history buffer. Recovery. Verify that the command is still in the current history buffer.
Syntax Errors noft Diagnostic Messages *** SYNTAX ERROR *** [3053]: Unable to open object file filename, command ignored. Cause. One of: • • • The object file cannot be found. The object file cannot be opened because it is corrupted. The object file is already open for writing. Recovery. Verify that the object file name is spelled correctly and is in the current directory. Verify that the object file is not in use. Rebuild the object file.
Syntax Errors noft Diagnostic Messages *** SYNTAX ERROR *** [3059]: In range option, option-name. Cause. A syntax error was encountered while parsing range information. Additional text is provided with the error. Recovery. Reenter the command with the correct range clause. *** SYNTAX ERROR *** [3060]: Extraneous characters at end of range option. Cause. A syntax error was encountered while parsing range information. Recovery. Reenter the command with the correct range clause.
Syntax Errors noft Diagnostic Messages *** SYNTAX ERROR *** [3064]: Only subvolume level and above allowed. Cause. In SYSTEM or VOLUME on page 3-49, the combination of node, volume, and subvolume was invalid (for example, VOLUME $VOL1.SUBVOL2.FILE3). Recovery. Give the SYSTEM or VOLUME option a valid combination of node, volume, and subvolume.
Syntax Errors noft Diagnostic Messages noft Manual— 528273-001 4- 36
5 ar Utility The ar utility creates and maintains archives composed of groups of object files. You can mix PIC and non-PIC files in an archive. After an archive has been created, new files can be added, and existing files can be extracted, deleted, or replaced.
ar Utility Name Function (page 2 of 2) -r Replace or add files to the archive. If the archive specified by archive does not exist, ar creates a new archive and writes a diagnostic message to the standard error (unless you specify the -c option). If no files are specified and the archive exists, no changes are made to that archive. Files that replace existing files do not change the order of the archive. Files that do not replace existing files are appended to the archive.
ar Utility modifier-option is an ar option that gives instructions for the operation of the action-option. A modifier-option is one of: Name Function (page 1 of 2) -a Position new files in the archive after the file specified by the position-name operand. -b Position new files in the archive before the file specified by the position-name operand. -c Suppress the diagnostic message that would be written to standard error by default when the archive file is created.
ar Utility Name Function (page 2 of 2) -v Give verbose output. • • • When used with the -d, -r, or -x options, this option causes ar to write the name of each file involved in archiving operations. When used with -p, this option causes ar to write the name of each file to the standard output before writing the file itself to the standard output.
ar Utility archive depends on the platform, as follows: Environment archive Guardian is the path name of the archive file to be created or modified. Archives created in the Guardian environment are given file code 700. OSS is the file name of the archive file to be created or modified. PC is the file name of the archive file to be created or modified. It can be partially or fully qualified and can include system and folder names.
ar Utility ar accepts many types of files as archive members. ar recognizes two types of HP object files: TNS and TNS/R. All other files, including text files, are considered targetindependent files. Only archives composed entirely of the same kind of HP object file and target-independent files contain an archive symbol table and are suitable for use by Binder or nld.
6 ar Diagnostic Messages The ar utility produces messages when errors occur in command input or in data on which the utility is operating. These messages are in alphabetic order. ar: archive: Guardian or User Defined Error 43 Unable to obtain disk space for file extent. Cause. The maximum size of an archive file is 128,073,728 bytes.
ar Diagnostic Messages ar: member: encountered error errnum. Cause. When building an archive in the Guardian environment, ar encountered a file system error identified by the number errnum when processing the specified member. The archive should be intact except for the member that caused the error. Recovery. Correct the error condition and add the member to the archive using the -r option, and also specifying a or b if the position of the member is relevant. ar: member: file too large. Cause.
ar Diagnostic Messages archive, cannot open archive to set permissions. Cause. An I/O error occurred in the Guardian environment when ar attempted to open the specified archive to set the file permissions. Recovery. Use the FUP utility to look at the permissions on the archive and make any corrections needed. archive, cannot reopen to add symbol table. Cause. An I/O error occurred when the specified archive was being reopened prior to constructing the archive symbol table. Recovery.
ar Diagnostic Messages archive, not a valid archive file. Cause. In the Guardian environment, a file specified as an existing archive must be an odd, unstructured file having file code 700. Recovery. If archive refers to a file that is not currently in archive format, delete that file and reenter the ar command. If archive refers to an archive that was built by the ar utility in another environment, check the file code of that file using the FUP utility. If the file code is not 700, change it using FUP.
ar Diagnostic Messages file name filename: filename too long for filesystem. Cause. During an extract (-x) operation, the file name of the specified file is longer than the maximum supported by the file system. The specific member is not extracted. Recovery. Use the -T option to truncate the file name to the maximum length allowed by the File System during extraction. illegal option combination for option. Effect. The identified option combination is not allowed. Recovery. Reenter the command correctly.
ar Diagnostic Messages no position operand specified. Cause. A positional option must be followed by a position operand preceding the name of the archive. Recovery. Reenter the command correctly. no archive members specified. Cause. An ar command with the operational option specified requires file-member operands. Recovery. Reenter the command correctly. no archive specified. Cause. An archive file is not specified in the command.
ar Diagnostic Messages W option is not a recognized flag. Cause. The flag specified with the -W option is not recognized by ar. Recovery. Reenter the command correctly.
ar Diagnostic Messages noft Manual— 528273-001 6 -8
A Sample nld and noft Session This appendix demonstrates basic nld and noft commands. The examples are shown in the Guardian environment, but results would be virtually identical in the Open Systems Services (OSS) environment. The example source code is compiled with TNS/R native C compiler.
Header Files Sample nld and noft Session Topics: • • • • • Header Files on page A-2 Source Module MAINC on page A-3 Source Module MODULE1C on page A-3 Source Module MODULE2C on page A-5 User Library UTILC on page A-6 Header Files The source modules and the user library module use these header files: Header File Module GLOBALSH MODULE1H MAINC X X MODULE1C X X MODULE2C X MODULE2H X UTILC 0 .001 #define BUS_STOP_CAPACITY 50 .002 #define BUS_CAPACITY 44 .003 #define MAXSTOPS 5 .004 .01 .
Source Module MAINC Sample nld and noft Session Example A-4. Header File UTILH With Edit Line Number 1 void seed_random_number(void); Source Module MAINC Source module MAINC has the main function. The main function calls the initialize function to allocate the bus stop array and to set a random number of passengers in each cell of the array. The main function then loops, incrementing a counter until the counter is greater then the number of bus stops.
Source Module MODULE1C Sample nld and noft Session The wrap-up function displays the number of passengers on the bus at the last stop and goes through the bus stop array, printing the number of people left at each stop. The bus stop array is then freed. Example A-6. Source Module MODULE1C With Edit Line Numbers .1 1 1.001 1.01 1.011 1.1 1.2 2 3 4 4.01 4.02 4.1 5 5.1 6 6.01 6.02 6.03 6.04 6.05 6.1 7 8 9 17 18 19 19.01 19.1 19.11 19.2 19.3 20 20.1 20.2 20.3 20.
Source Module MODULE2C Sample nld and noft Session Source Module MODULE2C Source module MODULE2C contains the add_passengers and delete_passengers functions. The add_passengers function checks to see if the current number of passengers on the bus plus the number of passengers at the bus stop exceeds the capacity of the bus.
User Library UTILC Sample nld and noft Session User Library UTILC The user library UTILC contains the seed_random_number function. This function gets the current time, converts it to a time structure, and multiplies the minutes by the seconds to seed the random number generator. Example A-8. User Library UTILC With Edit Line Numbers 1 1.1 2 3 3.1 4 5 5.001 5.01 5.02 5.1 6 7 9 10 11 12 13 18 #pragma nolist #include #include #pragma list #include "util.
nld Command Examples Sample nld and noft Session nld Command Examples Example A-9 is a multiline TACL command that runs nld with the options used to make an executable user library called UTILLIB. (For more information about nld options, see the nld Manual.) Example A-9. Linking an Executable User Library nld utilo & &-l zcresrl -l zcrtlsrl & &-o utillib -set inspect on -ul The program UTILLIB is executable, but it does not have a main function.
Program Output Sample nld and noft Session Program Output Run the program with this command: run example1 Example A-11. Sample Program Output 1> run example1 Number of people on bus at last stop = 31. Passengers remaining at each bus stop. Bus Stop Passenger Count 1 0 2 0 3 2 4 0 5 0 2> run example1 Number of people on bus at last stop = 38. Passengers remaining at each bus stop. Bus Stop Passenger Count 1 1 2 19 3 23 4 21 5 0 3> run example1 Number of people on bus at last stop = 35.
noft Command Examples on a Linkfile Sample nld and noft Session noft Command Examples on a Linkfile These examples use noft to examine information in some of the compiled modules. These examples use full flag names (instead of abbreviated ones) and, for options that offer the choice of BRIEF or DETAIL, these examples use DETAIL.
LISTCOMPILERS Sample nld and noft Session LISTCOMPILERS Example A-14 uses the LISTCOMPILERS option with the DETAIL parameter to list the compiler components used for each source file containing executable code statements. Header files and other files containing data declarations, DEFINE definitions, and function prototypes are not included. Example A-14.
LISTPROC Sample nld and noft Session Label Description (page 2 of 2) Callable Whether the function was marked callable at compilation time. Procedures are marked callable at compilation time as part of the mechanism used by HP for writing operating system code. It is not expected that the typical user will do this. The syntax for specifying a callable procedure depends on the language. It is beyond the scope of this manual to explain the syntax of specific languages.
LISTSOURCE Sample nld and noft Session LISTSOURCE You can use the LISTSOURCE option to see the source files that were used to build the object file. The DETAIL parameter displays the information shown in Example A-16. The address of the first procedure is more meaningful for a loadfile. Example A-16.
LISTSRLINFO Sample nld and noft Session LISTSRLINFO The function main in the object file MAINO calls a function in an SRL, but the SRL information has not been linked into the compiled linkfile. The SRL information is in the GINFO table that is only in the loadfile. The LISTSRLINFO option cannot find the table with the SRL information, so it issues the message shown in Example A-17. Example A-17.
LISTUNRESOLVED Sample nld and noft Session LISTUNRESOLVED The object file MAINO has not been linked with the other object file into a loadfile, so function calls are unresolved. The LISTUNRESOLVED option displays the names of functions and data that still need to be linked. The DETAIL parameter provides expanded information, including the type (Proc[edure] or Data) and the address where the name is used.
noft Command Examples on a Loadfile Sample nld and noft Session noft Command Examples on a Loadfile This topic repeats the commands in noft Command Examples on a Linkfile on page A-9 on the program file EXAMPLE1, except that, for options that offer the choice of BRIEF or DETAIL, these examples use BRIEF.
LISTATTRIBUTE Sample nld and noft Session LISTATTRIBUTE The LISTATTRIBUTE option shows more information for a loadfile than for a linkfile. The attributes Process Subtype, Highrequesters, Runnamed, Highpin, Saveabend, DEBUG/INSPECT, Maximum Heap Size, Main Stack Size, Space Guarantee, and PFS Size, can be set or changed with nld. The attribute Directly Needed Public SRL Bitmap shows where the Directly Needed Public SRLs are placed in all the possible 128 SRLs.
LISTCOMPILERS Sample nld and noft Session LISTCOMPILERS The BRIEF parameter on the LISTCOMPILERS option shows a summary of the compilers used to produce the object file. The object file in Example A-21 was created from the three modules for the example program, which used one version of the C compiler, and the two modules that were used to build $SYSTEM.SYSTEM.CRTLMAIN, which used a different version of the C compiler. Example A-21.
LISTSOURCE Sample nld and noft Session LISTSOURCE The LISTSOURCE option in Example A-23 on page A-18 shows all source files used to make the loadfile. The address does not change for sources that did not contribute code to the file. The ordinal number can be used for options that accept either the name or the number. Example A-23.
SET SORT Sample nld and noft Session SET SORT Example A-24 changes the setting of SORT and repeats the options in Example A-22 on page A-17 and Example A-23 on page A-18. Example A-24.
LISTSRLINFO Sample nld and noft Session LISTSRLINFO The loadfile EXAMPLE1 in Example A-25 on page A-20 uses two SRLs (see Example A-20 on page A-16). To see the names of these SRLs, use the LISTSRLINFO option. Example A-25. LISTSRLINFO Option (Loadfile) noft> LISTSRLINFO BRIEF SRL Name : ZCRESRL : ZCRTLSRL : # 0 1 LISTUNRESOLVED The list of unresolved functions and data is different for the loadfile EXAMPLE1 than the linkfile MAINO.
LISTOPTIMIZE Sample nld and noft Session LISTOPTIMIZE The LISTOPTIMIZE option in Example A-27 shows that the functions linked in from CRTLMAIN have optimization level 2, and the functions from the example program have optimization level 0. The output of the LISTOPTIMIZE option in Example A-27 is affected by the SET SORT ALPHA option done in Example A-24 on page A-19. Example A-27.
XREFPROC Sample nld and noft Session XREFPROC The XREFPROC option in Example A-29 is under the influence of the SET SCOPESOURCE option in Example A-28. Example A-29. Effect of SET SCOPESOURCE on XREFPROC Option noft> XREFPROC * BRIEF Called Procedure Calling Procedures ----------------------------------------------------------------------------*** WARNING *** [2008]: No cross reference information available in this category for procedure *.
XREFPROC Sample nld and noft Session Example A-31 on page A-23 uses the XREFPROC option to get DETAIL information about the unresolved external procedure rand. The output shows that rand is called from the delete_passengers function and the initialize function and shows the addresses where the calls occur. Example A-31.
DUMPPROC Sample nld and noft Session DUMPPROC Example A-32 on page A-24 uses the DUMPPROC option to display the code in the function delete_passengers. Example A-32.
DUMPPROC Sample nld and noft Session It is often easier to figure out what the executable code is doing when you can see its source code. If the source file is available, change the setting of FORMAT to INNERLIST to change the output display of DUMPPROC, DUMPADDRESS, and DUMPOFFSET options. Example A-33 shows how the SET FORMAT INNERLIST option affects the DUMPPROC option used in Example A-32 on page A-24, which Example A-33 reexecutes by means of the FC option. Example A-33.
LISTSRLFIXUPS Sample nld and noft Session Example A-33. Effect of SET FORMAT INNERLIST on DUMPPROC Option (page 2 of 2) [delete_passengers 16100] 0x70000694 0000000000 nop 16.
LISTSRLEXPORTS Sample nld and noft Session LISTSRLEXPORTS Example A-35 uses the FILE option to direct noft to examine the executable user library, UTILLIB. Then Example A-35 uses the LISTSRLEXPORTS option to show the functions the user library is exporting. Example A-35. LISTSRLEXPORTS Option noft> FILE UTILLIB Object File File Format Scope Case : : : : \DLLQA.$D0117.CRGMAN.
LISTSRLFIXUPS Sample nld and noft Session noft Manual— 528273-001 A -28
B Converting From Binder to noft The nld and noft utilities listed in Table B-1 on page B-1 replace the Binder product to support the object files created by the native C, C++, COBOL, and pTAL compilers. nld and noft are used in the same part of the development process as Binder. You can perform most, but not all, tasks previously performed by Binder with nld and noft. Table B-1.
Comparing Binder Commands to noft Options Converting From Binder to noft Comparing Binder Commands to noft Options For descriptions of individual noft options, see Section 3, noft Options. Table B-2. Comparing Binder With noft (page 1 of 2) Binder Command noft Option CD CD COMMENT COMMENT DUMP DUMPADDRESS DUMPOFFSET DUMPPROC Notes In Binder, a code or data block name is specified by an offset from base of block and optional number of words.
Comparing Binder Commands to noft Options Converting From Binder to noft Table B-2. Comparing Binder With noft (page 2 of 2) Binder Command noft Option Notes LIST DATA LISTPROC noft performs this function on a procedure level instead of on a code or data block level. LIST XREF XREFPROC noft performs this function on a procedure level instead of on a code or data block level.
Converting From Binder to noft Comparing Binder Commands to noft Options noft Manual— 528273-001 B- 4
C Native Object File Structure The noft utility operates on native object files, which have four main components: • • • • Headers of these types, which contain information about the structure and components of the object file: ° ° ° File Program Section Code and Data Segments on page C-1 MDEBUG Section on page C-2 TANDEM_GINFO section, which contains information used by the operating system to load loadfiles (for example, a lists of unresolved references and procedure information for creating run-ti
MDEBUG Section Native Object File Structure Each code and initialized data segment in a linkfile has a corresponding relocation table section. This section identifies the places within the code or data segment that contain linkable references. nld updates these references when it builds a new object file. When nld builds a loadfile: • • All references within the object file are resolved, their addresses are finalized, and the relocation tables no longer exist.
Glossary absolute pathname. An HP NonStop™ Open System Services (OSS) pathname that begins with a slash (/) character and is resolved beginning with the root directory. Compare to relative pathname. ANSI. American National Standards Institute. ar utility. A utility that creates and maintains archives of files for use by nld. archive file. A file that contains a collection of object files. The ar utility creates archive files. binding.
dynamic-link library (DLL) Glossary dynamic-link library (DLL). A collection of procedures whose code and data can be loaded and executed at any virtual memory address, with run-time resolution of links to and from the main program and other independent libraries. The same DLL can be used by more than one process. Each process gets its own copy of DLL static data. Compare to shared run-time library (SRL). EDIT file. In the Guardian file system, an unstructured file with file code 101.
header Glossary header. An object that, when specified for inclusion in a program’s source code, causes the program to behave, as if the statement including the header were actually a specific set of other programming statements. A header contains coded information that provides details (such as data item length) about the data that the header precedes. In an OSS program, a header is the name of a file known to the run-time library used by a process.
map DEFINE Glossary map DEFINE. A map DEFINE redirects or substitutes files in the Guardian environment. You can enter the logical name of a map DEFINE in place of a physical file name in contexts that allow it. MIPS RISC instructions. Register-oriented 32-bit machine instructions in the MIPS-1 RISC instruction set that are native to and directly executed on TNS/R systems. MIPS RISC instructions do not execute on TNS systems. Compare to TNS instructions.
OSS environment Glossary OSS environment. The OSS API, tools, and utilities. pathname. In the HP NonStop™ Open System Services (OSS) file system and Network File System (NFS), the string of characters that uniquely identifies a file within its file system. A pathname can be either relative or absolute. See also ISO/IEC IS 9945-1:1990 (ANSI/IEEE Std. 1003.1-1990 or POSIX.1), Clause 2.2.2.57. PIC (position-independent code). Executable code that need not be modified to run at different virtual addresses.
release version update (RVU) Glossary release version update (RVU). A collection of compatible revisions of HP NonStop operating system software products, identified by an RVU ID, and shipped and supported as a unit. An RVU consists of object modules, supporting files, and documentation for product revisions. An RVU also includes a set of documentation for the overall RVU. RISC. See reduced instruction-set computing (RISC). RISC instructions. See MIPS RISC instructions. RVU.
TNS instructions Glossary TNS instructions. Stack-oriented, 16-bit machine instructions that are directly executed on TNS systems by hardware and microcode. TNS instructions can be emulated on TNS/R systems by using millicode, an interpreter, and either translation or acceleration. Compare to MIPS RISC instructions. TNS interpreted mode.
TNS/R native object file Glossary TNS/R native object file. An object file created by a TNS/R native compiler that contains MIPS RISC instructions and other information needed to construct the code spaces and the initial data for a TNS/R native process. TNS/R native process. A process initiated by executing a TNS/R native object file. Compare to TNS process. TNS/R native shared run-time library (TNS/R native SRL).
Index A ar utility details of 5-1/5-6 diagnostic messages of 6-1/6-7 overview of 1-3 Archive tool See ar utility Attributes of files, listing 3-23/3-24 B Binder B-2/B-3 Break key 3-3 C Case-sensitivity 3-43 CD flag 3-5 Changing working directory 3-5 Code segments C-1/C-2 Command files, comments in 3-5 COMMENT flag 3-5 Comments in command files 3-5 Compiler versions, listing 3-25/3-27 Cross-referencing procedures 3-50/3-53 D Data errors 4-5/4-16 Data segments C-1/C-2 Debugging 2-7/2-11 Diagnostic messages
G Index FILE flag description of 3-16/3-17 in sample session A-9, A-15 Flags editing 3-15 repeating 3-15 summary of 3-1/3-3 G Guardian environment 2-1/2-2 H HELP flag 3-17 History buffer 3-45 HISTORY flag 3-20 I Interrupting noft 3-3 L LA or LISTATTRIBUTE flag description of 3-23/3-24 in sample session applied to linkfile A-9 applied to loadfile A-16 LAYOUT flag 3-21 LC or LISTCOMPILERS flag description of 3-25/3-27 in sample session applied to linkfile A-10 applied to loadfile A-17 LIBLIST flag 3-22
M Index LISTSOURCE or LS flag description of 3-30/3-31 in sample session applied to linkfile A-12 applied to loadfile A-18 SET SORT’s effect on A-19 LISTSRLEXPORTS or LLE flag description of 3-31 in sample session A-27 LISTSRLFIXUPS or LLF flag description of 3-31 in sample session A-27 LISTSRLINFO or LLI flag description of 3-32 in sample session applied to linkfile A-13 applied to loadfile A-20 LISTUNREFERENCED or LUR flag 3-33/3-35 LISTUNRESOLVED or LU flag description of 3-36/3-38 in sample session ap
O Index O OBEY flag 3-40 Object files differences between B-1 dumping 2-4 file code 700 1-1 linkfiles 1-1 listing 2-4 listing attributes of 3-23/3-24 loadfiles 1-1 specifying 3-16/3-17 structure of C-1/C-2 Optimization levels, listing procedures by 3-27 Options 3-1/3-53 OSS environment 2-2/2-3 OUT flag 3-40/3-41 Output format, setting 3-44 P Position-independent code (PIC) ar utility and 5-1 debugging 2-7 generally 1-1 Procedures, listing all or part of 3-10/3-12 by optimization level 3-27 with their sub
T Index T TANDEM_GINFO section C-1, C-2 TDS, ar utility and 5-1 TNS/R native object files overview of 1-1 structure of C-1/C-2 V Visual Inspect 2-7 VOLUME flag 3-49 W Warnings 4-18/4-21 Working directory, changing 3-5 X XREFPROC flag description of 3-50/3-53 in sample session A-22, A-23 non-PIC and 3-51 Special Characters ! flag 3-4 noft Manual— 528273-001 Index -5
Special Characters Index noft Manual— 528273-001 Index -6