2004-05-03 11:59:46 +01:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
|
|
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
|
|
|
%general-entities;
|
|
|
|
]>
|
2004-05-16 01:08:42 +01:00
|
|
|
<sect1 id="ch-system-binutils" xreflabel="Binutils" role="wrap">
|
2004-05-03 11:59:46 +01:00
|
|
|
<title>Binutils-&binutils-version;</title>
|
|
|
|
<?dbhtml filename="binutils.html"?>
|
|
|
|
|
|
|
|
<indexterm zone="ch-system-binutils"><primary sortas="a-Binutils">Binutils</primary></indexterm>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2004-05-16 01:08:42 +01:00
|
|
|
<sect2 role="package"><title/>
|
2004-01-12 23:23:50 +00:00
|
|
|
<para>The Binutils package contains a linker, an assembler, and other tools for
|
|
|
|
handling object files.</para>
|
|
|
|
|
2004-05-16 01:08:42 +01:00
|
|
|
<segmentedlist>
|
|
|
|
<segtitle>&buildtime;</segtitle>
|
|
|
|
<segtitle>&diskspace;</segtitle>
|
|
|
|
<seglistitem><seg>1.4 SBU</seg><seg>167 MB</seg></seglistitem>
|
|
|
|
</segmentedlist>
|
|
|
|
|
|
|
|
<segmentedlist>
|
|
|
|
<segtitle>Binutils installation depends on</segtitle>
|
|
|
|
<seglistitem><seg>Bash, Coreutils, Diffutils, GCC, Gettext,
|
|
|
|
Glibc, Grep, Make, Perl, Sed, Texinfo</seg></seglistitem>
|
|
|
|
</segmentedlist>
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2 role="installation">
|
|
|
|
<title>Installation of Binutils</title>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
|
|
|
<para>Now is an appropriate time to verify that your pseudo terminals (PTYs) are
|
|
|
|
working properly inside the chroot environment. We will again quickly check that
|
|
|
|
everything is set up correctly by performing a simple test:</para>
|
|
|
|
|
|
|
|
<screen><userinput>expect -c "spawn ls"</userinput></screen>
|
|
|
|
|
|
|
|
<para>If you receive the message:</para>
|
|
|
|
|
2004-06-13 13:58:23 +01:00
|
|
|
<screen><computeroutput>The system has no more ptys. Ask your system administrator to create more.</computeroutput></screen>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
|
|
|
<para>Your chroot environment is not set up for proper PTY operation. In this
|
|
|
|
case there is no point in running the test suites for Binutils and GCC until you
|
2004-05-03 22:28:58 +01:00
|
|
|
are able to resolve the issue.</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
|
|
|
<para>This package is known to behave badly when you have changed its
|
2004-06-13 13:58:23 +01:00
|
|
|
default optimization flags (including the <parameter>-march</parameter> and <parameter>-mcpu</parameter> options).
|
2003-11-01 22:31:50 +00:00
|
|
|
Therefore, if you have defined any environment variables that override
|
2004-05-03 11:59:46 +01:00
|
|
|
default optimizations, such as CFLAGS and CXXFLAGS, we recommend un-setting
|
2003-11-01 22:31:50 +00:00
|
|
|
or modifying them when building Binutils.</para>
|
|
|
|
|
|
|
|
<para>The Binutils documentation recommends building Binutils outside of the
|
|
|
|
source directory in a dedicated build directory:</para>
|
|
|
|
|
|
|
|
<screen><userinput>mkdir ../binutils-build
|
|
|
|
cd ../binutils-build</userinput></screen>
|
|
|
|
|
|
|
|
<para>Now prepare Binutils for compilation:</para>
|
|
|
|
|
2004-05-03 11:59:46 +01:00
|
|
|
<screen><userinput>../binutils-&binutils-version;/configure --prefix=/usr --enable-shared</userinput></screen>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
|
|
|
<para>Compile the package:</para>
|
|
|
|
|
|
|
|
<screen><userinput>make tooldir=/usr</userinput></screen>
|
|
|
|
|
|
|
|
<para>Normally, the <emphasis>tooldir</emphasis> (the directory where the
|
|
|
|
executables end up) is set to $(exec_prefix)/$(target_alias), which expands
|
2004-06-13 13:58:23 +01:00
|
|
|
into, for example, <filename class="directory">/usr/i686-pc-linux-gnu</filename>. Since we only
|
2003-11-01 22:31:50 +00:00
|
|
|
build for our own system, we don't need this target specific directory in
|
2004-06-13 13:58:23 +01:00
|
|
|
<filename class="directory">/usr</filename>. That setup would be used if the system was used to
|
2003-11-01 22:31:50 +00:00
|
|
|
cross-compile (for example compiling a package on an Intel machine that
|
|
|
|
generates code that can be executed on PowerPC machines).</para>
|
|
|
|
|
2004-01-28 22:10:21 +00:00
|
|
|
<important><para>The test suite for Binutils in this section is considered
|
|
|
|
<emphasis>critical</emphasis>. Our advice is to not skip it under any
|
|
|
|
circumstances.</para></important>
|
|
|
|
|
2003-11-01 22:31:50 +00:00
|
|
|
<para>Test the results:</para>
|
|
|
|
|
2004-05-03 22:28:58 +01:00
|
|
|
<screen><userinput>make -k check</userinput></screen>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2004-01-27 22:29:49 +00:00
|
|
|
<para>The test suite notes from <xref linkend="ch-tools-binutils-pass2"/> are still
|
2003-11-01 22:31:50 +00:00
|
|
|
very much appropriate here. Be sure to refer back there should you have any
|
|
|
|
doubts.</para>
|
|
|
|
|
|
|
|
<para>Install the package:</para>
|
|
|
|
|
|
|
|
<screen><userinput>make tooldir=/usr install</userinput></screen>
|
|
|
|
|
2004-06-13 13:58:23 +01:00
|
|
|
<para>Install the <filename class="headerfile">libiberty</filename> header file that is needed by
|
2003-11-01 22:31:50 +00:00
|
|
|
some packages:</para>
|
|
|
|
|
2004-05-03 11:59:46 +01:00
|
|
|
<screen><userinput>cp ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
|
|
|
</sect2>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2004-01-12 23:23:50 +00:00
|
|
|
|
2004-05-17 22:55:01 +01:00
|
|
|
<sect2 id="contents-binutils" role="content"><title>Contents of Binutils</title>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2004-05-17 22:55:01 +01:00
|
|
|
<segmentedlist>
|
|
|
|
<segtitle>Installed programs</segtitle>
|
|
|
|
<segtitle>Installed libraries</segtitle>
|
|
|
|
<seglistitem><seg>addr2line, ar, as, c++filt, gprof, ld, nm, objcopy, objdump,
|
|
|
|
ranlib, readelf, size, strings and strip</seg>
|
|
|
|
<seg>libiberty.a, libbfd.[a,so] and libopcodes.[a,so]</seg></seglistitem>
|
|
|
|
</segmentedlist>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2004-05-17 22:55:01 +01:00
|
|
|
<variablelist><title>Short descriptions</title>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2004-05-24 22:37:26 +01:00
|
|
|
<varlistentry id="addr2line">
|
|
|
|
<term><command>addr2line</command></term>
|
2004-05-17 22:55:01 +01:00
|
|
|
<listitem>
|
2004-05-03 11:59:46 +01:00
|
|
|
<indexterm zone="ch-system-binutils addr2line"><primary sortas="b-addr2line">addr2line</primary></indexterm>
|
2004-05-17 22:55:01 +01:00
|
|
|
<para>translates program addresses to file
|
2004-05-03 11:59:46 +01:00
|
|
|
names and line numbers. Given an address and the name of an executable, it
|
|
|
|
uses the debugging information in the executable to figure out which source
|
|
|
|
file and line number are associated with the address.</para>
|
2004-05-17 22:55:01 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2004-05-24 22:37:26 +01:00
|
|
|
<varlistentry id="ar">
|
|
|
|
<term><command>ar</command></term>
|
2004-05-17 22:55:01 +01:00
|
|
|
<listitem>
|
2004-05-03 11:59:46 +01:00
|
|
|
<indexterm zone="ch-system-binutils ar"><primary sortas="b-ar">ar</primary></indexterm>
|
2004-05-17 22:55:01 +01:00
|
|
|
<para>creates, modifies, and extracts from archives. An archive
|
2004-05-03 11:59:46 +01:00
|
|
|
is a single file holding a collection of other files in a structure that makes
|
|
|
|
it possible to retrieve the original individual files (called members of
|
|
|
|
the archive).</para>
|
2004-05-17 22:55:01 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2004-05-24 22:37:26 +01:00
|
|
|
<varlistentry id="as">
|
|
|
|
<term><command>as</command></term>
|
2004-05-17 22:55:01 +01:00
|
|
|
<listitem>
|
2004-05-03 11:59:46 +01:00
|
|
|
<indexterm zone="ch-system-binutils as"><primary sortas="b-as">as</primary></indexterm>
|
2004-06-13 13:58:23 +01:00
|
|
|
<para>is an assembler. It assembles the output of <command>gcc</command> into object files.</para>
|
2004-05-17 22:55:01 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2004-05-24 22:37:26 +01:00
|
|
|
<varlistentry id="c-filt">
|
|
|
|
<term><command>c++filt</command></term>
|
2004-05-17 22:55:01 +01:00
|
|
|
<listitem>
|
2004-05-03 11:59:46 +01:00
|
|
|
<indexterm zone="ch-system-binutils c-filt"><primary sortas="b-c++filt">c++filt</primary></indexterm>
|
2004-05-17 22:55:01 +01:00
|
|
|
<para>is used by the linker to de-mangle C++ and
|
2004-05-03 11:59:46 +01:00
|
|
|
Java symbols, to keep overloaded functions from clashing.</para>
|
2004-05-17 22:55:01 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2004-05-24 22:37:26 +01:00
|
|
|
<varlistentry id="gprof">
|
|
|
|
<term><command>gprof</command></term>
|
2004-05-17 22:55:01 +01:00
|
|
|
<listitem>
|
2004-05-03 11:59:46 +01:00
|
|
|
<indexterm zone="ch-system-binutils gprof"><primary sortas="b-gprof">gprof</primary></indexterm>
|
2004-05-17 22:55:01 +01:00
|
|
|
<para>displays call graph profile data.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2004-05-24 22:37:26 +01:00
|
|
|
<varlistentry id="ld">
|
|
|
|
<term><command>ld</command></term>
|
2004-05-17 22:55:01 +01:00
|
|
|
<listitem>
|
2004-05-03 11:59:46 +01:00
|
|
|
<indexterm zone="ch-system-binutils ld"><primary sortas="b-ld">ld</primary></indexterm>
|
2004-05-17 22:55:01 +01:00
|
|
|
<para>is a linker. It combines a number of object and archive files into a single file,
|
|
|
|
relocating their data and tying up symbol references.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2004-05-24 22:37:26 +01:00
|
|
|
<varlistentry id="nm">
|
|
|
|
<term><command>nm</command></term>
|
2004-05-17 22:55:01 +01:00
|
|
|
<listitem>
|
2004-05-03 11:59:46 +01:00
|
|
|
<indexterm zone="ch-system-binutils nm"><primary sortas="b-nm">nm</primary></indexterm>
|
2004-05-17 22:55:01 +01:00
|
|
|
<para>lists the symbols occurring in a given object file.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2004-05-24 22:37:26 +01:00
|
|
|
<varlistentry id="objcopy">
|
|
|
|
<term><command>objcopy</command></term>
|
2004-05-17 22:55:01 +01:00
|
|
|
<listitem>
|
2004-05-03 11:59:46 +01:00
|
|
|
<indexterm zone="ch-system-binutils objcopy"><primary sortas="b-objcopy">objcopy</primary></indexterm>
|
2004-05-17 22:55:01 +01:00
|
|
|
<para>is used to translate one type of object file into another.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2004-05-24 22:37:26 +01:00
|
|
|
<varlistentry id="objdump">
|
|
|
|
<term><command>objdump</command></term>
|
2004-05-17 22:55:01 +01:00
|
|
|
<listitem>
|
2004-05-03 11:59:46 +01:00
|
|
|
<indexterm zone="ch-system-binutils objdump"><primary sortas="b-objdump">objdump</primary></indexterm>
|
2004-05-17 22:55:01 +01:00
|
|
|
<para>displays information about the given object file, with options controlling what
|
|
|
|
particular information to display. The information shown is mostly only useful to
|
|
|
|
programmers who are working on the compilation tools.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2004-05-24 22:37:26 +01:00
|
|
|
<varlistentry id="ranlib">
|
|
|
|
<term><command>ranlib</command></term>
|
2004-05-17 22:55:01 +01:00
|
|
|
<listitem>
|
2004-05-03 11:59:46 +01:00
|
|
|
<indexterm zone="ch-system-binutils ranlib"><primary sortas="b-ranlib">ranlib</primary></indexterm>
|
2004-05-17 22:55:01 +01:00
|
|
|
<para>generates an index of the contents of an
|
2004-05-03 11:59:46 +01:00
|
|
|
archive, and stores it in the archive. The index lists all the symbols defined
|
|
|
|
by archive members that are relocatable object files.</para>
|
2004-05-17 22:55:01 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2004-05-24 22:37:26 +01:00
|
|
|
<varlistentry id="readelf">
|
|
|
|
<term><command>readelf</command></term>
|
2004-05-17 22:55:01 +01:00
|
|
|
<listitem>
|
2004-05-03 11:59:46 +01:00
|
|
|
<indexterm zone="ch-system-binutils readelf"><primary sortas="b-readelf">readelf</primary></indexterm>
|
2004-05-17 22:55:01 +01:00
|
|
|
<para>displays information about elf type binaries.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2004-05-24 22:37:26 +01:00
|
|
|
<varlistentry id="size">
|
|
|
|
<term><command>size</command></term>
|
2004-05-17 22:55:01 +01:00
|
|
|
<listitem>
|
2004-05-03 11:59:46 +01:00
|
|
|
<indexterm zone="ch-system-binutils size"><primary sortas="b-size">size</primary></indexterm>
|
2004-05-17 22:55:01 +01:00
|
|
|
<para>lists the section sizes -- and the grand total -- for the given object files.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2004-05-24 22:37:26 +01:00
|
|
|
<varlistentry id="strings">
|
|
|
|
<term><command>strings</command></term>
|
2004-05-17 22:55:01 +01:00
|
|
|
<listitem>
|
2004-05-03 11:59:46 +01:00
|
|
|
<indexterm zone="ch-system-binutils strings"><primary sortas="b-strings">strings</primary></indexterm>
|
2004-05-17 22:55:01 +01:00
|
|
|
<para>outputs, for each given file, the sequences
|
2004-05-03 11:59:46 +01:00
|
|
|
of printable characters that are of at least the specified length (defaulting to 4).
|
|
|
|
For object files it prints, by default, only the strings from the initializing
|
|
|
|
and loading sections. For other types of files it scans the whole file.</para>
|
2004-05-17 22:55:01 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2004-05-24 22:37:26 +01:00
|
|
|
<varlistentry id="strip">
|
|
|
|
<term><command>strip</command></term>
|
2004-05-17 22:55:01 +01:00
|
|
|
<listitem>
|
2004-05-03 11:59:46 +01:00
|
|
|
<indexterm zone="ch-system-binutils strip"><primary sortas="b-strip">strip</primary></indexterm>
|
2004-05-17 22:55:01 +01:00
|
|
|
<para>discards symbols from object files.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2004-05-24 22:37:26 +01:00
|
|
|
<varlistentry id="libiberty">
|
2004-06-13 14:39:51 +01:00
|
|
|
<term><filename class="libraryfile">libiberty</filename></term>
|
2004-05-17 22:55:01 +01:00
|
|
|
<listitem>
|
2004-05-03 11:59:46 +01:00
|
|
|
<indexterm zone="ch-system-binutils libiberty"><primary sortas="c-libiberty">libiberty</primary></indexterm>
|
2004-05-17 22:55:01 +01:00
|
|
|
<para>contains routines used by various GNU
|
2004-05-03 11:59:46 +01:00
|
|
|
programs, including getopt, obstack, strerror, strtol and strtoul.</para>
|
2004-05-17 22:55:01 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2004-05-24 22:37:26 +01:00
|
|
|
<varlistentry id="libbfd">
|
2004-06-13 14:39:51 +01:00
|
|
|
<term><filename class="libraryfile">libbfd</filename></term>
|
2004-05-17 22:55:01 +01:00
|
|
|
<listitem>
|
2004-05-03 11:59:46 +01:00
|
|
|
<indexterm zone="ch-system-binutils libbfd"><primary sortas="c-libbfd">libbfd</primary></indexterm>
|
2004-05-17 22:55:01 +01:00
|
|
|
<para>is the Binary File Descriptor library.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
2004-05-24 22:37:26 +01:00
|
|
|
<varlistentry id="libopcodes">
|
2004-06-13 14:39:51 +01:00
|
|
|
<term><filename class="libraryfile">libopcodes</filename></term>
|
2004-05-17 22:55:01 +01:00
|
|
|
<listitem>
|
2004-05-03 11:59:46 +01:00
|
|
|
<indexterm zone="ch-system-binutils libopcodes"><primary sortas="c-libopcodes">libopcodes</primary></indexterm>
|
2004-05-17 22:55:01 +01:00
|
|
|
<para>is a library for dealing with opcodes.
|
2004-05-03 11:59:46 +01:00
|
|
|
It is used for building utilities like objdump. Opcodes are the <quote>readable
|
|
|
|
text</quote> versions of instructions for the processor.</para>
|
2004-05-17 22:55:01 +01:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
2004-05-03 11:59:46 +01:00
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
</sect1>
|