ld86.1 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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 -d
  39. delete the header from the output file, used for MSDOS COM files. As a side
  40. effect this also includes -s as there's nowhere to put a symbol table.
  41. .TP
  42. .B -Cx
  43. add file libdir-from-search/crtx.o to list of files linked
  44. .TP
  45. .B -D
  46. data base address follows (in format suitable for strtoul)
  47. .TP
  48. .B -H
  49. the top of heap (initial stack) address (in format suitable for strtoul)
  50. .TP
  51. .B -Lx
  52. add dir name x to the head of the list of library dirs searched
  53. .TP
  54. .B -M
  55. print symbols linked on stdout
  56. .TP
  57. .B -N
  58. Create a native Linux OMAGIC output file. If the contents are i386 code the
  59. binary can be either linked by GCC or executed by linux. If the
  60. .B -z
  61. option is also included the linker can generate a QMAGIC executable.
  62. .TP
  63. .B -Ox
  64. add library or object file libdir-from-search/x to list of files linked
  65. .TP
  66. .B -T
  67. text base address follows (in format suitable for strtoul)
  68. .TP
  69. .B -i
  70. separate I&D output
  71. .TP
  72. .B -lx
  73. add library libdir-from-search/libx.a to list of files linked
  74. .TP
  75. .B -m
  76. print modules linked on stdout
  77. .TP
  78. .B -o
  79. output file name follows
  80. .TP
  81. .B -s
  82. strip symbols
  83. .TP
  84. .B -r
  85. Generate a relocatable object from one source object, if the linker is
  86. given the -N option also the output format will be the hosts native format
  87. if possible.
  88. .TP
  89. .B -t
  90. trace modules being looked at on stdout
  91. .TP
  92. .B -y
  93. Alter the symbol tables to add label 'extensions' so that labels with
  94. more than 8 characters can be stored in elks executables.
  95. .TP
  96. .B -z
  97. produce "unmapped zero page" or "QMAGIC" executables
  98. .P
  99. All the options not taking an argument may be turned off by following the
  100. option letter by a '-', as for cc1.
  101. .SH PREDEFINED LABELS
  102. The linker predefines several labels that can be imported into user programs.
  103. .TP
  104. .B __etext
  105. Standard C variable for the end of the text segment.
  106. .TP
  107. .B __edata
  108. Standard C variable for the end of the initilised data.
  109. .TP
  110. .B __end
  111. Standard C variable for the end of the bss area.
  112. .TP
  113. .B __segoff
  114. The offset within the executable file between the start of the text segment
  115. and the start of the data segment in 16 byte 'paragraphs'. Note this is
  116. .B zero
  117. for impure (tiny model) executables and is adjusted for executables that
  118. don't start at offset 0 within the segment.
  119. .TP
  120. .B __segXDL
  121. The lowest address with data in segment 'X'. (eg __seg0DL is for segment zero
  122. or the text segment, __seg3DL is for the data segment)
  123. The value 'X' is a hex digit.
  124. .TP
  125. .B __segXDH
  126. The top of segment 'X's data area.
  127. .TP
  128. .B __segXCL
  129. The bottom of segment 'X's 'common data' or unitilised data area. Each
  130. segment has both an initilised and unitilised data area.
  131. .TP
  132. .B __segXCH
  133. The top of segment 'X's common area.
  134. .TP
  135. .B __segXSO
  136. This is the adjusted offset from segment 0 of the start of segment 'X'
  137. in 'paragraphs'.
  138. .SH HISTORY
  139. The 6809 version does not support -i.
  140. The previous versions of the linker could produce an 8086 executable with
  141. segments of a size >64k, now only i386 executables may have segments
  142. this large.
  143. .SH BUGS
  144. The linker cannot deal with reverse seeks caused by
  145. .B org
  146. instructions in the object file. Unlike previous versions the current one
  147. traps the error rather than trying to fill up the hard disk.
  148. The linker produces a broken a.out object file if given one input and the
  149. .B -r
  150. option this is so it is compatible with pre-dev86 versions.