source: chapter08/binutils.xml@ 6a156bab

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 6a156bab was fb386e0, checked in by Thomas Trepl <thomas@…>, 4 years ago

Rename package entities to be independent of chapter numbering

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/cross2@11921 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

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