[673b0d8] | 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 | ]>
|
---|
[3be4d97] | 6 | <sect1 id="ch-system-binutils" xreflabel="Binutils">
|
---|
[673b0d8] | 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>
|
---|
[6370fa6] | 11 |
|
---|
[5888299] | 12 | <para>The Binutils package contains a linker, an assembler, and other tools for
|
---|
| 13 | handling object files.</para>
|
---|
| 14 |
|
---|
[673b0d8] | 15 | <screen>&buildtime; 1.4 SBU
|
---|
| 16 | &diskspace; 167 MB</screen>
|
---|
| 17 |
|
---|
| 18 | <para>Binutils installation depends on: Bash, Coreutils, Diffutils, GCC, Gettext,
|
---|
| 19 | Glibc, Grep, Make, Perl, Sed, Texinfo.</para>
|
---|
[3554fa3a] | 20 |
|
---|
[73aedd1d] | 21 |
|
---|
| 22 |
|
---|
| 23 | <sect2><title>Installation of Binutils</title>
|
---|
| 24 |
|
---|
| 25 | <para>Now is an appropriate time to verify that your pseudo terminals (PTYs) are
|
---|
| 26 | working properly inside the chroot environment. We will again quickly check that
|
---|
| 27 | everything is set up correctly by performing a simple test:</para>
|
---|
| 28 |
|
---|
| 29 | <screen><userinput>expect -c "spawn ls"</userinput></screen>
|
---|
| 30 |
|
---|
| 31 | <para>If you receive the message:</para>
|
---|
| 32 |
|
---|
| 33 | <blockquote><screen>The system has no more ptys. Ask your system administrator to create more.</screen></blockquote>
|
---|
| 34 |
|
---|
| 35 | <para>Your chroot environment is not set up for proper PTY operation. In this
|
---|
| 36 | case there is no point in running the test suites for Binutils and GCC until you
|
---|
[9dfc02f] | 37 | are able to resolve the issue.</para>
|
---|
[73aedd1d] | 38 |
|
---|
| 39 | <para>This package is known to behave badly when you have changed its
|
---|
| 40 | default optimization flags (including the -march and -mcpu options).
|
---|
| 41 | Therefore, if you have defined any environment variables that override
|
---|
[673b0d8] | 42 | default optimizations, such as CFLAGS and CXXFLAGS, we recommend un-setting
|
---|
[73aedd1d] | 43 | or modifying them when building Binutils.</para>
|
---|
| 44 |
|
---|
| 45 | <para>The Binutils documentation recommends building Binutils outside of the
|
---|
| 46 | source directory in a dedicated build directory:</para>
|
---|
| 47 |
|
---|
| 48 | <screen><userinput>mkdir ../binutils-build
|
---|
| 49 | cd ../binutils-build</userinput></screen>
|
---|
| 50 |
|
---|
| 51 | <para>Now prepare Binutils for compilation:</para>
|
---|
| 52 |
|
---|
[673b0d8] | 53 | <screen><userinput>../binutils-&binutils-version;/configure --prefix=/usr --enable-shared</userinput></screen>
|
---|
[73aedd1d] | 54 |
|
---|
| 55 | <para>Compile the package:</para>
|
---|
| 56 |
|
---|
| 57 | <screen><userinput>make tooldir=/usr</userinput></screen>
|
---|
| 58 |
|
---|
| 59 | <para>Normally, the <emphasis>tooldir</emphasis> (the directory where the
|
---|
| 60 | executables end up) is set to $(exec_prefix)/$(target_alias), which expands
|
---|
| 61 | into, for example, <filename>/usr/i686-pc-linux-gnu</filename>. Since we only
|
---|
| 62 | build for our own system, we don't need this target specific directory in
|
---|
| 63 | <filename>/usr</filename>. That setup would be used if the system was used to
|
---|
| 64 | cross-compile (for example compiling a package on an Intel machine that
|
---|
| 65 | generates code that can be executed on PowerPC machines).</para>
|
---|
| 66 |
|
---|
[90afe40d] | 67 | <important><para>The test suite for Binutils in this section is considered
|
---|
| 68 | <emphasis>critical</emphasis>. Our advice is to not skip it under any
|
---|
| 69 | circumstances.</para></important>
|
---|
| 70 |
|
---|
[73aedd1d] | 71 | <para>Test the results:</para>
|
---|
| 72 |
|
---|
[9dfc02f] | 73 | <screen><userinput>make -k check</userinput></screen>
|
---|
[73aedd1d] | 74 |
|
---|
[3be4d97] | 75 | <para>The test suite notes from <xref linkend="ch-tools-binutils-pass2"/> are still
|
---|
[73aedd1d] | 76 | very much appropriate here. Be sure to refer back there should you have any
|
---|
| 77 | doubts.</para>
|
---|
| 78 |
|
---|
| 79 | <para>Install the package:</para>
|
---|
| 80 |
|
---|
| 81 | <screen><userinput>make tooldir=/usr install</userinput></screen>
|
---|
| 82 |
|
---|
| 83 | <para>Install the <emphasis>libiberty</emphasis> header file that is needed by
|
---|
| 84 | some packages:</para>
|
---|
| 85 |
|
---|
[673b0d8] | 86 | <screen><userinput>cp ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen>
|
---|
[73aedd1d] | 87 |
|
---|
| 88 | </sect2>
|
---|
[6370fa6] | 89 |
|
---|
[5888299] | 90 |
|
---|
[673b0d8] | 91 | <sect2 id="contents-binutils"><title>Contents of Binutils</title>
|
---|
| 92 |
|
---|
| 93 | <para><emphasis>Installed programs</emphasis>: addr2line, ar, as, c++filt,
|
---|
| 94 | gprof, ld, nm, objcopy, objdump, ranlib, readelf, size, strings and
|
---|
| 95 | strip</para>
|
---|
| 96 |
|
---|
| 97 | <para><emphasis>Installed libraries</emphasis>: libiberty.a, libbfd.[a,so] and
|
---|
| 98 | libopcodes.[a,so]</para>
|
---|
| 99 |
|
---|
| 100 | </sect2>
|
---|
| 101 |
|
---|
| 102 |
|
---|
| 103 | <sect2><title>Short descriptions</title>
|
---|
| 104 |
|
---|
| 105 | <indexterm zone="ch-system-binutils addr2line"><primary sortas="b-addr2line">addr2line</primary></indexterm>
|
---|
| 106 | <para id="addr2line"><command>addr2line</command> translates program addresses to file
|
---|
| 107 | names and line numbers. Given an address and the name of an executable, it
|
---|
| 108 | uses the debugging information in the executable to figure out which source
|
---|
| 109 | file and line number are associated with the address.</para>
|
---|
| 110 |
|
---|
| 111 | <indexterm zone="ch-system-binutils ar"><primary sortas="b-ar">ar</primary></indexterm>
|
---|
| 112 | <para id="ar"><command>ar</command> creates, modifies, and extracts from archives. An archive
|
---|
| 113 | is a single file holding a collection of other files in a structure that makes
|
---|
| 114 | it possible to retrieve the original individual files (called members of
|
---|
| 115 | the archive).</para>
|
---|
| 116 |
|
---|
| 117 | <indexterm zone="ch-system-binutils as"><primary sortas="b-as">as</primary></indexterm>
|
---|
| 118 | <para id="as"><command>as</command> is an assembler. It assembles the output of
|
---|
| 119 | gcc into object files.</para>
|
---|
| 120 |
|
---|
| 121 | <indexterm zone="ch-system-binutils c-filt"><primary sortas="b-c++filt">c++filt</primary></indexterm>
|
---|
| 122 | <para id="c-filt"><command>c++filt</command> is used by the linker to de-mangle C++ and
|
---|
| 123 | Java symbols, to keep overloaded functions from clashing.</para>
|
---|
| 124 |
|
---|
| 125 | <indexterm zone="ch-system-binutils gprof"><primary sortas="b-gprof">gprof</primary></indexterm>
|
---|
| 126 | <para id="gprof"><command>gprof</command> displays call graph profile data.</para>
|
---|
| 127 |
|
---|
| 128 | <indexterm zone="ch-system-binutils ld"><primary sortas="b-ld">ld</primary></indexterm>
|
---|
| 129 | <para id="ld"><command>ld</command> is a linker. It combines a number of object
|
---|
| 130 | and archive files into a single file, relocating their data and tying up symbol
|
---|
| 131 | references.</para>
|
---|
| 132 |
|
---|
| 133 | <indexterm zone="ch-system-binutils nm"><primary sortas="b-nm">nm</primary></indexterm>
|
---|
| 134 | <para id="nm"><command>nm</command> lists the symbols occurring in a given object file.</para>
|
---|
[73aedd1d] | 135 |
|
---|
[673b0d8] | 136 | <indexterm zone="ch-system-binutils objcopy"><primary sortas="b-objcopy">objcopy</primary></indexterm>
|
---|
| 137 | <para id="objcopy"><command>objcopy</command> is used to translate one type of object
|
---|
| 138 | file into another.</para>
|
---|
| 139 |
|
---|
| 140 | <indexterm zone="ch-system-binutils objdump"><primary sortas="b-objdump">objdump</primary></indexterm>
|
---|
| 141 | <para id="objdump"><command>objdump</command> displays information about the given
|
---|
| 142 | object file, with options controlling what particular information to display.
|
---|
| 143 | The information shown is mostly only useful to programmers who are working on
|
---|
| 144 | the compilation tools.</para>
|
---|
| 145 |
|
---|
| 146 | <indexterm zone="ch-system-binutils ranlib"><primary sortas="b-ranlib">ranlib</primary></indexterm>
|
---|
| 147 | <para id="ranlib"><command>ranlib</command> generates an index of the contents of an
|
---|
| 148 | archive, and stores it in the archive. The index lists all the symbols defined
|
---|
| 149 | by archive members that are relocatable object files.</para>
|
---|
| 150 |
|
---|
| 151 | <indexterm zone="ch-system-binutils readelf"><primary sortas="b-readelf">readelf</primary></indexterm>
|
---|
| 152 | <para id="readelf"><command>readelf</command> displays information about elf type binaries.</para>
|
---|
| 153 |
|
---|
| 154 | <indexterm zone="ch-system-binutils size"><primary sortas="b-size">size</primary></indexterm>
|
---|
| 155 | <para id="size"><command>size</command> lists the section sizes -- and the grand
|
---|
| 156 | total -- for the given object files.</para>
|
---|
| 157 |
|
---|
| 158 | <indexterm zone="ch-system-binutils strings"><primary sortas="b-strings">strings</primary></indexterm>
|
---|
| 159 | <para id="strings"><command>strings</command> outputs, for each given file, the sequences
|
---|
| 160 | of printable characters that are of at least the specified length (defaulting to 4).
|
---|
| 161 | For object files it prints, by default, only the strings from the initializing
|
---|
| 162 | and loading sections. For other types of files it scans the whole file.</para>
|
---|
| 163 |
|
---|
| 164 | <indexterm zone="ch-system-binutils strip"><primary sortas="b-strip">strip</primary></indexterm>
|
---|
| 165 | <para id="strip"><command>strip</command> discards symbols from object files.</para>
|
---|
| 166 |
|
---|
| 167 | <indexterm zone="ch-system-binutils libiberty"><primary sortas="c-libiberty">libiberty</primary></indexterm>
|
---|
| 168 | <para id="libiberty"><command>libiberty</command> contains routines used by various GNU
|
---|
| 169 | programs, including getopt, obstack, strerror, strtol and strtoul.</para>
|
---|
| 170 |
|
---|
| 171 | <indexterm zone="ch-system-binutils libbfd"><primary sortas="c-libbfd">libbfd</primary></indexterm>
|
---|
| 172 | <para id="libbfd"><command>libbfd</command> is the Binary File Descriptor library.</para>
|
---|
| 173 |
|
---|
| 174 | <indexterm zone="ch-system-binutils libopcodes"><primary sortas="c-libopcodes">libopcodes</primary></indexterm>
|
---|
| 175 | <para id="libopcodes"><command>libopcodes</command> is a library for dealing with opcodes.
|
---|
| 176 | It is used for building utilities like objdump. Opcodes are the <quote>readable
|
---|
| 177 | text</quote> versions of instructions for the processor.</para>
|
---|
| 178 |
|
---|
| 179 | </sect2>
|
---|
| 180 |
|
---|
| 181 |
|
---|
| 182 |
|
---|
| 183 | </sect1>
|
---|