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