source: chapter08/binutils.xml@ ff96923

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 ff96923 was ff96923, checked in by Bruce Dubbs <bdubbs@…>, 3 years ago

Package updates and stripping fixes
Add workaround to strip libraries correctly.
Update to shadow-4.9.
Update to util-linux 2.37.1.

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