source: chapter08/binutils.xml@ 0ceb295

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 0ceb295 was 0ceb295, checked in by Xi Ruoyao <xry111@…>, 3 years ago

document x86 ISA level related breakage and workaround

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@12133 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

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