noft Manual Abstract This manual explains how to use the TNS/R native object code file utilities noft (T9626), which displays object code files, and ar (T8629), which creates and maintains archives of object code files. Product Version noft D45; ar D43 Supported Release Updates (RVUs) This publication supports G06.27 and all subsequent G-series RVUs and H06.03 and all subsequent H-series RVUs until otherwise indicated by its replacement publication.
Document History Part Number Product Version Published 528273-001 noft D45 ar D43 April 2005 528273-002 noft D45 ar D43 September 2005 528273-003 noft D45 ar D43 March 2006
noft Manual Index Examples Tables What’s New in This Manual ix Manual Information ix New and Changed Information About This Manual xi Audience xi Related Reading xi Notation Conventions x xii 1. Introduction Native Object Code 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 Code Files 2-4 Dumping Object Code Files 2-5 Controlling the noft Environment 2-5 Debugging With noft 2-6 3.
3. noft Options (continued) Contents 3.
4. noft Diagnostic Messages (continued) Contents 4. noft Diagnostic Messages (continued) Syntax Errors 4-24 5. ar Utility 6. ar Diagnostic Messages A.
B. Converting From Binder to noft Contents B. Converting From Binder to noft Object Code File Differences B-1 Comparing Binder Commands to noft Options B-2 C. Native Object Code File Structure Code and Data Segments MDEBUG Section C-2 C-1 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.
Examples (continued) Contents Examples (continued) Example 3-23. Example 3-24. Example 3-25. 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 3-45. Example 3-46. Example 3-47. Example 3-48. Example 3-49. Example 3-50. Example 3-51. Example A-1. Example A-2. Example A-3. Example A-4.
Examples (continued) Contents Examples (continued) Example A-7. Example A-8. Example A-9. Example A-10. Example A-11. Example A-12. Example A-13. Example A-14. Example A-15. Example A-16. 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.
Tables (continued) Contents Tables (continued) Table C-1. Table C-2.
Contents noft Manual— 528273-003 viii
What’s New in This Manual Manual Information noft Manual Abstract This manual explains how to use the TNS/R native object code file utilities noft (T9626), which displays object code files, and ar (T8629), which creates and maintains archives of object code files. Product Version noft D45; ar D43 Supported Release Updates (RVUs) This publication supports G06.27 and all subsequent G-series RVUs and H06.03 and all subsequent H-series RVUs until otherwise indicated by its replacement publication.
New and Changed Information What’s New in This Manual New and Changed Information • • Updated the LISTSOURCE option: ° ° Example 3-27, LISTSOURCE Option (DETAIL), on page 3-33 Example A-16, LISTSOURCE Option (Linkfile), on page A-12 Added a note on Compilation Timestamp and Modification Timestamp on page 3-33. Changes to the G06.
About This Manual This manual explains how to use these TNS/R native object code file utilities: • • noft, which displays object code files ar, which creates and maintains archives of object code files 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 which programs are written (C/C++, COBOL, and pTAL—see Related Reading) Related
Notation Conventions About This Manual Notation Conventions 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 The following list summarizes the notation conventions for syntax presentation in this manual. UPPERCASE LETTERS.
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 code file tool) displays object code files. The ar utility (or archive tool) creates and maintains archives of object code files. The noft and ar utilities operate in the TNS/R native mode development environment on TNS/R native object code files—both PIC (position-independent code) and non-PIC (non-position-independent code) files. PIC and non-PIC native object code 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 code 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 code file library. If an archive contains both TNS and TNS/R files, nld and ld cannot use that archive.
ar Introduction noft Manual— 528273-003 1 -4
2 noft Utility The noft utility, the native object file tool, displays all portions of native object code files. Running the noft Utility in the Guardian Environment You can use the noft utility as an interactive or batch process, but noft is most often used as an interactive process. To run the noft utility in the Guardian environment, use the TACL command RUN. The most common forms of RUN used for noft follow. For complete information on RUN, see the TACL Reference Manual.
Running the noft Utility in the OSS Environment noft Utility command-file is an edit file containing one or more noft options. If the file contains more than one option, options must be separated by semicolons (;). If both a command-file and options are given, noft ignores the commandfile. 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.
Running the noft Utility in the OSS Environment noft Utility option is a noft flag and its parameters, if any. If you do not specify option, noft runs as an interactive process. When you run noft from the command line: • • • Include the option FILE or F on page 3-17. Prefix each option with a hyphen (-); for example, -file.
Listing Object Code Files noft Utility Listing Object Code Files Table 2-1. noft Listing Options Option Lists ...
Dumping Object Code Files noft Utility Dumping Object Code Files The noft dumping options display unformatted views into an object code file. Table 2-2. noft Dumping Options Option Displays ...
Debugging With noft noft Utility Table 2-3. noft Control Options (page 2 of 2) Option Description FC on page 3-16 Edits or repeats a previously executed command line. FILE or F on page 3-17 Specifies the name of the target object code file. HELP or ? on page 3-20 Displays descriptions and syntax for options. HISTORY or H on page 3-22 Displays previously entered command lines. LOG on page 3-40 Writes a copy of the current noft session’s input and output to a file.
Debugging With noft noft Utility 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 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. This action can result in a larger object code file. Optimizes across compound statement boundaries. (A loop is an example of a compound statement.) Uses registers instead of using memory extensively.
Debugging With noft noft Utility noft Manual— 528273-003 2- 12
3 noft Options An option is a flag and its parameters, if any. Use the noft options to specify the input object code 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 lists the noft flags in alphabetic order.
noft Options Table 3-1. noft Flag Summary (page 2 of 3) Flag Description FILEHDR on page 3-18 Displays the object code file’s header. HEADERS on page 3-18 Displays the object code file’s initial headers (object code file must be a COFF file). HELP or ? on page 3-20 Displays descriptions and syntax for options. HISTORY or H on page 3-22 Displays previously entered command lines. (Use only in an interactive session.
Break Key noft Options Table 3-1. noft Flag Summary (page 3 of 3) Flag Description PROGHDRS on page 3-43 Displays the object code file’s program headers (object code file must be an ELF file). QUIT or Q on page 3-43 Stops the noft process. RESET on page 3-44 Resets one or more noft target object code file parameters previously specified with a the SET option to their default values. SECTHDRS on page 3-45 Displays the object code file’s section headers.
! (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-52. 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 code file’s memory space. Because all sections in linkfiles start at zero, use DUMPOFFSET or DO on page 3-7 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.
DUMPOFFSET or DO noft Options { DECIMAL | D } displays portions of the object code file in decimal format. { HEX | H } displays portions of the object code file in hexadecimal format. { ICODE | IC } displays portions of the object code file in disassembled program code. This is the default. { INNERLIST | IN } displays portions of the object code file in disassembled program code and displays the source code interspersed with the code. Use this option for displaying text.
DUMPOFFSET or DO noft Options 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. number is the number of bytes or words to display. * displays information to the end of the code or data section. Considerations • • The offset address of a code section is rounded up to a whole number of words.
DUMPPROC or DP noft Options { INNERLIST | IN } displays portions of the object code 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 code file in octal format. If you do not specify the format with the DUMPOFFSET option, the formatting is controlled by the SET FORMAT option. For more information, see SET on page 3-47. Example 3-3.
DUMPPROC or DP noft Options offset is the number of bytes beyond the starting virtual address of the procedure (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. number is the number of bytes or words to display. * displays information to the end of the code or data section.
DUMPPROC or DP noft Options { INNERLIST | IN } displays portions of the object code 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 code file in octal format. If you do not specify the format with the DUMPPROC option, the formatting is controlled by the SET FORMAT option. For more information, see SET on page 3-47.
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.
DYNSTR noft Options DYNSTR Note. This option is useful only with an object code file created by the ld utility, which has a Dynstr Section. The DYNSTR option displays the target object code file’s Dynstr Section (if any). The Dynstr Section contains the string information to which the dynamic symbol table (.dynsym), globalized dynamic symbol table (.dynsym.glbzd), and dynamic table (.dynamic) point. Note. The DYNSTR option displays low-level internal data that is subject to change. DYNSTR Example 3-5.
DYNSTR2 noft Options DYNSTR2 Note. This option is useful only with an object code file created by the ld utility, which has a Dynstr2 Section. The DYNSTR2 option displays the target object code 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 code file is built. Note.
ENV noft Options Example 3-6. DYNSTR2 Option With Object Code 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 (for more information, see OBEY on page 3-41) 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 code file you want to use with noft. A subsequent FILE option closes the current object code file and opens the specified object code file. { FILE | F } { filename | ? } filename specifies the name of the target object code file. filename is a Guardian file name when noft is running in the Guardian environment.
FILEHDR noft Options • • • The FILE option sets the case target file parameter, depending on the source files inside the object code file. noft resolves Guardian file names by using the default volume and subvolume established with the option SYSTEM or VOLUME on page 3-52. noft resolves OSS filenames by using the default directory established with CD on page 3-5. Example 3-9. FILE Option noft> file obj Object File File Format Scope Case : : : : $WORK.JASON.
HEADERS noft Options Example 3-11.
HELP or ? noft Options Example 3-11. HEADERS Option for ELF File (page 2 of 2) 4 .dynamic 0x00000006 (DYNAMIC ) 0x00000002 (ALLOC) 0x70000560 0x00000560 0x000000a0 0x00000006 0x00000000 16 0x00000008 -------------------------------------------------------------------------- 5 .liblist 0x70000000 (LIBLIST ) 0x00000000 () 0x70000600 0x00000600 0x000000a8 0x00000006 0x0000000b 16 0x00000008 -------------------------------------------------------------------------- 6 .
HELP or ? noft Options option displays information about the specified option, including syntax. For more information, see Example 3-13 on page 3-22. help-topic gives detailed information on specific noft topics. HELP without any options displays a list of options and help topics. For more information, see Example 3-14 on page 3-22). Example 3-12. HELP ALL Option noft> help all NOFT Help...
HISTORY or H noft Options Example 3-13. 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.
LAYOUT noft Options Example 3-15. HISTORY Option noft> HISTORY 7 8> file /G/qtal/jasonoft/testo 9> set historywindow 7 10> listproc * sss $qtal.jasonoft.samplet 11> dumpproc 3 in hex 12> innerlist on 13> out proc3 14> dumpproc 3 in hex LAYOUT The LAYOUT option lists the parts of an object code file in order by file offset. LAYOUT Example 3-16.
LIBLIST noft Options LIBLIST Note. This option is useful only with an object code file created by the ld utility. For more information, see Example 3-18 on page 3-25. The LIBLIST option displays the object code 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 code file is built. Note.
LISTATTRIBUTE or LA noft Options Example 3-18. LIBLIST Option With Object Code File Created by nld Utility > noft;file hellomx;dynstr2 Object File : \SPEEDY.$DATA06.KMZPICP2.hellomx File Format : ELF Scope : (none) Case : Sensitive ******** No Liblist Section ******** LISTATTRIBUTE or LA The LISTATTRIBUTE option lists process-specific information associated with an object code file.
LISTATTRIBUTE or LA noft Options Example 3-19.
LISTCOMPILERS or LC noft Options Example 3-20.
LISTCOMPILERS or LC noft Options Example 3-22. LISTCOMPILERS Option (DETAIL) (page 1 of 2) noft> listcompilers detail Linker Filename File Number R_REFSHFT Compiler Front End Back End Optimizer Back End Code Generator Back End Assembler : : : : : : : T6017D44_15OCT99_99258___Guardian \CYCLONE.$PTAL.KMZMAIN.
LISTOPTIMIZE or LO noft Options Example 3-22. LISTCOMPILERS Option (DETAIL) (page 2 of 2) Filename File Number R_REFSHFT Compiler Front End Back End Optimizer Back End Code Generator Back End Assembler : : : : : : \CYCLONE.$PTAL.KMZMAIN.PROGHDRQ 31 (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.
LISTPROC or LP noft Options Example 3-23. LISTOPTIMIZE Option noft> listoptimize * ******** Optimization of Procedures Procedure Name _MAIN T8432D40_01NOV95_CRTLMAIN __INIT__1_C housekeeping main menu : : : : : : : # 1 2 0 4 3 5 ******** Opt 2 2 2 1 1 1 LISTPROC or LP The LISTPROC option lists procedures and their subprocedures.
LISTPROC or LP noft Options SUBPROC lists the subprocedures along with procedures. If procedure P contains subprocedure S, a LISTPROC P SUBPROC command line lists S, as it is contained within P. This is the default. NOSUBPROC does not list subprocedures along with procedures. If procedure P contains subprocedure S, a LISTPROC P NOSUBPROC command line lists only P and not S even though S is within P. BRIEF B provides minimal information about procedures and subprocedures. This is the default.
LISTSOURCE or LS noft Options Example 3-25. LISTPROC Option (DETAIL) noft> listproc __pp__5pointFi detail ******** List of Procedures ******** Number : 4 Name : __pp__5pointFi Demangled Name : point::operator ++(int) Address : 0x70000aac Size : 412 bytes Resident : No Privileged : No Callable : No Interrupt : No Alternate Entry Point : No Subprocedure : No Visibility : External Optimization Level : 1 Parent Procedure : (none) Source File : \CYCLONE.$NATIV1.CRGCPP.SPOINT Note.
LISTSRLEXPORTS or LLE noft Options DETAIL D displays detailed information about source files If the scope has been set to a single procedure with the SET SCOPEPROC option (for more information, see SET on page 3-47), the LISTSOURCE option lists only the source file containing the procedure definition. Example 3-26. LISTSOURCE Option (BRIEF) noft> listsource * brief ******** List of Source Files # 0 Address 0x76100390 ******** Source File \CYCLONE.$PTAL.KMZRLD.DLL1C noft> Example 3-27.
LISTSRLFIXUPS or LLF noft Options LISTSRLFIXUPS or LLF The LISTSRLFIXUPS or LLF option lists the names of the SRLs to which the unresolved symbols in a client object code file have been “fixed up.” { LISTSRLFIXUPS | LLF } [ BRIEF | B | DETAIL | D] BRIEF B lists only the unresolved symbols and SRL names. This is the default. DETAIL D provides more information, such as number and fixup address. LISTSRLINFO or LLI The LISTSRLINFO option lists the SRLs linked into an object code file.
LISTUNREFERENCED or LUR noft Options LISTUNREFERENCED or LUR The LISTUNREFERENCED or LUR option lists the undefined and unreferenced symbols in a pTAL object code file. These symbols must be linked before the object code file can be executed. (Compare this option with the option LISTUNRESOLVED or LU on page 3-37.) To find the functions in an object code file that are never referenced, use the option XREFPROC or XP on page 3-54.
LISTUNREFERENCED or LUR noft Options Example 3-30.
LISTUNRESOLVED or LU noft Options If the program in Example 3-32 on page 3-36 is compiled and made executable and the program file is designated to noft with the option FILE or F on page 3-17, Example 3-33 shows the result of the LISTUNREFERENCED option—the NMC compiler eliminates unreferenced prototypes. Compare Example 3-33 to Example 3-37 on page 3-39, which shows the result of the LISTUNRESOLVED option. Example 3-33.
LISTUNRESOLVED or LU noft Options EXCLUDE E excludes system-supplied functions, which include millicode calls, common system library calls (as documented in the Guardian Procedure Calls Reference Manual), and calls to functions in SRLs. For more information, see Example 3-38 on page 3-39. Note. This option is not available for PIC object code files. Example 3-34.
LISTUNRESOLVED or LU noft Options If the program in Example 3-30 on page 3-36 is compiled and made executable and the program file is designated to noft with the option FILE or F on page 3-17, Example 3-36 shows the result of the LISTUNRESOLVED option. Compare Example 3-36 to Example 3-33 on page 3-37, which shows the result of the LISTUNREFERENCED option. Example 3-36.
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.
LOWLEVELCOMMANDS or LLC noft Options LOWLEVELCOMMANDS or LLC The LOWLEVELCOMMANDS option lists and briefly describes the low-level noft commands, which are: • • • • • • • • AOUTHDR on page 3-4 DYNSTR on page 3-13 DYNSTR2 on page 3-14 FILEHDR on page 3-18 HEADERS on page 3-18 LIBLIST on page 3-24 PROGHDRS on page 3-43 SECTHDRS on page 3-45 Note. The low-level noft commands display low-level internal data that is subject to change.
OUT noft Options Considerations • Additional OBEY options can appear within an OBEY command file. You can nest OBEY command files to any depth, but they cannot be circularly linked. • If you try to open a currently opened OBEY command file, an error occurs. Example 3-41. OBEY Option noft> obey obeyfile Obey File: $SPOOL.KEVIND.
PROGHDRS noft Options File Utility Program (FUP) to create the file before specifying its name in the LOG option. Specify larger primary, secondary, and maximum extents. For example: FUP CREATE $VOL.SUBVOL.OUT1,CODE 180,EXT(100,100),ODDUNSTR,MAXEXTENTS 900 To use the file that you created with the previous command, enter either of these commands: ° ° OUT $VOL.SUBVOL.OUT1 B SET OUT $VOL.SUBVOL.OUT1 B Example 3-42.
RESET noft Options The noft process stops if you enter the QUIT option. When noft is run as 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 (for more information, see OBEY on page 3-41) or a TACL RUN command IN parameter input file. RESET The RESET option resets one or more noft target object code file parameters previously specified with SET on page 3-47 to their default values.
SECTHDRS noft Options SECTHDRS The SECTHDRS option displays the object code file’s section headers. Note. The SECTHDRS option displays low-level internal data that is subject to change. SECTHDRS Example 3-45.
SECTHDRS noft Options Example 3-45. SECTHDRS Option (page 2 of 2) 7 .dynsym 0x0000000b (DYNSYM ) 0x00000002 (ALLOC) 0x70000780 0x00000780 0x00000140 0x00000008 0x0000000a 16 0x00000008 -------------------------------------------------------------------------- 8 .dynstr 0x00000003 (STRTAB ) 0x00000002 (ALLOC) 0x700008c0 0x000008c0 0x000000e0 0x00000000 0x00000000 16 0x00000000 -------------------------------------------------------------------------- 9 .
SET noft Options SET The SET option sets one or more noft target object code 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 code file. ASCII A displays portions of the object code file in ASCII format. DECIMAL D displays portions of the object code 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-16, and HISTORY or H on page 3-22. 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-40 (note that the keyword SET is optional with LOG). OUT { filename [B] | OFF | ? } is described in OUT on page 3-42 (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 code file parameters. It is a superset of ENV on page 3-15. SHOW [ * ] Example 3-46.
TANDEMINFO noft Options subvolume-name is a subvolume name. The default is the subvolume from which you invoked noft. Considerations • • • Without parameters, the SYSTEM or VOLUME option restores the default path to the node, volume, and subvolume from which you invoked noft. ENV on page 3-15 and SHOW on page 3-52 list the noft current settings of the volume and subvolume. The noft utility does not verify the validity of the specified node, volume, or subvolume name.
XREFPROC or XP noft Options Example 3-47.
XREFPROC or XP noft Options The proc-name can be any name reported by either the LISTPROC option or the LISTUNRESOLVED option. proc-name.subproc-name limits the scope to the specified subprocedure. If the proc-name or subproc-name are not completely specified, noft resolves the name and lists conforming subprocedure names with numbers. subproc-name limits the scope to the specified subprocedure.
XREFPROC or XP noft Options DETAIL D lists the called or calling procedures referenced by the indicated procedures and the addresses where the calls are made. For C++ functions, DETAIL provides the “demangled” (original) names as well as the “mangled” internal equivalents. If the target object code file is non-PIC, references to functions that might be used for calls (for example, function pointers passed as parameters) are identified by the word reference.
XREFPROC or XP noft Options Example 3-49.
XREFPROC or XP noft Options Example 3-51.
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. Fatal Errors 1 *** 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. Give the object code file being examined and the series of commands that you used to your service provider for analysis.
Fatal Errors noft Diagnostic Messages 6 *** 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. Give the object code file being examined and the series of commands that you used to your service provider for analysis. 7 *** FATAL ERROR *** [7]: Some problem initializing options. Cause. An internal table is corrupt. Recovery. Restart noft and then the commands in question.
Fatal Errors noft Diagnostic Messages Recovery. Reenter the noft run command, specifying only one object code file for input. 11 *** 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 code file being examined and the series of commands that you used to your service provider for analysis. 12 *** FATAL ERROR *** [12]: Unable to add to history line: previous-line. Cause.
Fatal Errors noft Diagnostic Messages 15 *** 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. 16 *** 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 Recovery. Give the object code file being examined and the series of commands that you used to your service provider for analysis. Data Errors 1000 *** DATA ERROR *** [1000]: Cannot dump out by procedure/source name because the object file does not contain full symbols. Cause. The object code file was stripped of its symbol table. Recovery. Rebuild the object code file with symbols information. 1001 *** DATA ERROR *** [1001]: Cannot find end of file. Cause.
Data Errors noft Diagnostic Messages 1004 *** DATA ERROR *** [1004]: Could not find selected procedure. Cause. LISTPROC could not find the specified procedure. Recovery. Use LISTPROC * to see what procedures are available. (For more information, see LISTPROC or LP on page 3-30.) 1005 *** 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.
Data Errors noft Diagnostic Messages 1008 *** DATA ERROR *** [1008]: Did not find an rpd that should be in source file, check options and full rpd table. Cause. Stated in message. Recovery. Stated in message. 1009 *** 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 Errors noft Diagnostic Messages 1013 *** DATA ERROR *** [1013]: Did not find any runtime procedures belonging to procedure, check options and full rpd table. Cause. Stated in message. Recovery. Stated in message. 1014 *** 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. 1015 *** DATA ERROR *** [1015]: Did not find any undefined symbols matching scope. Cause.
Data Errors noft Diagnostic Messages 1018 *** DATA ERROR *** [1018]: File descriptor table empty, unable to extract source file names. Cause. No source files are associated with this object code file. Recovery. Rebuild the object code file with symbols information. 1019 *** DATA ERROR *** [1019]: Neither an ELF nor a Tandem COFF file: filename. Cause. The specified object code file was not compiled with a native compiler. Recovery. Rebuild the object code file with a native compiler.
Data Errors noft Diagnostic Messages 1023 *** DATA ERROR *** [1023]: No procedures selected to look at, command aborted. Cause. Stated in message. Recovery. Reenter LISTOPTIMIZE, specifying one or more procedures (for more information, see LISTOPTIMIZE or LO on page 3-29). 1024 *** DATA ERROR *** [1024]: No source file information available, command ignored. Cause. The object code file does not have complete symbols information. Recovery. Rebuild the object code file with complete symbols information.
Data Errors noft Diagnostic Messages Recovery. Rebuild the object code file with complete symbols information. 1029 *** DATA ERROR *** [1029]: PROC command only works on object files with symbols. Cause. DUMPPROC or DP on page 3-9, LISTPROC or LP on page 3-30, or XREFPROC or XP on page 3-54 did not work because the object code file has no symbols. Recovery. Rebuild the object code file with symbols. 1030 *** DATA ERROR *** [1030]: Procedure and external symbol tables not consistent. Cause.
Data Errors noft Diagnostic Messages Recovery. Check the list of procedures to see if the procedure is actually in the object code file. If not, rebuild the object code file. 1034 *** DATA ERROR *** [1034]: Some problem printing text. Cause. An internal table is corrupt. Recovery. Restart noft and reissue the commands in question. 1035 *** DATA ERROR *** [1035]: Some sort of problem reading runtime procedure table for names. Cause.
Data Errors noft Diagnostic Messages 1037 *** DATA ERROR *** [1037]: Specified address(es) not found. Cause. noft cannot find the specified addresses in the object code file. Recovery. Verify that the addresses exist in the object code file, and rebuild the object code file with complete symbols information. 1038 *** 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.
Data Errors noft Diagnostic Messages Recovery. Give the object code file being examined and the series of commands that you used to your service provider for analysis. 1042 *** 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. 1043 *** DATA ERROR *** [1043]: Unable to dump some unresolved items. Cause. An internal table is corrupt. Recovery.
Data Errors noft Diagnostic Messages 1046 *** DATA ERROR *** [1046]: Unable to open obey file: filename. Cause. Either the specified file is not present or it is neither a text file nor an edit file. Recovery. Verify that the path to the OBEY command file is correct and that the OBEY command file is a text file (in the OSS environment and on UNIX workstations) or an edit file (in the Guardian environment). 1047 *** DATA ERROR *** [1047]: Unable to read table-name procedure table, command ignored. Cause.
Data Errors noft Diagnostic Messages Recovery. Verify that noft is looking at a code section with ICODE. 1051 *** DATA ERROR *** [1051]: Unable to understand that [directory | [\.][$.][] ] Cause. One of these has an invalid format: • • The directory (pathname) specified by CD on page 3-5 The system (node-name) or subvolume-name specified by SYSTEM or VOLUME on page 3-52 Recovery. Verify that the specified directory, system, or subvolume exists and has the correct format.
Data Errors noft Diagnostic Messages 1055 *** DATA ERROR *** [1055]: Did not find any unreferenced symbols matching scope. Cause. LISTUNREFERENCED or LUR on page 3-35 was limited by either SET SCOPEPROC or SET SCOPESOURCE. The number of items found in the scope was zero. Recovery. Either use RESET on page 3-44 to reset the scope to its default or use SET on page 3-47 to change the scope. To see the current scope, use SHOW on page 3-52.
Data Errors noft Diagnostic Messages 1059 *** DATA ERROR *** [1059]: Unable to handle archive file: filename. Cause. The filename in FILE or F on page 3-17 is an archive. Recovery. Reissue FILE or F on page 3-17, specifying an ELF file. For archives, use the ar program (for more information, see Section 5, ar Utility). 1060 *** DATA ERROR *** [1060]: The Guardian file system error number number occurred while trying to prefix the node to the volume and subvolume. Cause.
Warnings noft Diagnostic Messages 1063 *** DATA ERROR *** [1063]: The Guardian file system error number number occurred while manipulating file name components. Cause. During construction of a Guardian file name from components, the file system error number occurred. Recovery. Use SYSTEM or VOLUME on page 3-52 to change to a subvolume with a shorter name. If this error still occurs, contact your service provider. 1064 *** DATA ERROR *** [1064]: The path length exceeds the container size of number. Cause.
Warnings noft Diagnostic Messages 2000 *** WARNING *** [2000]: End of offset outside of procedure, dumping to end of procedure. Cause. The specified range of addresses or offsets goes outside the scope of the procedure. Recovery. Remove the scoping of the procedure with SET SCOPEPROC * (for more information, see SET on page 3-47). Limit the range within the procedure. 2001 *** WARNING *** [2001]: No object file open. No dumping currently possible. Cause. Stated in message. Recovery.
Warnings noft Diagnostic Messages 2004 *** WARNING *** [2004]: Specified range jumps section boundaries, dumping to end of section. Cause. The range of addresses or offsets goes past a section boundary in the object code file, so it is not safe to contiguously dump or list. Recovery. Respecify the needed addresses or offsets in two parts around the section boundary. 2005 *** WARNING *** [2005]: This command only works on COFF files, using TANDEMINFO instead ... Cause.
Warnings noft Diagnostic Messages 2009 *** WARNING *** [2009]: Cannot convert line number to Tandem edit line number. Cause. In the Guardian environment, you used one of: • • • INNERLIST option of DUMPADDRESS or DA on page 3-6 DUMPOFFSET or DO on page 3-7 DUMPPROC or DP on page 3-9 Recovery. Use LISTPROC or LP on page 3-30 with the DETAIL option to see the name of the source file. Verify that the source file is the same edit file that was used when the module was compiled.
Warnings noft Diagnostic Messages Recovery. Check the result in the Guardian Procedure Calls Reference Manual (see SEGMENT_DEALLOCATE_). Based on that information, take appropriate action. 2013 *** WARNING *** [2013]: LISTUNRESOLVED Exclude option not supported on PIC objects, option ignored... Cause. The current object code file is a PIC object code file, and you specified the EXCLUDE option in the LISTUNRESOLVED or LU on page 3-37. Recovery.
Syntax Errors noft Diagnostic Messages Recovery. noft continues processing the remaining procedures in the object code file. Syntax Errors 3000 *** 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. 3001 *** SYNTAX ERROR *** [3001]: command number Event not found. Cause.
Syntax Errors noft Diagnostic Messages 3004 *** SYNTAX ERROR *** [3004]: Address range selected not in scope option selected, please check options. Cause. The scope for the procedure or source file previously selected does not intersect with the address range specified in the last command. Recovery. Release the scoping restriction previously enabled with SET SCOPEPROC * or SET SCOPESOURCE * (for more information, see SET on page 3-47). Verify that the address range is in the procedure or source file.
Syntax Errors noft Diagnostic Messages Recovery. Verify that the syntax of the command is correct. Note. The next line of the COMMENT command is missing. The COMMENT command in noft is different from many other HP products. 3009 *** SYNTAX ERROR *** [3009]: Cannot find name for procedure for option. Cause. This error occurs for the undocumented command RELOC. It indicates that the procedure given for the SET SCOPEPROC command could not be converted from its ordinal back to a string. Recovery.
Syntax Errors noft Diagnostic Messages Recovery. Enter commands separately or add a semicolon between the commands in question. For a list of commands that begin with DUMP and LIST, see Table 3-1 on page 3-1. 3013 *** SYNTAX ERROR *** [3013]: FOR requires a decimal number. Cause. The number of bytes or words specified in an address or offset range must be in decimal format. Recovery. Recompute any numbers in decimal format.
Syntax Errors noft Diagnostic Messages 3017 *** SYNTAX ERROR *** [3017]: Invalid optimization level specified. Cause. LISTOPTIMIZE or LO on page 3-29 has an invalid level. Recovery. Reissue LISTOPTIMIZE, using a valid level. 3018 *** SYNTAX ERROR *** [3018]: Invalid parameter to command, command ignored Cause. noft cannot determine the specified parameter. Recovery. Correct the command syntax; specifically, the parameter descriptions.
Syntax Errors noft Diagnostic Messages 3022 *** SYNTAX ERROR *** [3022]: No history to search. Cause. The HISTORY buffer has been set to 0. Recovery. Use SET HISTORYBUFFER to set an appropriate buffer size. 3023 *** SYNTAX ERROR *** [3023]: No procedure descriptor table in object file, command ignored. Cause. This error occurs for the undocumented RUNTIMEPROC command. It indicates that the SET SCOPEPROC command was given, but there is no symbol table. Recovery.
Syntax Errors noft Diagnostic Messages 3026 *** SYNTAX ERROR *** [3026]: No unresolved references in procedure-name, command ignored. Cause. This error occurs for the undocumented GINFOSITE and GINFOUNRES commands and indicates that nothing was in the scope. Recovery. Either use RESET on page 3-44 to reset the scope to its default or use SET on page 3-47 to change the scope. To see the current scope, use SHOW on page 3-52. 3027 *** SYNTAX ERROR *** [3027]: Obey requires filename, command ignored. Cause.
Syntax Errors noft Diagnostic Messages number of the source file. (For more information, see LISTPROC or LP on page 3-30 and SET on page 3-47.) 3030 *** SYNTAX ERROR *** [3030]: Procedure number out of range, check procedure descriptor table. Cause. noft cannot find the specified procedure number. Recovery. Verify that the specified procedure exists in the object code file and that its name is spelled correctly.
Syntax Errors noft Diagnostic Messages 3035 *** SYNTAX ERROR *** [3035]: Source file filename not in correct position. Cause. SET FORMAT INNERLIST and a dumping command cannot find the source file that corresponds with the one specified by the object code file in the original or the current directory. Recovery. Verify that the source file exists in either the current directory or in its original location.
Syntax Errors noft Diagnostic Messages Recovery. Verify that the addresses exist in the object code file. Rebuild the object code file with complete symbols information. 3039 *** 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. In the Guardian environment, use SYSTEM or VOLUME on page 3-52.
Syntax Errors noft Diagnostic Messages 3043 *** 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-44 to reset the scope to its default, use SET on page 3-47 to change the scope, or recompile the module with symbols. To see the current scope, use SHOW on page 3-52.
Syntax Errors noft Diagnostic Messages 3047 *** SYNTAX ERROR *** [3047]: Unable to find in-range line number in history. Cause. The command number was in range, but the line was unavailable. Recovery. Use HISTORY or H on page 3-22 to see if the command can be seen and, if so, reenter the command. 3048 *** SYNTAX ERROR *** [3048]: Unable to find line number in history. Cause. The number is out of the history buffer range. Recovery.
Syntax Errors noft Diagnostic Messages 3051 *** SYNTAX ERROR *** [3051]: Proc-name is not in current scope. Cause. While trying to parse the procedure (function) name or number, noft determined that the procedure (function) does not exist in the current scope. Recovery. Use SHOW on page 3-52 to see the current SCOPE value. Either use SET on page 3-47 to change the scope, use RESET on page 3-44 to reset the scope, or correct the procedure name.
Syntax Errors noft Diagnostic Messages 3056 *** SYNTAX ERROR *** [3056]: Wrong parameter to CASE, command ignored. Cause. SET CASE expects ON or OFF (for more information, see SET on page 3-47). Recovery. Supply one of these two arguments to the SET CASE command. 3057 *** SYNTAX ERROR *** [3057]: Procedure name not available, procedure-name. Cause.
Syntax Errors noft Diagnostic Messages 3061 *** SYNTAX ERROR *** [3061]: Lines per page input number out of range. Cause. The value for SET LINES was either not a number or it was too large a number. Recovery. Give the SET LINES command an integer in the range 0 through 32,767 (for more information, see SET on page 3-47). 3062 *** SYNTAX ERROR *** [3062]: Format of node or volume or subvolume is not correct. Cause. In SYSTEM or VOLUME on page 3-52, the value for node, volume, or subvolume was invalid.
5 ar Utility The ar utility creates and maintains archives composed of groups of object code 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 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: Environment archive Guardian is the path name of the archive to be created or modified. Archives created in the Guardian environment are given file code 700. OSS is the file name of the archive to be created or modified. PC is the file name of the archive to be created or modified. It can be partially or fully qualified and can include system and folder names. The maximum size of an archive in the Guardian environment is 128,073,728 bytes.
ar Utility ar accepts many types of files as archive members. ar recognizes two types of HP object code files: TNS and TNS/R. All other files, including text files, are considered target-independent files. Only archives composed entirely of the same kind of HP object code 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 is 128,073,728 bytes.
ar Diagnostic Messages 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 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. Correct the condition that caused the I/O error, and then build the symbol table by using ar with the -ts options. archive, cannot set archive permissions. Cause. An I/O error occurred in the Guardian environment when ar attempted to set the file permissions on the specified archive. Recovery.
ar Diagnostic Messages Recovery. Retry the command when there are fewer active processes in the system, or break up a large archive into smaller archives. cannot realloc space. Cause. ar cannot obtain additional memory space for the symbol table. The archive, if created, will not be usable by nld. Recovery. Break the archive into several smaller archives. corrupted object file filename. Cause. ar detected inconsistencies in the object code file member and cannot finish its operation.
ar Diagnostic Messages member already exists. Cause. This is an advisory message. It warns when an archive member is not extracted because a file of that name already exists. Recovery. To overwrite the existing file, either purge it before using ar or be sure not to use the C option on the ar command. member: archive: bad file format. Cause. The specified archive has an invalid file format. Recovery. Rebuild the archive. member, cannot extract because destination is not in Guardian filespace. Cause.
ar Diagnostic Messages no archive specified. Cause. An archive is not specified in the command. Usually this indicates that either no operand or one operand (when a position operand is required) is specified in the command. Recovery. Reenter the command with the correct number of operands. one of the options -dmpqrtx is required. Cause. One of the listed options is required. Recovery. Reenter the command correctly. only one of -a and -[bi] options allowed. Cause.
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 OSS environment. The example source code is compiled with TNS/R native C compiler. Example Program The example program is a simplified bus simulation. A random number of passengers is set at each bus stop. At each bus stop, a random number of passengers get off the bus and as many passengers as possible get on the bus.
Source Module MAINC Sample nld and noft Session Example A-1. Header File GLOBALSH With Edit Line Numbers 0 .001 #define BUS_STOP_CAPACITY 50 .002 #define BUS_CAPACITY 44 .003 #define MAXSTOPS 5 .004 .01 .1 1 extern long *bus_stop_array; 2 extern long passengers_on_bus; Example A-2. Header File MODULE1H With Edit Line Numbers 0 1 2 5 6 void initialize(long); void wrapup(long); Example A-3.
Source Module MODULE1C Sample nld and noft Session Example A-5. Source Module MAINC With Edit Line Numbers .01 .1 #pragma nolist #include 1 #pragma list 1.001 #include "globals.h" 1.1 #include "module1.h" 1.2 #include "module2.h" 2 2.1 long *bus_stop_array; 2.2 long passengers_on_bus = 0; 3 4 void main(void) 5 { 5.1 long bus_stops = MAXSTOPS; 5.2 long counter; 5.3 6 initialize (bus_stops); 7 for (counter = 0; counter < bus_stops; counter++) 8 { 8.001 if (passengers_on_bus > 0) 8.
Source Module MODULE1C Sample nld and noft Session 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.4 21 22 23 #pragma nolist #include #include #pragma list #include "globals.h" #include "module1.h" #include "util.
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 code 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 code 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 Example A-18. LISTUNRESOLVED Option (Linkfile) noft> LISTUNRESOLVED * DETAIL Building XREF info. 100 percent remains of section 4.
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 code file. The object code 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 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 uses two SRLs. For more information, 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 on page A-21. 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 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 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-003 A -28
B Converting From Binder to noft The nld and noft utilities listed in Table B-1 replace the Binder product to support the object code 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 CODE LISTPROC noft performs this function on a procedure level instead of on a code or data block level. 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-003 B- 4
C Native Object Code File Structure The noft utility operates on native object code files, which have four main components: • • • • Headers of these types, which contain information about the structure and components of the object code file: ° ° ° File Program Section Code and Data Segments 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-t
MDEBUG Section Native Object Code File Structure Shared run-time libraries (SRLs) and programs with callable procedures contain additional sections and segments. 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 code file.
Index A Binder B-2/B-3 Break key 3-3 Diagnostic messages (continued) warnings 4-19/4-24 Directory, changing 3-5 Displaying 2-5 DUMPADDRESS option 3-6/3-7 Dumping object code files 2-5 DUMPOFFSET option 3-7/3-9 DUMPPROC option description of 3-9/3-12 in sample session A-24 Dynamic symbol table (.dynsym) 3-13 Dynamic table (.
G Index FILE option description of 3-17/3-18 in sample session A-9, A-15 FILEHDR option 3-18 Flags See also Options summary of 3-1/3-3 G Globalized dynamic symbol table (.dynsym.
M Index LISTPROC or LP option (continued) SET SORT’s effect on A-19 LISTSOURCE or LS option description of 3-32/3-33 in sample session applied to linkfile A-12 applied to loadfile A-18 SET SORT’s effect on A-19 LISTSRLEXPORTS or LLE option description of 3-33 in sample session A-27 LISTSRLFIXUPS or LLF option description of 3-34 in sample session A-27 LISTSRLINFO or LLI option description of 3-34 in sample session applied to linkfile A-13 applied to loadfile A-20 LISTUNREFERENCED or LUR option 3-35/3-37 L
O Index Q nld utility A-1/A-27 Non-PIC ar utility and 5-1 XREFPROC option and 3-56 QUIToption 3-43 Quitting noft 3-16, 3-43 R O OBEY option 3-41/3-42 Object code files differences between B-1 dumping 2-5 file code 700 1-1 linkfiles 1-1 listing 2-4 listing attributes of 3-25/3-27 loadfiles 1-1 specifying 3-17/3-18 structure of C-1/C-2 Optimization levels, listing procedures by 3-29 Options descriptions of 3-1/3-58 editing 3-16 repeating 3-16 OSS environment 2-2/2-3 OUT option 3-42/3-43 Output format, s
T Index tSRLs, listing (continued) hose linked into object code file 3-34 those with fixed-up symbols 3-34 Subprocedures, listing 3-30/3-32 Supported platforms 1-2 Symbol tables C-2 Syntax errors 4-24/4-38 SYSTEM option 3-52 T TANDEMINFO option 3-53/3-54 TANDEM_GINFO section C-1, C-2 TDS, ar utility and 5-1 TNS/R native object code files overview of 1-1 structure of C-1/C-2 V Visual Inspect 2-6 VOLUME option 3-52 W Warnings 4-19/4-24 Working directory, changing 3-5 X XREFPROC option description of 3-5
Special Characters Index noft Manual— 528273-003 Index -6