source: chapter06/binutils.xml@ c2913ea

Last change on this file since c2913ea was 6a0e6f3, checked in by Matthew Burgess <matthew@…>, 20 years ago
  • Remove the spurious <info> tags that I thought were necessary but evidently aren't

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

  • Property mode set to 100644
File size: 10.1 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE section [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<section xmlns="http://docbook.org/docbook-ng"
7 xml:id="ch-system-binutils" xreflabel="Binutils" role="wrap">
8<title>Binutils-&binutils-version;</title>
9<?dbhtml filename="binutils.html"?>
10
11<indexterm zone="ch-system-binutils"><primary sortas="a-Binutils">Binutils</primary></indexterm>
12
13<section role="package"><title/>
14<para>The Binutils package contains a linker, an assembler, and other tools for
15handling object files.</para>
16
17<segmentedlist>
18<segtitle>&buildtime;</segtitle>
19<segtitle>&diskspace;</segtitle>
20<seglistitem><seg>1.4 SBU</seg><seg>167 MB</seg></seglistitem>
21</segmentedlist>
22
23<segmentedlist>
24<segtitle>Binutils installation depends on</segtitle>
25<seglistitem><seg>Bash, Coreutils, Diffutils, GCC, Gettext,
26Glibc, Grep, Make, Perl, Sed, Texinfo</seg></seglistitem>
27</segmentedlist>
28</section>
29
30<section role="installation">
31<title>Installation of Binutils</title>
32
33<para>Now is an appropriate time to verify that your pseudo terminals (PTYs) are
34working properly inside the chroot environment. We will again quickly check that
35everything is set up correctly by performing a simple test:</para>
36
37<screen><userinput>expect -c "spawn ls"</userinput></screen>
38
39<para>If you receive the message:</para>
40
41<screen><computeroutput>The system has no more ptys. Ask your system administrator to create more.</computeroutput></screen>
42
43<para>Your chroot environment is not set up for proper PTY operation. In this
44case there is no point in running the test suites for Binutils and GCC until you
45are able to resolve the issue.</para>
46
47<para>This package is known to behave badly when you have changed its
48default optimization flags (including the <parameter>-march</parameter> and <parameter>-mcpu</parameter> options).
49Therefore, if you have defined any environment variables that override
50default optimizations, such as CFLAGS and CXXFLAGS, we recommend un-setting
51or modifying them when building Binutils.</para>
52
53<para>The Binutils documentation recommends building Binutils outside of the
54source directory in a dedicated build directory:</para>
55
56<screen><userinput>mkdir ../binutils-build
57cd ../binutils-build</userinput></screen>
58
59<para>Now prepare Binutils for compilation:</para>
60
61<screen><userinput>../binutils-&binutils-version;/configure --prefix=/usr --enable-shared</userinput></screen>
62
63<para>Compile the package:</para>
64
65<screen><userinput>make tooldir=/usr</userinput></screen>
66
67<para>Normally, the <emphasis>tooldir</emphasis> (the directory where the
68executables end up) is set to $(exec_prefix)/$(target_alias), which expands
69into, for example, <filename class="directory">/usr/i686-pc-linux-gnu</filename>. Since we only
70build for our own system, we don't need this target specific directory in
71<filename class="directory">/usr</filename>. That setup would be used if the system was used to
72cross-compile (for example compiling a package on an Intel machine that
73generates code that can be executed on PowerPC machines).</para>
74
75<important><para>The test suite for Binutils in this section is considered
76<emphasis>critical</emphasis>. Our advice is to not skip it under any
77circumstances.</para></important>
78
79<para>Test the results:</para>
80
81<screen><userinput>make -k check</userinput></screen>
82
83<para>The test suite notes from <xref linkend="ch-tools-binutils-pass2"/> are still
84very much appropriate here. Be sure to refer back there should you have any
85doubts.</para>
86
87<para>Install the package:</para>
88
89<screen><userinput>make tooldir=/usr install</userinput></screen>
90
91<para>Install the <filename class="headerfile">libiberty</filename> header file that is needed by
92some packages:</para>
93
94<screen><userinput>cp ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen>
95
96</section>
97
98
99<section xml:id="contents-binutils" role="content">
100<title>Contents of Binutils</title>
101
102<segmentedlist>
103<segtitle>Installed programs</segtitle>
104<segtitle>Installed libraries</segtitle>
105<seglistitem><seg>addr2line, ar, as, c++filt, gprof, ld, nm, objcopy, objdump,
106ranlib, readelf, size, strings and strip</seg>
107<seg>libiberty.a, libbfd.[a,so] and libopcodes.[a,so]</seg></seglistitem>
108</segmentedlist>
109
110<variablelist><title>Short descriptions</title>
111
112<varlistentry xml:id="addr2line">
113<term><command>addr2line</command></term>
114<listitem>
115<indexterm zone="ch-system-binutils addr2line"><primary sortas="b-addr2line">addr2line</primary></indexterm>
116<para>translates program addresses to file
117names and line numbers. Given an address and the name of an executable, it
118uses the debugging information in the executable to figure out which source
119file and line number are associated with the address.</para>
120</listitem>
121</varlistentry>
122
123<varlistentry xml:id="ar">
124<term><command>ar</command></term>
125<listitem>
126<indexterm zone="ch-system-binutils ar"><primary sortas="b-ar">ar</primary></indexterm>
127<para>creates, modifies, and extracts from archives. An archive
128is a single file holding a collection of other files in a structure that makes
129it possible to retrieve the original individual files (called members of
130the archive).</para>
131</listitem>
132</varlistentry>
133
134<varlistentry xml:id="as">
135<term><command>as</command></term>
136<listitem>
137<indexterm zone="ch-system-binutils as"><primary sortas="b-as">as</primary></indexterm>
138<para>is an assembler. It assembles the output of <command>gcc</command> into object files.</para>
139</listitem>
140</varlistentry>
141
142<varlistentry xml:id="c-filt">
143<term><command>c++filt</command></term>
144<listitem>
145<indexterm zone="ch-system-binutils c-filt"><primary sortas="b-c++filt">c++filt</primary></indexterm>
146<para>is used by the linker to de-mangle C++ and
147Java symbols, to keep overloaded functions from clashing.</para>
148</listitem>
149</varlistentry>
150
151<varlistentry xml:id="gprof">
152<term><command>gprof</command></term>
153<listitem>
154<indexterm zone="ch-system-binutils gprof"><primary sortas="b-gprof">gprof</primary></indexterm>
155<para>displays call graph profile data.</para>
156</listitem>
157</varlistentry>
158
159<varlistentry xml:id="ld">
160<term><command>ld</command></term>
161<listitem>
162<indexterm zone="ch-system-binutils ld"><primary sortas="b-ld">ld</primary></indexterm>
163<para>is a linker. It combines a number of object and archive files into a single file,
164relocating their data and tying up symbol references.</para>
165</listitem>
166</varlistentry>
167
168<varlistentry xml:id="nm">
169<term><command>nm</command></term>
170<listitem>
171<indexterm zone="ch-system-binutils nm"><primary sortas="b-nm">nm</primary></indexterm>
172<para>lists the symbols occurring in a given object file.</para>
173</listitem>
174</varlistentry>
175
176<varlistentry xml:id="objcopy">
177<term><command>objcopy</command></term>
178<listitem>
179<indexterm zone="ch-system-binutils objcopy"><primary sortas="b-objcopy">objcopy</primary></indexterm>
180<para>is used to translate one type of object file into another.</para>
181</listitem>
182</varlistentry>
183
184<varlistentry xml:id="objdump">
185<term><command>objdump</command></term>
186<listitem>
187<indexterm zone="ch-system-binutils objdump"><primary sortas="b-objdump">objdump</primary></indexterm>
188<para>displays information about the given object file, with options controlling what
189particular information to display. The information shown is mostly only useful to
190programmers who are working on the compilation tools.</para>
191</listitem>
192</varlistentry>
193
194<varlistentry xml:id="ranlib">
195<term><command>ranlib</command></term>
196<listitem>
197<indexterm zone="ch-system-binutils ranlib"><primary sortas="b-ranlib">ranlib</primary></indexterm>
198<para>generates an index of the contents of an
199archive, and stores it in the archive. The index lists all the symbols defined
200by archive members that are relocatable object files.</para>
201</listitem>
202</varlistentry>
203
204<varlistentry xml:id="readelf">
205<term><command>readelf</command></term>
206<listitem>
207<indexterm zone="ch-system-binutils readelf"><primary sortas="b-readelf">readelf</primary></indexterm>
208<para>displays information about elf type binaries.</para>
209</listitem>
210</varlistentry>
211
212<varlistentry xml:id="size">
213<term><command>size</command></term>
214<listitem>
215<indexterm zone="ch-system-binutils size"><primary sortas="b-size">size</primary></indexterm>
216<para>lists the section sizes -- and the grand total -- for the given object files.</para>
217</listitem>
218</varlistentry>
219
220<varlistentry xml:id="strings">
221<term><command>strings</command></term>
222<listitem>
223<indexterm zone="ch-system-binutils strings"><primary sortas="b-strings">strings</primary></indexterm>
224<para>outputs, for each given file, the sequences
225of printable characters that are of at least the specified length (defaulting to 4).
226For object files it prints, by default, only the strings from the initializing
227and loading sections. For other types of files it scans the whole file.</para>
228</listitem>
229</varlistentry>
230
231<varlistentry xml:id="strip">
232<term><command>strip</command></term>
233<listitem>
234<indexterm zone="ch-system-binutils strip"><primary sortas="b-strip">strip</primary></indexterm>
235<para>discards symbols from object files.</para>
236</listitem>
237</varlistentry>
238
239<varlistentry xml:id="libiberty">
240<term><filename class="libraryfile">libiberty</filename></term>
241<listitem>
242<indexterm zone="ch-system-binutils libiberty"><primary sortas="c-libiberty">libiberty</primary></indexterm>
243<para>contains routines used by various GNU
244programs, including getopt, obstack, strerror, strtol and strtoul.</para>
245</listitem>
246</varlistentry>
247
248<varlistentry xml:id="libbfd">
249<term><filename class="libraryfile">libbfd</filename></term>
250<listitem>
251<indexterm zone="ch-system-binutils libbfd"><primary sortas="c-libbfd">libbfd</primary></indexterm>
252<para>is the Binary File Descriptor library.</para>
253</listitem>
254</varlistentry>
255
256<varlistentry xml:id="libopcodes">
257<term><filename class="libraryfile">libopcodes</filename></term>
258<listitem>
259<indexterm zone="ch-system-binutils libopcodes"><primary sortas="c-libopcodes">libopcodes</primary></indexterm>
260<para>is a library for dealing with opcodes.
261It is used for building utilities like objdump. Opcodes are the <quote>readable
262text</quote> versions of instructions for the processor.</para>
263</listitem>
264</varlistentry>
265</variablelist>
266
267</section>
268
269</section>
Note: See TracBrowser for help on using the repository browser.