HP nld, noft User Manual

nld and noft Manual
Abstract
This manual explains how to use the following TNS/R native object file utilities: nld (T6017), which links and changes object file attributes; noft (T9626), which displays object files; ar (T8629), which creates and maintains archives of object files; and strip (T8629), which removes unnecessary information from loadable object files (loadfiles) in the HP NonStop™ Kernel Open System Services (OSS) environment.
nld D44 noft D45 ar D43 strip D43
Supported Release Updates (RVUs)
This manual supports D45 and G06 and all subsequent RVUs until otherwise indicated in a new edition.
Part Number Published
520384 -003 May 2003
Document History
Part Number Product Version Published
426922- 001 nld D44, no ft D4 2, ar D43 November 2000 427686- 001 nld D44, no ft D4 2, ar D43, strip D 43 February 2001 520384- 001 nld D44, no ft D4 2, ar D43, strip D 43 July 2001 520384- 002 nld D44, no ft D4 2, ar D43, strip D 43 February 2002 520384- 003 nld D44, no ft D4 5, ar D43, strip D 43 May 2003
Hewlett-Packard Company—520384-003
i
nld and noft Manual
Glossary Index Examples Tables
What’s New in This Manual xi
Manual Information xi New and Changed Information xii
About This Manual xv
Audience xv Related Reading xvi Your Comments Invited xvi Notation Conventions xvii
1. Introduction to the Utilities
Native Object Files 1-2 nld 1-2 noft 1-4 ar 1-5 strip 1-5
2. nld Util ity
Running the nld Utility in the Guardian Environment 2-1 Running the nld Utility in the OSS Environment 2-3 Running Windows nld on the PC
2-4
Components of Windows nld
2-4
Directory Structure of Windows nld 2-4 Compilers That Can Launch Windows nld 2-5 How Windows nld Differs from nld 2-5 How the ETK Command-Line and GUI Interfaces Differ 2-6 Command-Line Interface Linking Options 2-7
Changing the Target Environment 2-8 Creating Loadfiles and Linkfiles 2-8
Contents
nld and noft Manual—520384-003
ii
2. nld Utility (continued)
2. nld Util ity (continued)
Linking Programs 2-9
C Programs 2-9 C++ Programs 2-10 COBOL Programs 2-12 pTAL Programs 2-13 Mixed-Language Programs 2-13 Programs With Embedded NonStop SQL/MP 2-13
Linking User Libraries 2-13 Linking Shared Run-Time Libraries (SRLs) 2-15
Specifying SRLs 2-16 Determining Which SRLs Programs Require 2-17
Linking Archive Files 2-21 Linking Floating-Point Programs 2-22
Link-Time Consistency Checking 2-23 Run-Time Consistency Checking 2-25 Linking Mixed-Language Pro gram s 2-26
Searching for Archives and SRLs With Simple Filenames 2-27 Dynamic and Static Linking 2-28 Str i pping Sym bol Informa tion 2-29 nld Compilation Rules 2-29
Case Sensitivity 2-29 Local and Shared Symbols 2-30 Declaration and Definition 2-31
3. nld Options
-allow_duplicate_procs 3-2
-allow_missing_libs 3-3
-allow_multiple_mains 3-3
-ansistreams 3-3
-bdynamic 3-3
-bstatic 3-4
-change 3-4
-e 3-5
-elf_check 3-5
-export 3-5
-fl or -obey 3-6
-import 3-6
-l or -lib 3-7
Contents
nld and noft Manual—520384-003
iii
3. nld Options (continued)
3. nld Options (continued)
-L or -libvol 3-8
-libname 3-9
-nostdfiles 3-9
-nostdlib 3-9
-noverbose 3-10
-NS_extent_size 3-10
-NS_max_extents 3-10
-o 3-11
-r 3-11
-rename 3-12
-s 3-12
-set 3-13
-stdin 3-15
-strip 3-16
-ul 3-16
-verbose 3-16
-x 3-17
-y 3-17
4. noft Utility
Running the noft Utility in the Guardian Environment 4-1 Running the noft Utility in the OSS Environment 4-3 Listing Object Files 4-4 Dumping Object Files 4-5 Controlling the noft Environm ent 4-5 Debugging With noft 4-7
5. noft Options
Break Key 5-3 ! (Exclamation Point) 5-4 CD 5-5 COMMENT 5-5 DUMPADDRESS or DA 5-6 DUMPOFFSET or DO 5-8 DUMPPROC or DP 5-10 ENV 5-13 EXIT or E 5-13 FC 5-14
Contents
nld and noft Manual—520384-003
iv
5. noft Options (continued)
5. noft Options (continued)
FILE or F 5-15 HELP or ? 5-17 HISTORY or H 5-20 LAYOUT 5-21 LISTATTR IBUTE or LA 5-22 LISTCOMPILERS or LC 5-23 LISTOP TI MIZE or LO 5-26 LISTPROC or LP 5-27 LISTSOURCE or LS 5-29 LISTSRLEXPORTS or LLE 5-30 LISTSRLFIXUPS or LLF 5-30 LISTSRLINFO or LLI 5-31 LISTUNREFERENCED or LUR 5-32 LISTUNRESOLVED or LU 5-35 LOG 5-38 OBEY 5-39 OUT 5-39 QUIT or Q 5-40 RESET 5-41 SET 5-42 SHOW 5-47 SYSTEM or VOLUME 5-48 XREFPROC or XP 5-49
6. ar Utility
7. strip Utility
8. Native Object File Structure
Code and Data Segments 8-1 MDEBUG Section 8-2
9. Converting From Binder to nld and noft
Object File Differences 9-1 Linking Unit Differences 9-2 Comparing Binder Commands to nld Options 9-3 Comparing Binder Commands to noft Options 9-6
Contents
nld and noft Manual—520384-003
v
10. nld Diagnostic Messages
10. nld Diagnostic Messages
General Information 10-1 Terms That Appear in nld Diagnostic Messages 10-2 Fatal Errors 10-12 Nonfatal Errors 10-61 Warnings 10-69 Informational Messages 10-77
11. noft Diagnostic Messages
Fatal Errors 11-1 Data Errors 11-4 Warnings 11-18 Syntax Errors 11-22
12. ar Diagnostic Messages A. Sample nld and noft Session
Example Program A-1
Header Files A-2 Source Module MAINC A-3 Source Module MODULE1C A-3 Source Module MODULE2C A-5 User Library UTILC A-6
Compilation Commands A-6 nld Command Examples A-7 Program Output A-8 noft Command Examples on a Linkfile A-9
FILE
A-9
LISTATTRIBUTE
A-9
LISTCOMPILERS A-10 LISTPROC A-10 LISTSOURCE A-12 LISTSRLINFO A-13 LISTUNRESOLVED A-14
Contents
nld and noft Manual—520384-003
vi
A. Sample nld and noft Session (continued)
A. Sample nld and noft Session (continued)
noft Command Examples on a Loadfile A-15
FILE A-15 LISTATTRIBUTE A-16 LISTCOMPILERS A-17 LISTPROC A-17 LISTSOURCE A-18 SET SORT A-19 LISTSRLINFO A-19 LISTUNRESOLVED A-20 LISTOPTIMIZE A-21 XREFPROC A-21 DUMPPROC A-24 LISTSRLFIXUPS A-26 LISTSRLEXPORTS A-27 LISTSRLFIXUPS A-27
Glossary Index
Examples
Example 2-1. Creating a Loadfile (Guardian) 2-2 Example 2-2. Changing the HIGHPIN Attribute (Guardian) 2-2 Example 2-3. Creating a Loadfile (OSS) 2-3 Example 2-4. Creating a User Library (OSS) 2-3 Example 2-5. Creating a Program File (OSS) 2-3 Example 2-6.
Creating an Executable C Program (OSS) 2-4
Example 2-7.
Running nmcobol and Launching Windows nld 2-5 Example 2-8. Running nld from the Command Prompt 2-6 Example 2-9. Creating a Program for the Guardian Environment (OSS) 2-8 Example 2-10. Creating an Executable C Program 2-10 Example 2-11. Linking a Mixed-Language Program With IEEE Floating-Point
Format 2-26 Example 2-12. Searching for ZCRTLSRL and ZCRESRL (Guardian) 2-28 Example 2-13. Searching for ZCRTLSRL and ZCRESRL (OSS) 2-28 Example 2-14. Searching for ZCOBSRL and ZCRESRL (OSS) 2-28 Example 4-1. noft Command Line 4-3 Example 4-2. Interactive noft Session Equivalent to Example 4-1 on page 4-3 4-4 Example 4-3. C Program 4-7
Contents
nld and noft Manual—520384-003
vii
Examples (continued)
Examples (continued)
Example 4-4. Optimize 0 Listing 4-8 Example 4-5. Optimize 1 Listing 4-9 Example 4-6. Optimize 2 Listing 4-10 Example 5-1. CD Option 5-5 Example 5-2. DUMPADDRESS Option 5-7 Example 5-3. DUMPOFFSET Option 5-9 Example 5-4. DUMPPROC Option 5-12 Example 5-5. Displaying Current noft Environment Settings 5-13 Example 5-6. FILE Option 5-16 Example 5-7. HELP ALL Option 5-18 Example 5-8. HELP SET HISTORYBUFFER 5-19 Example 5-9. HELP Without Options 5-19 Example 5-10. HISTORY Option 5-20 Example 5-11. LAYOUT Option 5-21 Example 5-12. LISTATTRIBUTE Option for Non-PIC Object File 5-22 Example 5-13. LISTATTRIBUTE Option for PIC Object File 5-23 Example 5-14. LISTCOMPILERS Option (BRIEF) 5-24 Example 5-15. LISTCOMPILERS Option (DETAIL) 5-24 Example 5-16. LISTOPTIMIZ E Option 5-26 Example 5-17. LISTPROC Option (BRIEF) 5-28 Example 5-18. LISTPROC Option (DETAIL) 5-28 Example 5-19. LISTSOURCE Option (BRIEF) 5-29 Example 5-20. LISTSOURCE Option (DETAIL) 5-30 Example 5-21. LISTSRLINFO Option (BRIEF) 5-31 Example 5-22. LISTSRLINFO Option (DETAIL) 5-31 Example 5-23. pTAL Program for Example 5-24 and Example 5-29 5-33 Example 5-24. LISTUNREFERENCED Option for Example5-23 pTAL
Program 5-33 Example 5-25. C Program for Example 5-26 and Example 5-30 5-34 Example 5-26. LISTREFERENCED Option for Example 5-25 C Program 5-34 Example 5-27. LISTUNRESOLVED Option (BRIEF) 5-36 Example 5-28. LISTUNRESOLVED Option (DETAIL) 5-36 Example 5-29. LISTUNRESOLVED Option for Example 5-23 pTAL Program 5-37 Example 5-30. LISTUNRESOLV ED Option for Example 5-25 C Program 5-37 Example 5-31. Effect of EXCLUDE on LISTUNRESOLVED Option 5-37 Example 5-32. LOG Option 5-38 Example 5-33. OBEY Option 5-39 Example 5-34. OUT Option When “?” is Specified 5-40
Contents
nld and noft Manual—520384-003
viii
Examples (continued)
Examples (continued)
Example 5-35. Resetting Target Object File Parameters to Their Default
Values 5-41 Example 5-36. SHOW Option 5-47 Example 5-37. XREFPROC Option (BRIEF) 5-51 Example 5-38. XREFPROC Option (DETAIL) 5-51 Example 5-39. XREFPROC Option (for C Program in Example 5-25) 5-52 Example 5-40. XREFPROC Option for Non-PIC Object File With “Reference”
Indicators (CALLS and DETAIL) 5-52 Example 9-1. Linking Two Object Files in Binder and nld (Simple Case) 9-4 Example 9-2. Linking Two Object Files in Binder and nld (Less Simple Case) 9-5 Example 9-3. Setting the INSPECT Attribute in Binder and nld 9-5 Example A-1. Header File GLOBALSH With Edit Line Numbers A-2 Example A-2. Header File MODULE1H With Edit Line Numbers A-2 Example A-3. Header File MODULE2H With Edit Line Numbers A-2 Example A-4. Header File UTILH With Edit Line Number A-3 Example A-5. Source Module MAINC With Edit Line Numbers A-3 Example A-6. Source Module MODULE1C With Edit Line Numbers A-4 Example A-7. Source Module MODULE2C With Edit Line Numbers A-5 Example A-8. User Library UTILC With Edit Line Numbers A-6 Example A-9. Linking an Executable User Library A-7 Example A-10. Linking a Program File A-7 Example A-11. Sample Program Output A-8 Example A-12. FILE Option (Linkfile) A-9 Example A-13. LISTATTRIBUTE Option (Linkfile) A-9 Example A-14. LISTCOMPILERS Option (Linkfile) A-10 Example A-15. LISTPROC Option (Linkfile) A-11 Example A-16.
LISTSOURCE Option (Linkfile) A-12 Example A-17.
LISTSRLINFO Option (Linkfile) A-13 Example A-18. LISTUNRESOLVED Option (Linkfile) A-14 Example A-19. FILE Option (Loadfile) A-15 Example A-20. LISTATTRIBUT E Option (Load file) A-16 Example A-21. LISTCOMPILERS Option (Loadfile) A-17 Example A-22. LISTPROC Option (Loadfile) A-17 Example A-23.
LISTSOURCE Option (Loadfile) A-18 Example A-24.
Effect of SET SORT on LISTPROC and LISTSOURCE A-19 Example A-25. LISTSRLINFO Option (Loadfile) A-19 Example A-26. LISTUNRESOLVED Option (Loadfile) A-20 Example A-27. LISTOPTIMIZE Option (Load fil e) A-21
Contents
nld and noft Manual—520384-003
ix
Examples (continued)
Examples (continued)
Example A-28. Effect of SET SCOPESOURCE on LISTOPTIMIZE Option A-21 Example A-29. Effect of SET SCOPESOURCE on XREFPROC Option A-21 Example A-30. Effect of RESET SCOPESOURCE on XREFPROC Option A-22 Example A-31. XREFPROC Option (Loadfile) A-23 Example A-32. DUMPPROC Option A-24 Example A-33. Effect of SET FORMAT INNERLIST on DUMPPROC Option A-25 Example A-34. LISTSRLFIXUP Option A-26 Example A-35. LISTSRLEXPORTS Option A-27 Example A-36. LISTSRLFIXUP (LLF) Option A-27
Tables
Table 2-1. Using the Guardian nld Utility to Link SRLs 2-17 Table 2-2. Using the OSS nld Utility to Link SRLs 2-19 Table 2-3. Floating-Point Consistency Check by nld Utility
(floattype Not Specified) 2-23
Table 2-4. Floating-Point Type Consistency Check by nld
(floattype Specified) 2-24 Table 2-5. Incompatible Program File and User Library floattypes (TNS) 2-25 Table 2-6. Local and Shared Symbols by Language 2-30 Table 2-7. Declarations and Definitions by Language 2-31 Table 3-1. nld Flag Summary 3-1 Table 3-2. Descriptions of Run-Time Attributes 3-13 Table 3-3. Default Run-Time Attribute Values 3-15 Table 4-1. noft Listing Options 4-4 Table 4-2. noft Dumping Options 4-5 Table 4-3. noft Control Options 4-5 Table 5-1. noft Flag Summary 5-1 Table 7-1. Unnecessary Information in Loadfiles 7-1 Table 8-1. Loadfile Segments and Sections 8-1 Table 8-2. MDEBUG Section Tables 8-2 Table 9-1. Corresponding Binder Tasks and Native Utilities 9-1 Table 9-2. Comparing Binder Commands to nld Options 9-3 Table 9-3. Comparing Binder with noft 9-6 Table 10-1. Comparison of nld Diagnostic Types 10-1 Table 10-2. Warning and Informational Message Defaults 10-1
Contents
nld and noft Manual—520384-003
x
nld and noft Manual—520384-003
xi
What’s New in This Manual
Manua l In forma ti o n
nld and noft Manual
Abstract
This manual explains how to use the following TNS/R native object file utilities: nld (T6017), which links and changes object file attributes; noft (T9626), which displays object files; ar (T8629), which creates and maintains archives of object files; and strip (T8629), which removes unnecessary information from loadable object files (loadfiles) in the HP NonStop™ Kernel Open System Services (OSS) environment.
Product Version
nld D44 noft D45 ar D43 strip D43
Supported Release Updates (RVUs)
This manual supports D45 and G06 and all subsequent RVUs until otherwise indicated in a new edition.
Document History
Part Numb er Pub l i sh ed
520384- 003 May 2003
Part Number Product Version Published
426922- 001 nld D44, no ft D4 2, ar D43 November 2000 427686- 001 nld D44, no ft D4 2, ar D43, strip D 43 February 2001 520384- 001 nld D44, no ft D4 2, ar D43, strip D 43 July 2001 520384- 002 nld D44, no ft D4 2, ar D43, strip D 43 February 2002 520384- 003 nld D44, no ft D4 5, ar D43, strip D 43 May 2003
What’s New in This Manual
nld and noft Manual—520384-003
xii
New and Changed Information
New and Changed Information
nld Utility on page xii
noft Utility on page xii
Miscellaneous on page xiii
nld Utility
New information in:
Native Object Files on page 1-2
nld on page 1-2
Running Windows nld on the PC on page 2-4
C Programs on page 2-9
C++ Programs on page 2-10
Table 2-1, Using the Guardian nld Utility to Link SRLs, on page 2-17
Table 2-2, Using the OSS nld Utility to Link SRLs, on page 2-19
-e on page 3-5
Table 3-2, Descriptions of Run-Time Attributes, on page 3-13
Table 3-3, Default Run-Time Attribute Values, on page 3-15
Fatal Errors on page 10-12:
°
1306
°
1307
Nonfatal Errors on page 10-61:
°
2022
°
2041
°
2042
Warnings on page 10-69:
°
10043
°
10044
noft Utility
Changes to Section 5, noft Options:
°
The option LISTUNRESOLVED or LU on page 5-35 has a new option, EXCLUDE or E, which excludes system-supplied functions
°
Correction of the syntax of SET on page 5-42
What’s New in This Manual
nld and noft Manual—520384-003
xiii
Miscellaneous
°
The option XREFPROC or XP on page 5-49 can now identify reference parameters in a non-PIC target file
°
The following examples have been changed or added to reflect support for Dynamic-Link Libraries (DLLs):
°
Example 5-11, LAYOUT Option, on page 5-21 (changed)
°
Example 5-12, LISTATTRIBUTE Option for Non-PIC Object File, on
page 5-22 (changed)
°
Example 5-13, LISTATTRIBUTE Option for PIC Object File, on page 5-23
(added)
°
Example 5-31, Effect of EXCLUDE on LISTUNRES OLVED Option, on
page 5-37 (changed)
°
Example 5-40, XREFPROC Option for Non-PIC Object File With “Reference” Indicators (CALLS and DETAIL), on page 5-52 (added)
Changes to Section 11, noft Diagnostic Messages:
°
New data errors:
°
1006
°
1007
°
1065
°
Changed data error 1007
°
New warnings:
°
2013
°
2014
°
2015
°
2016
In Appendix A, Sample nld and noft Session, the examples have been rerun on the newest software
Miscellaneous
New glossary items:
°
dynamic-link library (DLL)
°
PIC (position-independent code)
°
shared code
Changes to Section A, Sample nld and noft Session, indicated by change bars
Miscellaneous minor changes, indicated by change bars
What’s New in This Manual
nld and noft Manual—520384-003
xiv
Miscellaneous
nld and noft Manual—520384-003
xv
About This Manual
This manual explains how to use the following TNS/R native object file utilities:
nld, which links and changes object file attributes
noft, which displays object files
ar, which creates and maintains archives of object files
strip, which removes unnecessary information from loadable object files (loadfiles) in the HP NonStop™ Kernel Open System Services (OSS) environment
Subsections:
Audience on page xv
Related Reading on page xvi
Your Comments Invited on page xvi
Notation Conventions on page xvii
Audience
This manual is intended for systems programmers and application programmers who are familiar with the following:
HP NonStop™ servers
NonStop Kernel operating system
Reference manuals a nd pr ogr amme r’s guides for the lan guage s i n which pr ogr ams are written (C/C++, COBOL, and pTAL—see R elated Readin g on page xvi)
About This Manual
nld and noft Manual—520384-003
xvi
Related Reading
Related Reading
C/C++ Programmer’s Guide
COBOL85 for NonStop Systems Manual
DLL Programmer’s Guide for TNS/R Systems
Guardian Procedure Calls Reference Manual
Guardian Procedure Errors and Messages Manual
Guardian Programmer’s Guide
Guardian User’s Guide
Inspect Manual
ld and rld Reference Manual
Open System Services Programmer’s Guide
Open System Services User’s Guide
Open System Services Shell and Utilities Reference Manual
pTAL Conversion Guide
pTAL Reference Manual
TACL Reference Manual
TNS/R Native Application Migration Guide
Using the Command-Line Cross Compilers on Windows
Your Comments Invited
After using this manual, please take a moment to send us your comments. You can do this by:
Completing the online Contact NonStop Publications form if you have Internet access.
Faxing or mailing the form, which is included as a separate file in Total Information Manager (TIM) collections and located at the back of printed manuals. Our fax number and mailing address are included on the form.
Sending an e-mail message to the address included on the form. We will immediately acknowledge receipt of your message and send you a detailed response as soon as possible. Be sure to include your name, company name, address, and phone number in your message. If your comments are specific to a particular manual, also include the part number and title of the manual.
Many of the improvements you see in manuals are a result of suggestions from our customers. Please take this opportunity to help us improve future manuals.
About This Manual
nld and noft Manual—520384-003
xvii
Notation Conventions
Notation Conventions
Hypertext Links on page xvii
General Syntax Notation on page -xvii
Example Notation on page xix
Change Bar Notation on page xix
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 Sy ntax Notati on
The following list summarizes the notation conventions for syntax presentation in this manual.
UPPERCASE LETTERS. Uppercase letters indicate keywords and reserved words; enter
these items exactly as shown. Items not enclosed in brackets are required. For example:
MAXATTACH
lowercase italic letters. Lowercase italic letters indicate variable items that you supply.
Items not enclosed in brackets are required. For example:
file-name
[ ] Brackets. Brackets enclose optional syntax items. For example:
TERM [\system-name.]$terminal-name INT[ERRUPTS]
A group of items enclosed in brackets is a list from which you can choose one item or none. The items in the list may be arranged either vertically, with aligned brackets on each side of the list, or horizontally, enclosed in a pair of brackets and separated by vertical lines. For example:
LIGHTS [ ON ] [ OFF ] [ SMOOTH [ num ] ]
K [ X | D ] address-1
About This Manual
nld and noft Manual—520384-003
xviii
General Syntax Notation
{ } 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. A vertical line separates alternatives in a horizontal list that is enclosed in
brackets or braces. For example:
INSPECT { OFF | ON | SAVEABEND }
… Ellipsis. An ellipsis immediately following a pair of brackets or braces indicates that you
can repeat the enclosed sequence of syntax items any number of times. For example:
M address-1 [ , new-value ]... [ - ] {0|1|2|3|4|5|6|7|8|9}...
An ellipsis imme diately fol lowing a single syntax item indi cates that you can repeat that syntax item any number of times. For example:
"s-char..."
Punctuation. Parentheses, commas, semicolons, and other symbols not previously
described must be entered as shown. For example:
error := NEXTFILENAME ( file-name ) ; LISTOPENS SU $process-name.#su-name
Quotation marks around a symbol such as a bracket or brace indicate the symbol is a required character that you must enter as shown. For example:
"[" repetition-constant-list "]"
Item Spacing. Spaces shown between items are required unless one of the items is a
punctuation symbol such as a parenthesis or a comma. For example:
CALL STEPMOM ( process-id ) ;
If there is no space between two items, spaces are not permitted. In the following example, there are no spaces permitted between the period and any other items:
$process-name.#su-name
About This Manual
nld and noft Manual—520384-003
xix
Example Notation
Line Spaci ng. 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 ]...
Example Notation
In examples with user input, user input is in bold type and it is assumed that the user presses the return key after typing the input. For instance, in the example:
ENTER RUN CODE ?123 CODE RECEIVED: 123.00
the system displays ENTER RUN CODE on one line and prompts the user with ? on the next line, the user types 123 and presses return, and the system displays:
CODE RECEIVED: 123.00.
Change Bar Notation
A change bar (as shown to the right of this paragraph) indicates a substantive difference between this edition of the manual and the preceding edition. Change bars highlight new or revised information.
About This Manual
nld and noft Manual—520384-003
xx
Change Bar Notation
nld and noft Manual—520384-003
1-1
1 Introducti on t o the Ut il itie s
The utilities operate in the TNS/R native mode development environment on TNS/R
native object files. All of the utilities except nld operate on both PIC (position- independent code) and non-PIC (non-position-independent code) files.
PIC and non-PIC native object files are generated by the native C, native C++, native COBOL, and pTAL compilers. For information on these compilers, see the following manuals:
C/C++ Programmer’s Guide
COBOL85 for NonStop Systems Manual
pTAL Reference Manual
For general information about PIC, see the DLL Programmer’s Guide for TNS/R Systems.
In the TNS/R native development environment, the functions that nld and noft provide are similar but not identical to the functions that the Binder product provides in the TNS development environment. For migration information, see Section 9,
Converting From Binder to nld and noft.
Subsections:
Native Object Files on page 1-2
nld on page 1-2
noft on page 1-4
ar on page 1-5
strip on page 1-5
Utility Full Name Description
nld Native link editor Links one or m ore non-PIC object files to produce a
single non-PIC loadfile
or linkfile.
(To produce a PIC object file—suc h as a dynamic-
link library (D LL)—use the ld utility, which is
explained in the ld and rld Reference Manual.)
noft Native object file tool Displays all portions of native object files ar Archive tool Creates and maintains archives of files for
processing by nld
strip strip utility Removes unnecessary information from loadfiles
Introduction to the Utilities
nld and noft Manual—520384-003
1-2
Native Objec t Fi les
Native Object Files
nld, noft, ar, and strip operate on native object files. Native object files are in Executable and Linking Format (ELF), a standard format used for object files, with HP extensions. For details on the structure of native object files, see Section 8, Native
Object File Structure.
Native object files are either linkfiles or loadfiles, but not both.
The native compilers produce only linkfiles. The nld utility can produce either linkfiles or loadfiles.
Linkfiles can be used as nld input or noft input. Loadfiles can be used as nld input in several ways:
For change of attributes or stripping options
For use in determining the libraries to be used at run time
As symbol bindings. Loadfiles can also be used as noft input. For example:
nld newobj.o crtlmain.o zcrtlsrl
specifies a linkfile (newobj.o), a library linkfile (crtlmain.o), and a library loadfile (zcrtlsrl). Including the library load file in the nld command makes its facilities available at run time.
Native object files in the Guardian environment have a file code of 700.
nld
The nld utility allows you to:
Link one or more non-PIC TNS/R native object files to produce a single non-PIC
loadfile or linkfile
Modify existing loadfiles The nld utility runs in the following environments:
Guardian
OSS
Windows NT, Windows 2000, and Windows XP, by means of the HP Enterprise
Toolkit—NonStop Edition (ETK), which is based on Microsoft Visual Studio .NET
Can Be Linked to Produce a Loadfile Can Be Loaded for Execution
Linkfiles Yes No Loadfiles No Yes
Introduction to the Utilities
nld and noft Manual—520384-003
1-3
nld
The nld utility has the same capabilities in each environment, but each environment has a slightly different syntax.
You can run nld in the following ways:
Directly
Automatically, from the following compilers:
As a batch process by issuing nld commands from a terminal or a command file You cannot run nld interactively. This manual explains only how to run nld directly. For information on running nld
from compilers, see the following manuals:
C/C++ Programmer’s Guide
COBOL85 for NonStop Systems Manual
pTAL Reference Manual
For more information about nld in this manual, see:
Section 2, nld Utility
Section 3, nld Options
Section 10, nld Diagnostic Messages
Environment Compiler T Number
Guardian NMC T9577
NMCPLUS T9225 NMCOBOL T8107
OSS c89 T8164
nmcobol T8107
Window s N T * Window s 2000* Window s XP*
All of the ab ov e and ptal T9248
* By means of ETK
Introduction to the Utilities
nld and noft Manual—520384-003
1-4
noft
noft
The noft utility reads and displays information from native object files. noft allows you to:
Determine the optimization level of procedures in a file
Display object code with corresponding source code
List shared run-time library (SRL) references in an object file
List unresolved references in an object file
List object file attributes
Display the following object file components:
°
Various file headers
°
Program text and data
°
Symbol table and its component parts
°
Run-time procedure table and relocation tables These noft capabilities are useful when developing and debugging programs. The noft utility runs in the following environments:
Guardian
OSS
The noft utility has the same capabilities in each environment, but each environment has a slightly different syntax.
You can run noft in the following ways:
Interactively from the TACL prompt or OSS shell prompt
As a batch process by issuing commands from a terminal or a command file
For more information, see:
Section 4, noft Utility
Section 5, noft Options
Section 11, noft Diagnostic Messages
Introduction to the Utilities
nld and noft Manual—520384-003
1-5
ar
ar
The ar utility allows you to:
Create archives from groups of files
Modify archives by:
°
Adding files
°
Extracting files
°
Deleting files
°
Replacing files When an archive contains one or more native (TNS/R) files, nld can use that archive
as an object file library. If an archive contains both TNS and TNS/R files, nld cannot use that archive. If a mixed file is created on a Windows platform, it is not flagged as erroneous, but only because Windows does not recognize TNS files as object files.
The ar utility runs in the following environments:
Guardian
Open System Services (OSS)
The following PC platforms:
For more information, see:
Section 6, ar Utility
Section 12, ar Diagnostic Messages
strip
The strip utility removes unnecessary information from loadfiles. Unnecessary information is that which is not required for proper execution of the files.
The strip utility runs in the Open System Services (OSS) environment. For more information, see Section 7, strip Utility.
Note. The ar utility ca n also use archives c reated by the ld ut ilit y. For inform at ion about the ld utility, see the ld and r ld R eference Manual.
Platform
Operating System
Windows 98 Windows NT Windows 2000 Windows XP
TDS
1
Yes Yes No No
ETK
2
No Yes Yes Yes
1. Tandem Development Suite
2. HP Enterprise Toolkit—NonSt op Edition
Introduction to the Utilities
nld and noft Manual—520384-003
1-6
strip
nld and noft Manual—520384-003
2-1
2 nld Utility
The nld utility, the native link editor, links one or more non-PIC TNS/R native object files to produce a single non-PIC loadfile or linkfile.
Subsections:
Running the nld Utility in the Guardian Environment on page 2-1
Running the nld Utility in the OSS Environment on page 2-3
Running Windows nld on the PC on page 2-4
Changing the Target Environment on page 2-8
Creating Loadfiles and Linkfiles on page 2-8
Linking Programs on page 2-9
Linking User Libraries on page 2-13
Linking Shared Run-Time Libraries (SRLs) on page 2-15
Linking Archive Files on page 2-21
Linking Floating-Point Pro gram s on page 2-22
Searching for Archives and SRLs With Simple Filenames on page 2-27
Dynamic and Static Linking on page 2-28
Stripping Symbol Information on page 2-29
nld Compilation Rules on page 2-29
Running the nld Utility in the Guardian Environment
To run the nld utility in the Guardian environment, use the following syntax:
[RUN] NLD
is the TACL command to start the nld process.
[RUN] NLD [ / IN command-Filename [, OUT output-listing ] / ] [ Filename ] ... [ option ] ...
Note. Filename argument s need not be s pecifi ed bef ore option arguments. Arguments ca n be mixed. An item that begins with a hyphen (-) is an option, any other item is a Filename.
nld Utility
nld and noft Manual—520384-003
2-2
Running the nld Utility in the Guardian Environment
command-Filename
is a Guardian filename or a map DEFINE for an nld command file. nld uses command-Filename only if no Filename or option arguments are specified on the command line; otherwise, nld ignores command-Filename.
output-listing
is a Guardian filename to which nld writes its listing. The file can be type 101 (edit file) or type 129 (spooler file).
If output-listing is a disk filename and the file does not exist, nld creates a type 101 edit file.
If you omit the OUT option, nld writes its output to your current default output file.
Filename
is a Guardian filename for a native object file. Depending on the options specified, the file can be a linkfile or a loadfile.
option
is an nld option (a flag and its parameters, if any). You must include a space between a flag and its parameters except after the -l and -L flags. Case is not significant when specifying nld options, except for the -l and -L flags. For descriptions of nld flags and their parameters, see Section 3, nld Options.
If you do not specify any para meter s on the comm and line and the standard input fil e is not an edit file, nld returns syntax information.
You can specify input from the command line or use the option -fl or -obey on page 3-6, which allows the contents of a file to be entered in the command input at the point specified. Use the -obey option to supply several options or input filenames.
Example 2-1 links together the input object files named objecta and objectb to
create a loadfile named objectc.
Example 2-2 changes the HIGHPIN attribute in the loadfile exeobj to OFF.
Example 2-1. Creating a Loadfile (Guardian)
nld objecta objectb -o objectc
Example 2-2. Changing the HIGHPIN Attribute (Guardian)
nld -change highpin off exeobj
Loading...
+ 300 hidden pages