source: chapter06/binutils.xml@ 5d7109b

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 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 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 5d7109b was 5d7109b, checked in by Matthew Burgess <matthew@…>, 11 years ago

Upgrade to Binutils-2.23.1. Fixes #3226.

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

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