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