Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>Object Files: Understanding The Result Of LLVM Compilation</title> |
| 5 | <link rel="stylesheet" href="llvm.css" type="text/css"> |
| 6 | </head> |
| 7 | <body> |
| 8 | <div class="doc_title">Object Files: Understanding The Result Of LLVM Compilation</div> |
| 9 | <hr> |
| 10 | <ol> |
| 11 | <li><a href="#abstract">Abstract</a></li> |
| 12 | <li><a href="#introduction">Introduction</a></li> |
| 13 | <li><a href="#files">File Contents</a></li> |
| 14 | <li><a href="#rot">Linkage Rules Of Thumb</a> |
| 15 | <ol> |
| 16 | <li><a href="#always">Always Link vmcore.o, support.a</a> |
| 17 | <li><a href="#placeholder">Placeholder</a> |
| 18 | </ol> |
| 19 | </li> |
| 20 | </ol> |
Chris Lattner | 7911ce2 | 2004-05-23 21:07:27 +0000 | [diff] [blame^] | 21 | |
| 22 | <div class="doc_author"> |
| 23 | <p>Written by <a href="mailto:rspencer@x10sys.com">Reid Spencer</a></p> |
Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 24 | </div> |
Chris Lattner | 7911ce2 | 2004-05-23 21:07:27 +0000 | [diff] [blame^] | 25 | |
Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 26 | <hr> |
Chris Lattner | 7911ce2 | 2004-05-23 21:07:27 +0000 | [diff] [blame^] | 27 | |
Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 28 | <!-- ======================================================================= --> |
| 29 | <div class="doc_section"><a name="abstract">Abstract</a></div> |
| 30 | <div class="doc_text"> |
| 31 | <p>This document describes the contents of the many objects files and libraries |
| 32 | that are produced by compiling LLVM. To make use of LLVM this information is |
| 33 | needed in order to understand what files should be linked into your program. |
| 34 | </p> |
| 35 | </div> |
| 36 | <!-- ======================================================================= --> |
| 37 | <div class="doc_section"> <a name="introduction">Introduction</a></div> |
| 38 | <div class="doc_text"> |
| 39 | <p>If you're writing a compiler, virtual machine, or any other utility for |
| 40 | LLVM, you'll need to figure out which of the many .a (archive) and .o |
| 41 | (object) files you will need to link with to be successful. An |
| 42 | understanding of the contents of these files and their inter-relationships |
| 43 | will be useful in coming up with an optimal specification for the objects |
| 44 | and libraries to link with. |
| 45 | </p> |
| 46 | <p>The purpose of this document is to hopefully reduce some of the trial and |
| 47 | error that the author experienced in using LLVM. |
| 48 | </p> |
| 49 | </div> |
| 50 | <!-- ======================================================================= --> |
| 51 | <div class="doc_section"><a name="files"></a>File Contents</div> |
| 52 | <div class="doc_text"> |
| 53 | <p>The table below provides a summary of the basic contents of each file.</p> |
| 54 | <table class="doc_table" |
| 55 | style="width:80%; text-align: left; border: 2px solid blue; border-collapse: collapse;"> |
| 56 | <tr class="doc_table"> |
| 57 | <td colspan="2" class="doc_section">Summary Of LLVM Library And Object Files |
| 58 | </td> |
| 59 | </tr> |
| 60 | <tr class="doc_table"> |
| 61 | <td style="border: 2px solid blue"><h2><u>Library</u></h2></td> |
| 62 | <td style="border: 2px solid blue"><h2><u>Description</u></h2></td> |
| 63 | </tr> |
| 64 | <tr class="doc_table"> |
| 65 | <td style="border: 2px solid blue">libipo.a</td> |
| 66 | <td style="border: 2px solid blue"> |
| 67 | An archive of all inter-procedural optimizations. |
| 68 | </td> |
| 69 | </tr> |
| 70 | <tr class="doc_table"> |
| 71 | <td style="border: 2px solid blue">libscalaropts.a</td> |
| 72 | <td style="border: 2px solid blue"> |
| 73 | An archive of all scalar optimizations. |
| 74 | </td> |
| 75 | </tr> |
| 76 | <tr class="doc_table"> |
| 77 | <td style="border: 2px solid blue">libtransforms.a</td> |
| 78 | <td style="border: 2px solid blue"> |
Chris Lattner | 0e27c98 | 2004-02-27 16:17:20 +0000 | [diff] [blame] | 79 | An archive of just the level raise pass. |
Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 80 | </td> |
| 81 | </tr> |
| 82 | <tr class="doc_table"> |
| 83 | <td style="border: 2px solid blue">libtarget.a</td> |
| 84 | <td style="border: 2px solid blue"> |
Chris Lattner | 0e27c98 | 2004-02-27 16:17:20 +0000 | [diff] [blame] | 85 | An archive containing code generator support for describing |
| 86 | target architectures. |
Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 87 | </td> |
| 88 | </tr> |
| 89 | <tr class="doc_table"> |
| 90 | <td style="border: 2px solid blue">libanalysis.a</td> |
| 91 | <td style="border: 2px solid blue"> |
Chris Lattner | 0e27c98 | 2004-02-27 16:17:20 +0000 | [diff] [blame] | 92 | An archive containing intra-procedural analyses. |
Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 93 | </td> |
| 94 | </tr> |
| 95 | <tr class="doc_table"> |
| 96 | <td style="border: 2px solid blue">libdatastructure.a</td> |
| 97 | <td style="border: 2px solid blue"> |
| 98 | An archive containing optimizations for data structures. |
| 99 | </td> |
| 100 | </tr> |
| 101 | <tr class="doc_table"> |
| 102 | <td style="border: 2px solid blue">libinstrument.a</td> |
| 103 | <td style="border: 2px solid blue">No idea.</td> |
| 104 | </tr> |
| 105 | <tr class="doc_table"> |
| 106 | <td style="border: 2px solid blue">libregalloc.a</td> |
| 107 | <td style="border: 2px solid blue">Register Allocation code.</td> |
| 108 | </tr> |
| 109 | <tr class="doc_table"> |
| 110 | <td style="border: 2px solid blue">libipa.a</td> |
Chris Lattner | 0e27c98 | 2004-02-27 16:17:20 +0000 | [diff] [blame] | 111 | <td style="border: 2px solid blue"> |
| 112 | An archive containing inter-procedural analyses</td> |
Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 113 | </tr> |
| 114 | <tr class="doc_table"> |
| 115 | <td style="border: 2px solid blue">libtransformutils.a</td> |
| 116 | <td style="border: 2px solid blue"> |
| 117 | Utiltities for transformations? |
| 118 | </td> |
| 119 | </tr> |
| 120 | <tr class="doc_table"> |
| 121 | <td style="border: 2px solid blue">libsupport.a</td> |
| 122 | <td style="border: 2px solid blue">General support utilities</td> |
| 123 | </tr> |
| 124 | <tr class="doc_table"> |
Chris Lattner | 0e27c98 | 2004-02-27 16:17:20 +0000 | [diff] [blame] | 125 | <td style="border: 2px solid blue">libevar.a</td> |
| 126 | <td style="border: 2px solid blue">Live variable analysis for SPARC</td> |
| 127 | </tr> |
| 128 | <tr class="doc_table"> |
Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 129 | <td style="border: 2px solid blue"><h2><u>Object File</u></h2></td> |
| 130 | <td style="border: 2px solid blue"><h2><u>Description</u></h2></td> |
| 131 | </tr> |
| 132 | <tr class="doc_table"> |
| 133 | <td style="border: 2px solid blue">support.o</td> |
| 134 | <td style="border: 2px solid blue">General support utilities</td> |
| 135 | </tr> |
| 136 | <tr class="doc_table"> |
| 137 | <td style="border: 2px solid blue">asmparser.o</td> |
| 138 | <td style="border: 2px solid blue">Assembler Parser</td> |
| 139 | </tr> |
| 140 | <tr class="doc_table"> |
| 141 | <td style="border: 2px solid blue">bcreader.o</td> |
| 142 | <td style="border: 2px solid blue">Byte Code Reader</td> |
| 143 | </tr> |
| 144 | <tr class="doc_table"> |
| 145 | <td style="border: 2px solid blue">bcwriter.o</td> |
| 146 | <td style="border: 2px solid blue">Byte Code Writer</td> |
| 147 | </tr> |
| 148 | <tr class="doc_table"> |
| 149 | <td style="border: 2px solid blue">sched.o</td> |
Chris Lattner | 0e27c98 | 2004-02-27 16:17:20 +0000 | [diff] [blame] | 150 | <td style="border: 2px solid blue">SPARC instruction scheduler</td> |
Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 151 | </tr> |
| 152 | <tr class="doc_table"> |
| 153 | <td style="border: 2px solid blue">selectiondag.o</td> |
Chris Lattner | 0e27c98 | 2004-02-27 16:17:20 +0000 | [diff] [blame] | 154 | <td style="border: 2px solid blue">Aggressive instruction selector for Directed Acyclic Graphs</td> |
Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 155 | </tr> |
| 156 | <tr class="doc_table"> |
| 157 | <td style="border: 2px solid blue">transformutils.o</td> |
| 158 | <td style="border: 2px solid blue">Utilities for code transformations</td> |
| 159 | </tr> |
| 160 | <tr class="doc_table"> |
| 161 | <td style="border: 2px solid blue">ipa.o</td> |
| 162 | <td style="border: 2px solid blue">Inter-Procedural Analysis Optimizations</td> |
| 163 | </tr> |
| 164 | <tr class="doc_table"> |
| 165 | <td style="border: 2px solid blue">select.o</td> |
Chris Lattner | 0e27c98 | 2004-02-27 16:17:20 +0000 | [diff] [blame] | 166 | <td style="border: 2px solid blue">SPARC instruction selector</td> |
Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 167 | </tr> |
| 168 | <tr class="doc_table"> |
| 169 | <td style="border: 2px solid blue">cwriter.o</td> |
| 170 | <td style="border: 2px solid blue">"C" Code Writer</td> |
| 171 | </tr> |
| 172 | <tr class="doc_table"> |
| 173 | <td style="border: 2px solid blue">profpaths.o</td> |
Chris Lattner | 0e27c98 | 2004-02-27 16:17:20 +0000 | [diff] [blame] | 174 | <td style="border: 2px solid blue">Path profiling instrumentation</td> |
Chris Lattner | 6175735 | 2004-02-27 06:28:34 +0000 | [diff] [blame] | 175 | </tr> |
| 176 | <tr class="doc_table"> |
| 177 | <td style="border: 2px solid blue">regalloc.o</td> |
| 178 | <td style="border: 2px solid blue">Register Allocation</td> |
| 179 | </tr> |
| 180 | <tr class="doc_table"> |
| 181 | <td style="border: 2px solid blue">instrument.o</td> |
| 182 | <td style="border: 2px solid blue">Instrumentation? Of What?</td> |
| 183 | </tr> |
| 184 | <tr class="doc_table"> |
| 185 | <td style="border: 2px solid blue">datastructure.o</td> |
| 186 | <td style="border: 2px solid blue">Data Structure Analysis</td> |
| 187 | </tr> |
| 188 | <tr class="doc_table"> |
| 189 | <td style="border: 2px solid blue">codegen.o</td> |
| 190 | <td style="border: 2px solid blue">Native code generation</td> |
| 191 | </tr> |
| 192 | <tr class="doc_table"> |
| 193 | <td style="border: 2px solid blue">livevar.o</td> |
| 194 | <td style="border: 2px solid blue">Live Variable Analysis</td> |
| 195 | </tr> |
| 196 | <tr class="doc_table"> |
| 197 | <td style="border: 2px solid blue">vmcore.o</td> |
| 198 | <td style="border: 2px solid blue">Virtual Machine Core</td> |
| 199 | </tr> |
| 200 | <tr class="doc_table"> |
| 201 | <td style="border: 2px solid blue">lli-interpreter.o</td> |
| 202 | <td style="border: 2px solid blue">Interpreter for LLVM ByteCode</td> |
| 203 | </tr> |
| 204 | <tr class="doc_table"> |
| 205 | <td style="border: 2px solid blue">lli-jit.o</td> |
| 206 | <td style="border: 2px solid blue"> |
| 207 | Just-In-Time Compiler For LLVM ByteCode |
| 208 | </td> |
| 209 | </tr> |
| 210 | <tr class="doc_table"> |
| 211 | <td style="border: 2px solid blue">executionengine.o</td> |
| 212 | <td style="border: 2px solid blue">Engine for LLI</td> |
| 213 | </tr> |
| 214 | <tr class="doc_table"> |
| 215 | <td style="border: 2px solid blue">debugger.o</td> |
| 216 | <td style="border: 2px solid blue">Source Level Debugging Support</td> |
| 217 | </tr> |
| 218 | <tr class="doc_table"> |
| 219 | <td style="border: 2px solid blue">analysis.o</td> |
| 220 | <td style="border: 2px solid blue">General Framework For Analysis?</td> |
| 221 | </tr> |
| 222 | <tr class="doc_table"> |
| 223 | <td style="border: 2px solid blue">sparc.o</td> |
| 224 | <td style="border: 2px solid blue">Sun SPARC Processor Specific</td> |
| 225 | </tr> |
| 226 | <tr class="doc_table"> |
| 227 | <td style="border: 2px solid blue">target.o</td> |
| 228 | <td style="border: 2px solid blue">Target Machine Support?</td> |
| 229 | </tr> |
| 230 | <tr class="doc_table"> |
| 231 | <td style="border: 2px solid blue">transforms.o</td> |
| 232 | <td style="border: 2px solid blue">Code Transformations</td> |
| 233 | </tr> |
| 234 | <tr class="doc_table"> |
| 235 | <td style="border: 2px solid blue">x86.o</td> |
| 236 | <td style="border: 2px solid blue">Intel x86 Processor Specific</td> |
| 237 | </tr> |
| 238 | <tr class="doc_table"> |
| 239 | <td style="border: 2px solid blue">powerpc.o</td> |
| 240 | <td style="border: 2px solid blue">PowerPC Processor Specific</td> |
| 241 | </tr> |
| 242 | <tr class="doc_table"> |
| 243 | <td style="border: 2px solid blue">scalaropts.o</td> |
| 244 | <td style="border: 2px solid blue">Optimizations For Scalars</td> |
| 245 | </tr> |
| 246 | <tr class="doc_table"> |
| 247 | <td style="border: 2px solid blue">ipo.o</td> |
| 248 | <td style="border: 2px solid blue">Inter-Procedural Optimization</td> |
| 249 | </tr> |
| 250 | <tr class="doc_table"> |
| 251 | <td style="border: 2px solid blue">trace.o</td> |
| 252 | <td style="border: 2px solid blue">Support For Tracing/Debugging?</td> |
| 253 | </tr> |
| 254 | <tr class="doc_table"> |
| 255 | <td style="border: 2px solid blue">profile_rt.o</td> |
| 256 | <td style="border: 2px solid blue">Runtime Library For Profiler</td> |
| 257 | </tr> |
| 258 | <tr class="doc_table"> |
| 259 | <td style="border: 2px solid blue">sample.o</td> |
| 260 | <td style="border: 2px solid blue">Sample Program ?</td> |
| 261 | </tr> |
| 262 | <tr class="doc_table"> |
| 263 | <td style="border: 2px solid blue">stkr_compiler.o</td> |
| 264 | <td style="border: 2px solid blue">Stacker Language Compiler Library</td> |
| 265 | </tr> |
| 266 | <tr class="doc_table"> |
| 267 | <td style="border: 2px solid blue">stkr_runtime.o</td> |
| 268 | <td style="border: 2px solid blue">Stacker Language Runtime Library</td> |
| 269 | </tr> |
| 270 | </table> |
| 271 | </div> |
| 272 | <p></p> |
| 273 | <!-- ======================================================================= --> |
| 274 | <div class="doc_section"><a name="rot">Linkage Rules Of Thumb</a></div> |
| 275 | <div class="doc_text"> |
| 276 | <p>This section contains various "rules of thumb" about what files you |
| 277 | should link into your programs.</p> |
| 278 | </div> |
| 279 | <!-- ======================================================================= --> |
| 280 | <div class="doc_subsection"><a name="always">Always Link vmcore.o support.a</a> |
| 281 | </div> |
| 282 | <div class="doc_text"> |
| 283 | <p>No matter what you do with LLVM, you'll always need to link with vmcore.o |
| 284 | and support.a.</p> |
| 285 | </div> |
| 286 | <!-- ======================================================================= --> |
| 287 | <div class="doc_subsection"><a name="Placeholder">Placeholder</a></div> |
| 288 | <div class="doc_text"> |
| 289 | <p>Need more rules of thumb here.</p> |
| 290 | </div> |
| 291 | <!-- ======================================================================= --> |
| 292 | <hr> |
| 293 | <div class="doc_footer"> |
| 294 | <address><a href="mailto:rspencer@x10sys.com">Reid Spencer</a></address> |
| 295 | <a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a> |
| 296 | <br>Last modified: $Date$ </div> |
| 297 | </body> |
| 298 | </html> |
| 299 | <!-- vim: sw=2 ts=2 ai |
| 300 | --> |