source: chapter06/binutils.xml@ 3fa7ca4

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 6.5 6.6 6.7 6.8 7.0 7.1 7.2 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 3fa7ca4 was 3fa7ca4, checked in by Matthew Burgess <matthew@…>, 15 years ago

Upgrade to Binutils-2.19. FIxes #2268.

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

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