source: chapter08/binutils.xml@ ba41e17

xry111/loongarch xry111/loongarch-12.1 xry111/loongarch-12.2
Last change on this file since ba41e17 was ba41e17, checked in by Xi Ruoyao <xry111@…>, 9 months ago

Merge remote-tracking branch 'origin/trunk' into xry111/loongarch

  • Property mode set to 100644
File size: 14.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-system-binutils" role="wrap">
9 <?dbhtml filename="binutils.html"?>
10
11 <sect1info condition="script">
12 <productname>binutils</productname>
13 <productnumber>&binutils-version;</productnumber>
14 <address>&binutils-url;</address>
15 </sect1info>
16
17 <title>Binutils-&binutils-version;</title>
18
19 <indexterm zone="ch-system-binutils">
20 <primary sortas="a-Binutils">Binutils</primary>
21 </indexterm>
22
23 <sect2 role="package">
24 <title/>
25
26 <para>The Binutils package contains a linker, an assembler, and other
27 tools for handling object files.</para>
28
29 <segmentedlist>
30 <segtitle>&buildtime;</segtitle>
31 <segtitle>&diskspace;</segtitle>
32
33 <seglistitem>
34 <seg>&binutils-fin-sbu;</seg>
35 <seg>&binutils-fin-du;</seg>
36 </seglistitem>
37 </segmentedlist>
38
39 </sect2>
40
41 <sect2 role="installation">
42 <title>Installation of Binutils</title>
43
44 <para>The Binutils documentation recommends building Binutils
45 in a dedicated build directory:</para>
46
47<screen><userinput remap="pre">mkdir -v build
48cd build</userinput></screen>
49
50 <para>Prepare Binutils for compilation:</para>
51
52<screen><userinput remap="configure">../configure --prefix=/usr \
53 --sysconfdir=/etc \
54 --enable-ld=default \
55 --enable-plugins \
56 --enable-shared \
57 --disable-werror \
58 --enable-64-bit-bfd \
59 --with-system-zlib \
60 --enable-default-hash-style=gnu</userinput></screen>
61
62 <variablelist>
63 <title>The meaning of the new configure parameters:</title>
64
65 <varlistentry>
66 <term><parameter>--enable-ld=default</parameter></term>
67 <listitem>
68 <para>Build the original bfd linker and install it as both ld (the
69 default linker) and ld.bfd.</para>
70 </listitem>
71 </varlistentry>
72
73 <varlistentry>
74 <term><parameter>--enable-plugins</parameter></term>
75 <listitem>
76 <para>Enables plugin support for the linker.</para>
77 </listitem>
78 </varlistentry>
79
80 <varlistentry>
81 <term><parameter>--with-system-zlib</parameter></term>
82 <listitem>
83 <para>Use the installed zlib library instead of building the
84 included version.</para>
85 </listitem>
86 </varlistentry>
87
88 </variablelist>
89
90 <para>Compile the package:</para>
91
92<screen><userinput remap="make">make tooldir=/usr</userinput></screen>
93
94 <variablelist>
95 <title>The meaning of the make parameter:</title>
96
97 <varlistentry>
98 <term><parameter>tooldir=/usr</parameter></term>
99 <listitem>
100 <para>Normally, the tooldir (the directory where the executables will
101 ultimately be located) is set to <filename
102 class="directory">$(exec_prefix)/$(target_alias)</filename>. For
103 example, 64-bit LoongArch machines would expand that to <filename
104 class="directory">/usr/loongarch64-unknown-linux-gnu</filename>. Because this is
105 a custom system, this target-specific directory in <filename
106 class="directory">/usr</filename> is not required. <filename
107 class="directory">$(exec_prefix)/$(target_alias)</filename> would be
108 used if the system were used to cross-compile (for example, compiling a
109 package on an Intel machine that generates code that can be executed
110 on PowerPC machines).</para>
111 </listitem>
112 </varlistentry>
113
114 </variablelist>
115
116 <important>
117 <para>The test suite for Binutils in this section is considered critical.
118 Do not skip it under any circumstances.</para>
119 </important>
120
121 <para>Test the results:</para>
122
123<screen><userinput remap="test">make -k check</userinput></screen>
124
125 <para>For a list of failed tests, run:</para>
126
127<screen><userinput remap="test">grep '^FAIL:' $(find -name '*.log')</userinput></screen>
128
129 <para>Install the package:</para>
130
131<screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
132
133 <para>Remove useless static libraries:</para>
134
135<screen><userinput remap="install">rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,gprofng,opcodes,sframe}.a</userinput></screen>
136
137 </sect2>
138
139 <sect2 id="contents-binutils" role="content">
140 <title>Contents of Binutils</title>
141
142 <segmentedlist>
143 <segtitle>Installed programs</segtitle>
144 <segtitle>Installed libraries</segtitle>
145 <segtitle>Installed directory</segtitle>
146
147 <seglistitem>
148 <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, gprofng, ld, ld.bfd, nm,
149 objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
150 <seg>libbfd.so, libctf.so, libctf-nobfd.so, libgprofng.so,
151 libopcodes.so, and libsframe.so</seg>
152 <seg>/usr/lib/ldscripts</seg>
153 </seglistitem>
154 </segmentedlist>
155
156 <variablelist>
157 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
158 <?dbfo list-presentation="list"?>
159 <?dbhtml list-presentation="table"?>
160
161 <varlistentry id="addr2line">
162 <term><command>addr2line</command></term>
163 <listitem>
164 <para>Translates program addresses to file names and line numbers;
165 given an address and the name of an executable, it uses the debugging
166 information in the executable to determine which source file and line
167 number are associated with the address</para>
168 <indexterm zone="ch-system-binutils addr2line">
169 <primary sortas="b-addr2line">addr2line</primary>
170 </indexterm>
171 </listitem>
172 </varlistentry>
173
174 <varlistentry id="ar">
175 <term><command>ar</command></term>
176 <listitem>
177 <para>Creates, modifies, and extracts from archives</para>
178 <indexterm zone="ch-system-binutils ar">
179 <primary sortas="b-ar">ar</primary>
180 </indexterm>
181 </listitem>
182 </varlistentry>
183
184 <varlistentry id="as">
185 <term><command>as</command></term>
186 <listitem>
187 <para>An assembler that assembles the output of <command>gcc</command>
188 into object files</para>
189 <indexterm zone="ch-system-binutils as">
190 <primary sortas="b-as">as</primary>
191 </indexterm>
192 </listitem>
193 </varlistentry>
194
195 <varlistentry id="c-filt">
196 <term><command>c++filt</command></term>
197 <listitem>
198 <para>Used by the linker to de-mangle C++ and Java symbols and to keep
199 overloaded functions from clashing</para>
200 <indexterm zone="ch-system-binutils c-filt">
201 <primary sortas="b-c++filt">c++filt</primary>
202 </indexterm>
203 </listitem>
204 </varlistentry>
205
206 <varlistentry id="dwp">
207 <term><command>dwp</command></term>
208 <listitem>
209 <para>The DWARF packaging utility</para>
210 <indexterm zone="ch-system-binutils dwp">
211 <primary sortas="dwp">dwp</primary>
212 </indexterm>
213 </listitem>
214 </varlistentry>
215
216 <varlistentry id="elfedit">
217 <term><command>elfedit</command></term>
218 <listitem>
219 <para>Updates the ELF headers of ELF files</para>
220 <indexterm zone="ch-system-binutils elfedit">
221 <primary sortas="b-elfedit">elfedit</primary>
222 </indexterm>
223 </listitem>
224 </varlistentry>
225
226 <varlistentry id="gprof">
227 <term><command>gprof</command></term>
228 <listitem>
229 <para>Displays call graph profile data</para>
230 <indexterm zone="ch-system-binutils gprof">
231 <primary sortas="b-gprof">gprof</primary>
232 </indexterm>
233 </listitem>
234 </varlistentry>
235
236 <varlistentry id="gprofng">
237 <term><command>gprofng</command></term>
238 <listitem>
239 <para>Gathers and analyzes performance data</para>
240 <indexterm zone="ch-system-binutils gprofng">
241 <primary sortas="b-gprofng">gprofng</primary>
242 </indexterm>
243 </listitem>
244 </varlistentry>
245
246 <varlistentry id="ld">
247 <term><command>ld</command></term>
248 <listitem>
249 <para>A linker that combines a number of object and archive files
250 into a single file, relocating their data and tying up symbol
251 references</para>
252 <indexterm zone="ch-system-binutils ld">
253 <primary sortas="b-ld">ld</primary>
254 </indexterm>
255 </listitem>
256 </varlistentry>
257
258 <varlistentry id="ld.bfd">
259 <term><command>ld.bfd</command></term>
260 <listitem>
261 <para>A hard link to <command>ld</command></para>
262 <indexterm zone="ch-system-binutils ld.bfd">
263 <primary sortas="b-ld.bfd">ld.bfd</primary>
264 </indexterm>
265 </listitem>
266 </varlistentry>
267
268 <varlistentry id="nm">
269 <term><command>nm</command></term>
270 <listitem>
271 <para>Lists the symbols occurring in a given object file</para>
272 <indexterm zone="ch-system-binutils nm">
273 <primary sortas="b-nm">nm</primary>
274 </indexterm>
275 </listitem>
276 </varlistentry>
277
278 <varlistentry id="objcopy">
279 <term><command>objcopy</command></term>
280 <listitem>
281 <para>Translates one type of object file into another</para>
282 <indexterm zone="ch-system-binutils objcopy">
283 <primary sortas="b-objcopy">objcopy</primary>
284 </indexterm>
285 </listitem>
286 </varlistentry>
287
288 <varlistentry id="objdump">
289 <term><command>objdump</command></term>
290 <listitem>
291 <para>Displays information about the given object file, with options
292 controlling the particular information to display; the information
293 shown is useful to programmers who are working on the compilation
294 tools</para>
295 <indexterm zone="ch-system-binutils objdump">
296 <primary sortas="b-objdump">objdump</primary>
297 </indexterm>
298 </listitem>
299 </varlistentry>
300
301 <varlistentry id="ranlib">
302 <term><command>ranlib</command></term>
303 <listitem>
304 <para>Generates an index of the contents of an archive and stores it
305 in the archive; the index lists all of the symbols defined by archive
306 members that are relocatable object files</para>
307 <indexterm zone="ch-system-binutils ranlib">
308 <primary sortas="b-ranlib">ranlib</primary>
309 </indexterm>
310 </listitem>
311 </varlistentry>
312
313 <varlistentry id="readelf">
314 <term><command>readelf</command></term>
315 <listitem>
316 <para>Displays information about ELF type binaries</para>
317 <indexterm zone="ch-system-binutils readelf">
318 <primary sortas="b-readelf">readelf</primary>
319 </indexterm>
320 </listitem>
321 </varlistentry>
322
323 <varlistentry id="size">
324 <term><command>size</command></term>
325 <listitem>
326 <para>Lists the section sizes and the total size for the given
327 object files</para>
328 <indexterm zone="ch-system-binutils size">
329 <primary sortas="b-size">size</primary>
330 </indexterm>
331 </listitem>
332 </varlistentry>
333
334 <varlistentry id="strings">
335 <term><command>strings</command></term>
336 <listitem>
337 <para>Outputs, for each given file, the sequences of printable
338 characters that are of at least the specified length (defaulting to
339 four); for object files, it prints, by default, only the strings from
340 the initializing and loading sections while for other types of files, it
341 scans the entire file</para>
342 <indexterm zone="ch-system-binutils strings">
343 <primary sortas="b-strings">strings</primary>
344 </indexterm>
345 </listitem>
346 </varlistentry>
347
348 <varlistentry id="strip">
349 <term><command>strip</command></term>
350 <listitem>
351 <para>Discards symbols from object files</para>
352 <indexterm zone="ch-system-binutils strip">
353 <primary sortas="b-strip">strip</primary>
354 </indexterm>
355 </listitem>
356 </varlistentry>
357
358 <varlistentry id="libbfd">
359 <term><filename class="libraryfile">libbfd</filename></term>
360 <listitem>
361 <para>The Binary File Descriptor library</para>
362 <indexterm zone="ch-system-binutils libbfd">
363 <primary sortas="c-libbfd">libbfd</primary>
364 </indexterm>
365 </listitem>
366 </varlistentry>
367
368 <varlistentry id="libctf">
369 <term><filename class="libraryfile">libctf</filename></term>
370 <listitem>
371 <para>The Compat ANSI-C Type Format debugging support library</para>
372 <indexterm zone="ch-system-binutils libctf">
373 <primary sortas="c-libctf">libctf</primary>
374 </indexterm>
375 </listitem>
376 </varlistentry>
377
378 <varlistentry id="libctf-nobfd">
379 <term><filename class="libraryfile">libctf-nobfd</filename></term>
380 <listitem>
381 <para>A libctf variant which does not use libbfd functionality</para>
382 <indexterm zone="ch-system-binutils libctf-nobfd">
383 <primary sortas="c-libctf-nobfd">libctf-nobfd</primary>
384 </indexterm>
385 </listitem>
386 </varlistentry>
387
388 <varlistentry id="libgprofng">
389 <term><filename class="libraryfile">libgprofng</filename></term>
390 <listitem>
391 <para>A library containing most routines used by
392 <command>gprofng</command></para>
393 <indexterm zone="ch-system-binutils libgprofng">
394 <primary sortas="c-libgprofng">libgprofng</primary>
395 </indexterm>
396 </listitem>
397 </varlistentry>
398
399 <varlistentry id="libopcodes">
400 <term><filename class="libraryfile">libopcodes</filename></term>
401 <listitem>
402 <para>A library for dealing with opcodes&mdash;the <quote>readable
403 text</quote> versions of instructions for the processor;
404 it is used for building utilities like
405 <command>objdump</command></para>
406 <indexterm zone="ch-system-binutils libopcodes">
407 <primary sortas="c-libopcodes">libopcodes</primary>
408 </indexterm>
409 </listitem>
410 </varlistentry>
411
412 <varlistentry id="libsframe">
413 <term><filename class="libraryfile">libsframe</filename></term>
414 <listitem>
415 <para>A library to support online backtracing using a
416 simple unwinder</para>
417 <indexterm zone="ch-system-binutils libsframe">
418 <primary sortas="c-libsframe">libsframe</primary>
419 </indexterm>
420 </listitem>
421 </varlistentry>
422
423 </variablelist>
424
425 </sect2>
426
427</sect1>
Note: See TracBrowser for help on using the repository browser.