Solid C: ld.txt

Sprinter Computer http://sprinter.nedopc.org

Moderator: Shaos

User avatar
Shaos
Admin
Posts: 24086
Joined: 08 Jan 2003 23:22
Location: Silicon Valley

Solid C: ld.txt

Post by Shaos »

Code: Select all

                             Linker 
 
 
Linker LD is used to build complete programs or DLL-libraries 
(dynamic linked libraries) from separated object modules.
As object modules may be used REL or IRL files (made by librarian OL.EXE).
Description of REL and IRL file formats see in files "rel.txt" and "irl.txt". 
 
Using of linker: 
 
     LD [/keys] [outfile=] infile[/keys] [,infile[/keys] ...] [@ list] 
 
where:
	keys         -  linker options 
	outfile      -  name of output file 
	infile       -  input file in "rel" or "irl" format 
	@ list       -  list file 
 
 
For example:
 
     LD hello.rel 
 
After that we get file "hello.exe". 
 
During link procedure linker may create temporary files on the disk.
Therefore you may use virtual RAM-disk for faster work. 
 
Linker options:
 
      A          use disk to save symbol table 
      D##        set address of DATA segment 
      E          do not include EXE-header 
      Glabel     define label with name 'label' as entry point 
      L          search library file (option after filename) 
      P##        set address of CODE segment 
      Q          print labels "?labels" on the screen 
      R##        set address of loading (ORG adress) 
      S          print list of labels to the screen 
      T[type:ver] create DLL library ("type" is internal 
                 description of library, "ver" is version of library) 
      U          replace "@" to "_" in label names 
      Y          exclude DATA segment from output code 
      X          do not create SYM file 
 
 
 
                        Creation of DLL-libraries 
 
To create dynamic linked libraries option "t" should be used.
Note, that using this option means no EXE header in output code.
Linker checks for exceeding if 16K limit. If it is happend linker print 
warning message about it but continues link procedure. 
 
Created DLL-libraries have "L1" signature in header. 
"L1" differ from "L0" by relocating table start point. DLL-header is
created and added to output file by linker and you do not needed reserve
place for it in source code. See details in library manager documentation 
(LIBMAN). 
 
Example of DLL creation: 
 
     LD /TSymple library:0001 test.rel 
 
where:
       "Symple library"  - description for internal usage that may have spaces 
                           (not more than 16 characters). 
       "0001"            - internal version number that should consist of 4
                           numbers 0..9 or characters A..F (a..f).
       "test.rel"        - filename of input object file. 
 
Option T may be used without "type" and "ver" info, but symbol ':' should 
be after it. 
 
More examples:
     LD /Tsymple library: test.rel 
     LD /tMy library: test 
     LD /T:010B test.rel 
     LD /t:7 test 
     LD /t: test.rel 
 
Note, internal description starts after 'T' and ends before ':' characters.
For example command 
 
     LD /T Example:0001 test.rel 
 
means that description is " Example" (with one leading space). 
 
 
 
                          List file 
 
List file is used for kind of automation of link procedure. You may create it
only once and use it instead writing long command line parameters every time.
List file may consist of one line of arguments or a number of lines with 
separated arguments (one per line), but last symbol of list should be carriage 
return symbol (end of line). Limit of size for list file is 256 bytes.

For example: 
 
     LD @ comp.txt 
     LD @list 
 
Examples of list files: 
 
test=prog,clib.irl/l/gxmain/x 
 
 or
 
test=prog, 
clib.irl/l 
/gxmain 
/x 
 
It build program "test" from object file "prog.rel" and library "clib.irl". 
Entry point for start is "xmain" (always used for C-library "clib.irl").
Options "x" prohibits creation of sym-file. 

Я тут за главного - если что шлите мыло на me собака shaos точка net