ld86.1 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. .TH ld86 1 "Apr, 1997"
  2. .BY Bruce Evans
  3. .nh
  4. .SH NAME
  5. ld86 \- Linker for as86(1)
  6. .SH SYNOPSIS
  7. .BR ld86
  8. .RB [ -03MNdimrstyz [-]]
  9. .RB [ -llib_extension ]
  10. .RB [ -o\ outfile ]
  11. .RB [ -Ccrtfile ]
  12. .RB [ -Llibdir ]
  13. .RB [ -Olibfile ]
  14. .RB [ -Ttextaddr ]
  15. .RB [ -Hheapsize ]
  16. .RB [ -Ddataaddr ]
  17. .B infile...
  18. .SH DESCRIPTION
  19. This linker understands only the object files produced by the as86 assembler,
  20. it can link them into either an impure or a separate I&D executable.
  21. The linking defaults are everything off or none except for
  22. .B -0
  23. and the output file is
  24. .BR a.out .
  25. There is
  26. .I not
  27. a standard library location defined in the linker.
  28. .SH OPTIONS
  29. .TP
  30. .B -0
  31. produce header with 16-bit magic
  32. .\"and use library subdir i86 for -lx
  33. .TP
  34. .B -3
  35. produce header with 32-bit magic
  36. .\"and use library subdir i386 for -lx
  37. .TP
  38. .B -7
  39. produce Seventh Edition UNIX a.out header.
  40. .TP
  41. .B -d
  42. delete the header from the output file, used for MSDOS COM files. As a side
  43. effect this also includes -s as there's nowhere to put a symbol table.
  44. .TP
  45. .B -Cx
  46. add file libdir-from-search/crtx.o to list of files linked
  47. .TP
  48. .B -D
  49. data base address follows (in format suitable for strtoul)
  50. .TP
  51. .B -H
  52. the top of heap (initial stack) address (in format suitable for strtoul)
  53. .TP
  54. .B -Lx
  55. add dir name x to the head of the list of library dirs searched
  56. .TP
  57. .B -M
  58. print symbols linked on stdout
  59. .TP
  60. .B -N
  61. Create a native Linux OMAGIC output file. If the contents are i386 code the
  62. binary can be either linked by GCC or executed by linux. If the
  63. .B -z
  64. option is also included the linker can generate a QMAGIC executable.
  65. .TP
  66. .B -Ox
  67. add library or object file libdir-from-search/x to list of files linked
  68. .TP
  69. .B -T
  70. text base address follows (in format suitable for strtoul)
  71. .TP
  72. .B -i
  73. separate I&D output
  74. .TP
  75. .B -lx
  76. add library libdir-from-search/libx.a to list of files linked
  77. .TP
  78. .B -m
  79. print modules linked on stdout
  80. .TP
  81. .B -o
  82. output file name follows
  83. .TP
  84. .B -s
  85. strip symbols
  86. .TP
  87. .B -r
  88. Generate a relocatable object from one source object, if the linker is
  89. given the -N option also the output format will be the hosts native format
  90. if possible.
  91. .TP
  92. .B -t
  93. trace modules being looked at on stdout
  94. .TP
  95. .B -y
  96. Alter the symbol tables to add label 'extensions' so that labels with
  97. more than 8 characters can be stored in elks executables.
  98. .TP
  99. .B -z
  100. produce "unmapped zero page" or "QMAGIC" executables
  101. .P
  102. All the options not taking an argument may be turned off by following the
  103. option letter by a '-', as for cc1.
  104. .SH PREDEFINED LABELS
  105. The linker predefines several labels that can be imported into user programs.
  106. .TP
  107. .B __etext
  108. Standard C variable for the end of the text segment.
  109. .TP
  110. .B __edata
  111. Standard C variable for the end of the initilised data.
  112. .TP
  113. .B __end
  114. Standard C variable for the end of the bss area.
  115. .TP
  116. .B __segoff
  117. The offset within the executable file between the start of the text segment
  118. and the start of the data segment in 16 byte 'paragraphs'. Note this is
  119. .B zero
  120. for impure (tiny model) executables and is adjusted for executables that
  121. don't start at offset 0 within the segment.
  122. .TP
  123. .B __segXDL
  124. The lowest address with data in segment 'X'. (eg __seg0DL is for segment zero
  125. or the text segment, __seg3DL is for the data segment)
  126. The value 'X' is a hex digit.
  127. .TP
  128. .B __segXDH
  129. The top of segment 'X's data area.
  130. .TP
  131. .B __segXCL
  132. The bottom of segment 'X's 'common data' or unitilised data area. Each
  133. segment has both an initilised and unitilised data area.
  134. .TP
  135. .B __segXCH
  136. The top of segment 'X's common area.
  137. .TP
  138. .B __segXSO
  139. This is the adjusted offset from segment 0 of the start of segment 'X'
  140. in 'paragraphs'.
  141. .SH HISTORY
  142. The 6809 version does not support -i.
  143. The previous versions of the linker could produce an 8086 executable with
  144. segments of a size >64k, now only i386 executables may have segments
  145. this large.
  146. .SH BUGS
  147. The linker cannot deal with reverse seeks caused by
  148. .B org
  149. instructions in the object file. Unlike previous versions the current one
  150. traps the error rather than trying to fill up the hard disk.
  151. The linker produces a broken a.out object file if given one input and the
  152. .B -r
  153. option this is so it is compatible with pre-dev86 versions.