home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / man / man1 / ld.1 < prev    next >
Encoding:
Text File  |  1975-06-26  |  3.4 KB  |  135 lines

  1. .th LD I 8/16/73
  2. .sh NAME
  3. ld  \*-  link editor
  4. .sh SYNOPSIS
  5. .bd ld
  6. [
  7. .bd \*-sulxrdni
  8. ] name ...
  9. .sh DESCRIPTION
  10. .it Ld
  11. combines several
  12. object programs into one; resolves external
  13. references; and searches libraries.
  14. In the simplest case the names of several object
  15. programs are given, and
  16. .it ld
  17. combines them, producing
  18. an object module which can be either executed or
  19. become the input for a further
  20. .it ld
  21. run.
  22. (In the latter case, the
  23. .bd \*-r
  24. option must be given
  25. to preserve the relocation bits.)
  26. The output of
  27. .it ld
  28. is left on
  29. .bd a.out.
  30. This file is made executable
  31. only if no errors occurred during the load.
  32. .s3
  33. The argument routines are concatenated in the order
  34. specified.  The entry point of the output is the
  35. beginning of the first routine.
  36. .s3
  37. If any argument is a library, it is searched exactly once
  38. at the point it is encountered in the argument list.
  39. Only those routines defining an unresolved external
  40. reference are loaded.
  41. If a routine from a library
  42. references another routine in the library,
  43. the referenced routine must appear after the
  44. referencing routine in the library.
  45. Thus the order of programs within libraries
  46. is important.
  47. .s3
  48. .it Ld
  49. understands several flag arguments which are written
  50. preceded by a `\*-'.
  51. Except for \fB\*-l\fR,
  52. they should appear before the file names.
  53. .s3
  54. .lp +4 4
  55. \fB\*-s\fR    `squash' the output, that is, remove the symbol table
  56. and relocation bits to save space (but impair the
  57. usefulness of the debugger).
  58. This information can also be removed by
  59. .it strip.
  60. .s3
  61. .lp +4 4
  62. \fB\*-u\fR    take the following argument as a symbol and enter
  63. it as undefined in the symbol table.  This is useful
  64. for loading wholly from a library, since initially the symbol
  65. table is empty and an unresolved reference is needed
  66. to force the loading of the first routine.
  67. .s3
  68. .lp +4 4
  69. \fB\*-l\fR    This
  70. option is an abbreviation for a library name.
  71. \fB\*-l\fR
  72. alone stands for `/lib/liba.a', which
  73. is the standard system library for assembly language
  74. programs.
  75. \fB\*-l\fIx\fR
  76. stands for `/lib/lib\fIx\fR.a' where \fIx\fR is any character.
  77. A library is searched when its name is encountered,
  78. so the placement of a \fB\*-l\fR
  79. is significant.
  80. .s3
  81. .lp +4 4
  82. \fB\*-x\fR    do not preserve local
  83. (non-.globl) symbols in the output symbol table; only enter
  84. external symbols.
  85. This option saves some space in the output file.
  86. .s3
  87. .lp +4 4
  88. \fB\*-X\fR    Save local symbols
  89. except for those whose names begin with `L'.
  90. This option is used by
  91. .it cc
  92. to discard internally generated labels while
  93. retaining symbols local to routines.
  94. .s3
  95. .lp +4 4
  96. \fB\*-r\fR    generate relocation bits in the output file
  97. so that it can be the subject of another
  98. .it ld
  99. run.
  100. This flag also prevents final definitions from being
  101. given to common symbols,
  102. and suppresses the `undefined symbol' diagnostics.
  103. .s3
  104. .lp +4 4
  105. \fB\*-d\fR    force definition of common storage
  106. even if the
  107. .bd \*-r
  108. flag is present.
  109. .s3
  110. .lp +4 4
  111. \fB\*-n\fR    Arrange that
  112. when the output file is executed,
  113. the text portion will be read-only and shared
  114. among all users executing the file.
  115. This involves moving the data areas up the the first
  116. possible 4K word boundary following the
  117. end of the text.
  118. .s3
  119. .lp +4 4
  120. \fB\*-i\fR    When the output file is executed, the program
  121. text and data areas will live in separate address spaces.
  122. The only difference between this option
  123. and
  124. .bd \-n
  125. is that here the data starts at location 0.
  126. .i0
  127. .dt
  128. .sh FILES
  129. /lib/lib?.a   libraries
  130. .br
  131. a.out   output file
  132. .sh "SEE ALSO"
  133. as (I), ar (I)
  134. .sh BUGS
  135.