source: chapter06/binutils.xml@ 89c1c43d

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 8.1 8.1-rc1 8.1-rc2 8.2 8.2-rc1 8.3 8.3-rc1 8.3-rc2 8.4 8.4-rc1 9.0 9.0-rc1 9.1 9.1-rc1 cross-chap5 ml-11.0 multilib old-trunk trunk xry111/git-transition xry111/glibc-2.34 xry111/tester-nohack xry111/usr-move
Last change on this file since 89c1c43d was 89c1c43d, checked in by Bruce Dubbs <bdubbs@…>, 5 years ago

Update to gcc-7.1.0.
Update to iproute2-4.11.0.
Fix some faulty gnulib code in diffutils.
Disable a failing test in vim.
Document a failing test in binutils.

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

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