source: chapter06/binutils.xml@ af133c3

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.1 6.1.1 6.3 6.4 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 af133c3 was af133c3, checked in by Jeremy Utley <jeremy@…>, 19 years ago

Added new binutils fix_strip patch taken from upstream

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

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