source: chapter08/binutils.xml@ 5f54f8e

xry111/loongarch xry111/loongarch-12.2
Last change on this file since 5f54f8e was 5f54f8e, checked in by Xi Ruoyao <xry111@…>, 3 weeks ago

loongarch: Revert "Binutils: Apply an upstream fix for LTO"

This reverts commit 8b8b87bcb25d09789b223cd348a0aa1c642a2ffc.

The change is upstreamed in 2.43.

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