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.
|
---|
58 | Ask 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
|
---|
65 | sed -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
|
---|
71 | cd ../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 | <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 | <screen><userinput remap="install">cp -v ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen>
|
---|
121 |
|
---|
122 | </sect2>
|
---|
123 |
|
---|
124 |
|
---|
125 | <sect2 id="contents-binutils" role="content">
|
---|
126 | <title>Contents of Binutils</title>
|
---|
127 |
|
---|
128 | <segmentedlist>
|
---|
129 | <segtitle>Installed programs</segtitle>
|
---|
130 | <segtitle>Installed libraries</segtitle>
|
---|
131 | <segtitle>Installed directory</segtitle>
|
---|
132 |
|
---|
133 | <seglistitem>
|
---|
134 | <seg>addr2line, ar, as, c++filt, elfedit, gprof, ld, ld.bfd, nm,
|
---|
135 | objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
|
---|
136 | <seg>libiberty.a, libbfd.{a,so}, and libopcodes.{a,so}</seg>
|
---|
137 | <seg>/usr/lib/ldscripts</seg>
|
---|
138 | </seglistitem>
|
---|
139 | </segmentedlist>
|
---|
140 |
|
---|
141 | <variablelist>
|
---|
142 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
143 | <?dbfo list-presentation="list"?>
|
---|
144 | <?dbhtml list-presentation="table"?>
|
---|
145 |
|
---|
146 | <varlistentry id="addr2line">
|
---|
147 | <term><command>addr2line</command></term>
|
---|
148 | <listitem>
|
---|
149 | <para>Translates program addresses to file names and line numbers;
|
---|
150 | given an address and the name of an executable, it uses the debugging
|
---|
151 | information in the executable to determine which source file and line
|
---|
152 | number are associated with the address</para>
|
---|
153 | <indexterm zone="ch-system-binutils addr2line">
|
---|
154 | <primary sortas="b-addr2line">addr2line</primary>
|
---|
155 | </indexterm>
|
---|
156 | </listitem>
|
---|
157 | </varlistentry>
|
---|
158 |
|
---|
159 | <varlistentry id="ar">
|
---|
160 | <term><command>ar</command></term>
|
---|
161 | <listitem>
|
---|
162 | <para>Creates, modifies, and extracts from archives</para>
|
---|
163 | <indexterm zone="ch-system-binutils ar">
|
---|
164 | <primary sortas="b-ar">ar</primary>
|
---|
165 | </indexterm>
|
---|
166 | </listitem>
|
---|
167 | </varlistentry>
|
---|
168 |
|
---|
169 | <varlistentry id="as">
|
---|
170 | <term><command>as</command></term>
|
---|
171 | <listitem>
|
---|
172 | <para>An assembler that assembles the output of <command>gcc</command>
|
---|
173 | into object files</para>
|
---|
174 | <indexterm zone="ch-system-binutils as">
|
---|
175 | <primary sortas="b-as">as</primary>
|
---|
176 | </indexterm>
|
---|
177 | </listitem>
|
---|
178 | </varlistentry>
|
---|
179 |
|
---|
180 | <varlistentry id="c-filt">
|
---|
181 | <term><command>c++filt</command></term>
|
---|
182 | <listitem>
|
---|
183 | <para>Used by the linker to de-mangle C++ and Java symbols and to keep
|
---|
184 | overloaded functions from clashing</para>
|
---|
185 | <indexterm zone="ch-system-binutils c-filt">
|
---|
186 | <primary sortas="b-c++filt">c++filt</primary>
|
---|
187 | </indexterm>
|
---|
188 | </listitem>
|
---|
189 | </varlistentry>
|
---|
190 |
|
---|
191 | <varlistentry id="elfedit">
|
---|
192 | <term><command>elfedit</command></term>
|
---|
193 | <listitem>
|
---|
194 | <para>Updates the ELF header of ELF files</para>
|
---|
195 | <indexterm zone="ch-system-binutils elfedit">
|
---|
196 | <primary sortas="b-elfedit">elfedit</primary>
|
---|
197 | </indexterm>
|
---|
198 | </listitem>
|
---|
199 | </varlistentry>
|
---|
200 |
|
---|
201 | <varlistentry id="gprof">
|
---|
202 | <term><command>gprof</command></term>
|
---|
203 | <listitem>
|
---|
204 | <para>Displays call graph profile data</para>
|
---|
205 | <indexterm zone="ch-system-binutils gprof">
|
---|
206 | <primary sortas="b-gprof">gprof</primary>
|
---|
207 | </indexterm>
|
---|
208 | </listitem>
|
---|
209 | </varlistentry>
|
---|
210 |
|
---|
211 | <varlistentry id="ld">
|
---|
212 | <term><command>ld</command></term>
|
---|
213 | <listitem>
|
---|
214 | <para>A linker that combines a number of object and archive files
|
---|
215 | into a single file, relocating their data and tying up symbol
|
---|
216 | references</para>
|
---|
217 | <indexterm zone="ch-system-binutils ld">
|
---|
218 | <primary sortas="b-ld">ld</primary>
|
---|
219 | </indexterm>
|
---|
220 | </listitem>
|
---|
221 | </varlistentry>
|
---|
222 |
|
---|
223 | <varlistentry id="ld.bfd">
|
---|
224 | <term><command>ld.bfd</command></term>
|
---|
225 | <listitem>
|
---|
226 | <para>Hard link to <command>ld</command></para>
|
---|
227 | <indexterm zone="ch-system-binutils ld.bfd">
|
---|
228 | <primary sortas="b-ld.bfd">ld.bfd</primary>
|
---|
229 | </indexterm>
|
---|
230 | </listitem>
|
---|
231 | </varlistentry>
|
---|
232 |
|
---|
233 | <varlistentry id="nm">
|
---|
234 | <term><command>nm</command></term>
|
---|
235 | <listitem>
|
---|
236 | <para>Lists the symbols occurring in a given object file</para>
|
---|
237 | <indexterm zone="ch-system-binutils nm">
|
---|
238 | <primary sortas="b-nm">nm</primary>
|
---|
239 | </indexterm>
|
---|
240 | </listitem>
|
---|
241 | </varlistentry>
|
---|
242 |
|
---|
243 | <varlistentry id="objcopy">
|
---|
244 | <term><command>objcopy</command></term>
|
---|
245 | <listitem>
|
---|
246 | <para>Translates one type of object file into another</para>
|
---|
247 | <indexterm zone="ch-system-binutils objcopy">
|
---|
248 | <primary sortas="b-objcopy">objcopy</primary>
|
---|
249 | </indexterm>
|
---|
250 | </listitem>
|
---|
251 | </varlistentry>
|
---|
252 |
|
---|
253 | <varlistentry id="objdump">
|
---|
254 | <term><command>objdump</command></term>
|
---|
255 | <listitem>
|
---|
256 | <para>Displays information about the given object file, with options
|
---|
257 | controlling the particular information to display; the information
|
---|
258 | shown is useful to programmers who are working on the compilation
|
---|
259 | tools</para>
|
---|
260 | <indexterm zone="ch-system-binutils objdump">
|
---|
261 | <primary sortas="b-objdump">objdump</primary>
|
---|
262 | </indexterm>
|
---|
263 | </listitem>
|
---|
264 | </varlistentry>
|
---|
265 |
|
---|
266 | <varlistentry id="ranlib">
|
---|
267 | <term><command>ranlib</command></term>
|
---|
268 | <listitem>
|
---|
269 | <para>Generates an index of the contents of an archive and stores it
|
---|
270 | in the archive; the index lists all of the symbols defined by archive
|
---|
271 | members that are relocatable object files</para>
|
---|
272 | <indexterm zone="ch-system-binutils ranlib">
|
---|
273 | <primary sortas="b-ranlib">ranlib</primary>
|
---|
274 | </indexterm>
|
---|
275 | </listitem>
|
---|
276 | </varlistentry>
|
---|
277 |
|
---|
278 | <varlistentry id="readelf">
|
---|
279 | <term><command>readelf</command></term>
|
---|
280 | <listitem>
|
---|
281 | <para>Displays information about ELF type binaries</para>
|
---|
282 | <indexterm zone="ch-system-binutils readelf">
|
---|
283 | <primary sortas="b-readelf">readelf</primary>
|
---|
284 | </indexterm>
|
---|
285 | </listitem>
|
---|
286 | </varlistentry>
|
---|
287 |
|
---|
288 | <varlistentry id="size">
|
---|
289 | <term><command>size</command></term>
|
---|
290 | <listitem>
|
---|
291 | <para>Lists the section sizes and the total size for the given
|
---|
292 | object files</para>
|
---|
293 | <indexterm zone="ch-system-binutils size">
|
---|
294 | <primary sortas="b-size">size</primary>
|
---|
295 | </indexterm>
|
---|
296 | </listitem>
|
---|
297 | </varlistentry>
|
---|
298 |
|
---|
299 | <varlistentry id="strings">
|
---|
300 | <term><command>strings</command></term>
|
---|
301 | <listitem>
|
---|
302 | <para>Outputs, for each given file, the sequences of printable
|
---|
303 | characters that are of at least the specified length (defaulting to
|
---|
304 | four); for object files, it prints, by default, only the strings from
|
---|
305 | the initializing and loading sections while for other types of files, it
|
---|
306 | scans the entire file</para>
|
---|
307 | <indexterm zone="ch-system-binutils strings">
|
---|
308 | <primary sortas="b-strings">strings</primary>
|
---|
309 | </indexterm>
|
---|
310 | </listitem>
|
---|
311 | </varlistentry>
|
---|
312 |
|
---|
313 | <varlistentry id="strip">
|
---|
314 | <term><command>strip</command></term>
|
---|
315 | <listitem>
|
---|
316 | <para>Discards symbols from object files</para>
|
---|
317 | <indexterm zone="ch-system-binutils strip">
|
---|
318 | <primary sortas="b-strip">strip</primary>
|
---|
319 | </indexterm>
|
---|
320 | </listitem>
|
---|
321 | </varlistentry>
|
---|
322 |
|
---|
323 | <varlistentry id="libiberty">
|
---|
324 | <term><filename class="libraryfile">libiberty</filename></term>
|
---|
325 | <listitem>
|
---|
326 | <para>Contains routines used by various GNU programs, including
|
---|
327 | <command>getopt</command>, <command>obstack</command>,
|
---|
328 | <command>strerror</command>, <command>strtol</command>, and
|
---|
329 | <command>strtoul</command></para>
|
---|
330 | <indexterm zone="ch-system-binutils libiberty">
|
---|
331 | <primary sortas="c-libiberty">libiberty</primary>
|
---|
332 | </indexterm>
|
---|
333 | </listitem>
|
---|
334 | </varlistentry>
|
---|
335 |
|
---|
336 | <varlistentry id="libbfd">
|
---|
337 | <term><filename class="libraryfile">libbfd</filename></term>
|
---|
338 | <listitem>
|
---|
339 | <para>The Binary File Descriptor library</para>
|
---|
340 | <indexterm zone="ch-system-binutils libbfd">
|
---|
341 | <primary sortas="c-libbfd">libbfd</primary>
|
---|
342 | </indexterm>
|
---|
343 | </listitem>
|
---|
344 | </varlistentry>
|
---|
345 |
|
---|
346 | <varlistentry id="libopcodes">
|
---|
347 | <term><filename class="libraryfile">libopcodes</filename></term>
|
---|
348 | <listitem>
|
---|
349 | <para>A library for dealing with opcodes—the <quote>readable
|
---|
350 | text</quote> versions of instructions for the processor;
|
---|
351 | it is used for building utilities like
|
---|
352 | <command>objdump</command>.</para>
|
---|
353 | <indexterm zone="ch-system-binutils libopcodes">
|
---|
354 | <primary sortas="c-libopcodes">libopcodes</primary>
|
---|
355 | </indexterm>
|
---|
356 | </listitem>
|
---|
357 | </varlistentry>
|
---|
358 |
|
---|
359 | </variablelist>
|
---|
360 |
|
---|
361 | </sect2>
|
---|
362 |
|
---|
363 | </sect1>
|
---|