blob: 72d53732e3aa8eea1fff995e65dfe18af961a70e [file] [log] [blame]
John Criswellecf32e52003-09-11 19:58:03 +00001<html>
2<title>
3gccld
4</title>
5
6<body>
7
8<center>
9<h1>Low Level Virtual Machine</h1>
10</center>
11<HR>
12
13<h3>
14NAME
15</h3>
16
17gccld
18
19<h3>
20SYNOPSIS
21</h3>
22
John Criswell52f68b82003-09-25 19:10:25 +000023gccld [options] &lt; filename&gt; [ filename ...]
John Criswellecf32e52003-09-11 19:58:03 +000024<h3>
25DESCRIPTION
26</h3>
27
John Criswell52f68b82003-09-25 19:10:25 +000028The gccld utility takes a set of LLVM bytecode files and links them together
29into a single LLVM bytecode file. The output bytecode file can be another
30bytecode library or an executable bytecode program. Using additional options,
31gccld is able to produce native code executables.
John Criswellecf32e52003-09-11 19:58:03 +000032<p>
33The gccld utility is primarily used by the GCC front end, and as such, attempts
34to mimic the interface provided by the default system linker so that it can act
35as a "drop-in" replacement.
36
John Criswell52f68b82003-09-25 19:10:25 +000037<h4>
38Search Order
39</h4>
40When looking for objects specified on the command line, gccld will search for
41the object first in the current directory and then in the directory specified
42by LLVM_LIB_SEARCH_PATH. If it cannot find the object, it fails.
43<p>
44When looking for a library specified with the -l option, gccld first attempts
45to load a file with that name from the current directory. If that fails, it
46looks for lib&lt;library&gt;.bc, lib&lt;library&gt;.a, or
47lib&lt;library&gt;.so, in that order, in each directory added to the library
48search path with the -L option. These directories are searched in order they
49were specified. If the library cannot be located, then gccld looks in the
50directory specified by the LLVM_LIB_SEARCH_PATH environment variable. If it
51does not find lib&lt;library&gt;.[bc | a | so] there, it fails.
52
53The -L option is global. It does not matter where it is specified in the list
54of command line arguments; the directory is simply added to the search path and
55is applied to all libraries, preceding or succeeding, in the command line.
56
57<h4>
58Link order
59</h4>
60All object files are linked first in the order they were specified on the
61command line. All library files are linked next. Some libraries may not be
62linked into the object program; see below.
63
64<h4>
65Library Linkage
66</h4>
67Object files and static bytecode objects are always linked into the output
68file. Library archives (.a files) load only the objects within the archive
69that define symbols needed by the output file. Hence, libraries should be
70listed after the object files and libraries which need them; otherwise, the
71library may not be linked in, and the dependent library will not have its
72undefined symbols defined.
73
74<h4>
75Native code generation
76</h4>
77The gccld program has limited support for native code generation.
John Criswellecf32e52003-09-11 19:58:03 +000078<h3>
79OPTIONS
80</h3>
81
82<ul>
83 <li> -help
84 <br>
85 Print a summary of command line options.
86 <p>
87
88 <li> -o &lt;filename&gt;
89 <br>
John Criswell52f68b82003-09-25 19:10:25 +000090 Specify the output filename which will hold the linked bytecode.
John Criswellecf32e52003-09-11 19:58:03 +000091 <p>
92
93 <li> -stats
94 <br>
95 Print statistics.
96 <p>
97
98 <li> -time-passes
99 <br>
100 Record the amount of time needed for each pass and print it to standard
101 error.
102 <p>
103
104 <li> -verify
105 <br>
106 Verify each pass result.
107 <p>
108
109 <li> -L=&lt;directory&gt;
110 <br>
111 Add directory to the list of directories to search when looking for
112 libraries.
113 <p>
114
115 <li> -disable-internalize
116 <br>
117 Do not mark all symbols as internal.
118 <p>
119
120 <li> -internalize-public-api-file &lt;filename&gt;
121 <br>
122 Preserve the list of symbol names in the file filename.
123 <p>
124
125 <li> -internalize-public-api-list &lt;list&gt;
126 <br>
127 Preserve the symbol names in list.
128 <p>
129
John Criswell52f68b82003-09-25 19:10:25 +0000130 <li> -l=&lt;library&gt;
John Criswellecf32e52003-09-11 19:58:03 +0000131 <br>
John Criswell52f68b82003-09-25 19:10:25 +0000132 Specify libraries to include when linking the output file. When linking,
133 gccld will first attempt to load a file with the pathname library. If that
134 fails, it will then attempt to load lib&lt;library&gt;.bc,
135 lib&lt;library&gt;.a, and lib&lt;library&gt;.so, in that order.
John Criswellecf32e52003-09-11 19:58:03 +0000136 <p>
137
138 <li> -link-as-library
139 <br>
140 Link the .bc files together as a library, not an executable.
141 <p>
142
John Criswell52f68b82003-09-25 19:10:25 +0000143 <li> -native
144 <br>
145 Generate a native, machine code executable.
146 <p>
147
John Criswellecf32e52003-09-11 19:58:03 +0000148 <li> -s
149 <br>
150 Strip symbol information from the generated executable.
151 <p>
152
153 <li> -v
154 <br>
155 Print information about actions taken.
156</ul>
157
158<h3>
159EXIT STATUS
160</h3>
161
162If gccld succeeds, it will exit with 0. Otherwise, if an error occurs, it
163will exit with a non-zero value.
164
165<h3>
166SEE ALSO
167</h3>
John Criswell52f68b82003-09-25 19:10:25 +0000168gccas
169
170<h3>
171BUGS
172</h3>
173The -L option cannot be used for find native code libraries when using the
174-native option.
John Criswellecf32e52003-09-11 19:58:03 +0000175
176<HR>
John Criswell32003302003-09-11 20:23:52 +0000177<a href="http://llvm.cs.uiuc.edu">LLVM Team</a>
John Criswellecf32e52003-09-11 19:58:03 +0000178</body>
179</html>
180