[673b0d8] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[b06ca36] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[673b0d8] | 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
[92474b45] | 7 |
|
---|
[81fd230] | 8 | <sect1 id="ch-system-binutils" role="wrap">
|
---|
[92474b45] | 9 | <?dbhtml filename="binutils.html"?>
|
---|
| 10 |
|
---|
[e747759] | 11 | <sect1info condition="script">
|
---|
| 12 | <productname>binutils</productname>
|
---|
| 13 | <productnumber>&binutils-version;</productnumber>
|
---|
| 14 | <address>&binutils-url;</address>
|
---|
| 15 | </sect1info>
|
---|
| 16 |
|
---|
[92474b45] | 17 | <title>Binutils-&binutils-version;</title>
|
---|
| 18 |
|
---|
| 19 | <indexterm zone="ch-system-binutils">
|
---|
| 20 | <primary sortas="a-Binutils">Binutils</primary>
|
---|
| 21 | </indexterm>
|
---|
| 22 |
|
---|
| 23 | <sect2 role="package">
|
---|
| 24 | <title/>
|
---|
[673b0d8] | 25 |
|
---|
[92474b45] | 26 | <para>The Binutils package contains a linker, an assembler, and other
|
---|
| 27 | tools for handling object files.</para>
|
---|
[6370fa6] | 28 |
|
---|
[92474b45] | 29 | <segmentedlist>
|
---|
| 30 | <segtitle>&buildtime;</segtitle>
|
---|
| 31 | <segtitle>&diskspace;</segtitle>
|
---|
[5888299] | 32 |
|
---|
[92474b45] | 33 | <seglistitem>
|
---|
[e4a5635] | 34 | <seg>&binutils-ch6-sbu;</seg>
|
---|
| 35 | <seg>&binutils-ch6-du;</seg>
|
---|
[92474b45] | 36 | </seglistitem>
|
---|
| 37 | </segmentedlist>
|
---|
[a001133] | 38 |
|
---|
[92474b45] | 39 | </sect2>
|
---|
| 40 |
|
---|
| 41 | <sect2 role="installation">
|
---|
| 42 | <title>Installation of Binutils</title>
|
---|
| 43 |
|
---|
| 44 | <para>Verify that the PTYs are working properly inside the chroot
|
---|
| 45 | environment. Check that everything is set up correctly by performing a
|
---|
| 46 | simple test:</para>
|
---|
[73aedd1d] | 47 |
|
---|
[0445a3d] | 48 | <screen><userinput remap="test">expect -c "spawn ls"</userinput></screen>
|
---|
[73aedd1d] | 49 |
|
---|
[92474b45] | 50 | <para>If the following message shows up, the chroot environment is not
|
---|
| 51 | set up for proper PTY operation:</para>
|
---|
[81fd230] | 52 |
|
---|
[92474b45] | 53 | <screen><computeroutput>The system has no more ptys.
|
---|
[81fd230] | 54 | Ask your system administrator to create more.</computeroutput></screen>
|
---|
| 55 |
|
---|
[92474b45] | 56 | <para>This issue needs to be resolved before running the test suites
|
---|
| 57 | for Binutils and GCC.</para>
|
---|
[81fd230] | 58 |
|
---|
[93ee748] | 59 | <para>Binutils does not recognize versions of Texinfo newer than 4.9. Fix
|
---|
| 60 | this issue by applying the following patch:</para>
|
---|
| 61 |
|
---|
| 62 | <screen><userinput remap="pre">patch -Np1 -i ../&binutils-configure-patch;</userinput></screen>
|
---|
| 63 |
|
---|
[3e0c6919] | 64 | <para>Suppress the installation of an outdated
|
---|
| 65 | <filename>standards.info</filename> file as a newer one is installed later
|
---|
| 66 | on in the Autoconf instructions:</para>
|
---|
| 67 |
|
---|
| 68 | <screen><userinput remap="pre">rm -fv etc/standards.info
|
---|
| 69 | sed -i.bak '/^INFO/s/standards.info //' etc/Makefile.in</userinput></screen>
|
---|
| 70 |
|
---|
[92474b45] | 71 | <para>The Binutils documentation recommends building Binutils outside of the
|
---|
| 72 | source directory in a dedicated build directory:</para>
|
---|
[73aedd1d] | 73 |
|
---|
[0445a3d] | 74 | <screen><userinput remap="pre">mkdir -v ../binutils-build
|
---|
[73aedd1d] | 75 | cd ../binutils-build</userinput></screen>
|
---|
| 76 |
|
---|
[92474b45] | 77 | <para>Prepare Binutils for compilation:</para>
|
---|
[73aedd1d] | 78 |
|
---|
[0445a3d] | 79 | <screen><userinput remap="configure">../binutils-&binutils-version;/configure --prefix=/usr \
|
---|
[d72e04a] | 80 | --enable-shared</userinput></screen>
|
---|
[73aedd1d] | 81 |
|
---|
[92474b45] | 82 | <para>Compile the package:</para>
|
---|
[73aedd1d] | 83 |
|
---|
[0445a3d] | 84 | <screen><userinput remap="make">make tooldir=/usr</userinput></screen>
|
---|
[73aedd1d] | 85 |
|
---|
[92474b45] | 86 | <variablelist>
|
---|
| 87 | <title>The meaning of the make parameter:</title>
|
---|
| 88 |
|
---|
| 89 | <varlistentry>
|
---|
| 90 | <term><parameter>tooldir=/usr</parameter></term>
|
---|
| 91 | <listitem>
|
---|
| 92 | <para>Normally, the tooldir (the directory where the executables will
|
---|
| 93 | ultimately be located) is set to <filename
|
---|
| 94 | class="directory">$(exec_prefix)/$(target_alias)</filename>. For
|
---|
| 95 | example, i686 machines would expand that to <filename
|
---|
| 96 | class="directory">/usr/i686-pc-linux-gnu</filename>. Because this is
|
---|
| 97 | a custom system, this target-specific directory in <filename
|
---|
| 98 | class="directory">/usr</filename> is not required. <filename
|
---|
| 99 | class="directory">$(exec_prefix)/$(target_alias)</filename> would be
|
---|
| 100 | used if the system was used to cross-compile (for example, compiling a
|
---|
| 101 | package on an Intel machine that generates code that can be executed
|
---|
| 102 | on PowerPC machines).</para>
|
---|
| 103 | </listitem>
|
---|
| 104 | </varlistentry>
|
---|
| 105 |
|
---|
| 106 | </variablelist>
|
---|
| 107 |
|
---|
| 108 | <important>
|
---|
| 109 | <para>The test suite for Binutils in this section is considered critical.
|
---|
| 110 | Do not skip it under any circumstances.</para>
|
---|
| 111 | </important>
|
---|
| 112 |
|
---|
| 113 | <para>Test the results:</para>
|
---|
[81fd230] | 114 |
|
---|
[0445a3d] | 115 | <screen><userinput remap="test">make check</userinput></screen>
|
---|
[73aedd1d] | 116 |
|
---|
[92474b45] | 117 | <para>Install the package:</para>
|
---|
[73aedd1d] | 118 |
|
---|
[0445a3d] | 119 | <screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
|
---|
[73aedd1d] | 120 |
|
---|
[92474b45] | 121 | <para>Install the <filename class="headerfile">libiberty</filename> header
|
---|
| 122 | file that is needed by some packages:</para>
|
---|
[73aedd1d] | 123 |
|
---|
[0445a3d] | 124 | <screen><userinput remap="install">cp -v ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen>
|
---|
[73aedd1d] | 125 |
|
---|
[92474b45] | 126 | </sect2>
|
---|
| 127 |
|
---|
| 128 |
|
---|
| 129 | <sect2 id="contents-binutils" role="content">
|
---|
| 130 | <title>Contents of Binutils</title>
|
---|
| 131 |
|
---|
| 132 | <segmentedlist>
|
---|
| 133 | <segtitle>Installed programs</segtitle>
|
---|
| 134 | <segtitle>Installed libraries</segtitle>
|
---|
| 135 |
|
---|
| 136 | <seglistitem>
|
---|
| 137 | <seg>addr2line, ar, as, c++filt, gprof, ld, nm, objcopy, objdump,
|
---|
| 138 | ranlib, readelf, size, strings, and strip</seg>
|
---|
[0090db5] | 139 | <seg>libiberty.a, libbfd.{a,so}, and libopcodes.{a,so}</seg>
|
---|
[92474b45] | 140 | </seglistitem>
|
---|
| 141 | </segmentedlist>
|
---|
| 142 |
|
---|
| 143 | <variablelist>
|
---|
| 144 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 145 | <?dbfo list-presentation="list"?>
|
---|
| 146 | <?dbhtml list-presentation="table"?>
|
---|
| 147 |
|
---|
| 148 | <varlistentry id="addr2line">
|
---|
| 149 | <term><command>addr2line</command></term>
|
---|
| 150 | <listitem>
|
---|
| 151 | <para>Translates program addresses to file names and line numbers;
|
---|
| 152 | given an address and the name of an executable, it uses the debugging
|
---|
| 153 | information in the executable to determine which source file and line
|
---|
| 154 | number are associated with the address</para>
|
---|
| 155 | <indexterm zone="ch-system-binutils addr2line">
|
---|
| 156 | <primary sortas="b-addr2line">addr2line</primary>
|
---|
| 157 | </indexterm>
|
---|
| 158 | </listitem>
|
---|
| 159 | </varlistentry>
|
---|
| 160 |
|
---|
| 161 | <varlistentry id="ar">
|
---|
| 162 | <term><command>ar</command></term>
|
---|
| 163 | <listitem>
|
---|
| 164 | <para>Creates, modifies, and extracts from archives</para>
|
---|
| 165 | <indexterm zone="ch-system-binutils ar">
|
---|
| 166 | <primary sortas="b-ar">ar</primary>
|
---|
| 167 | </indexterm>
|
---|
| 168 | </listitem>
|
---|
| 169 | </varlistentry>
|
---|
| 170 |
|
---|
| 171 | <varlistentry id="as">
|
---|
| 172 | <term><command>as</command></term>
|
---|
| 173 | <listitem>
|
---|
| 174 | <para>An assembler that assembles the output of <command>gcc</command>
|
---|
| 175 | into object files</para>
|
---|
| 176 | <indexterm zone="ch-system-binutils as">
|
---|
| 177 | <primary sortas="b-as">as</primary>
|
---|
| 178 | </indexterm>
|
---|
| 179 | </listitem>
|
---|
| 180 | </varlistentry>
|
---|
| 181 |
|
---|
| 182 | <varlistentry id="c-filt">
|
---|
| 183 | <term><command>c++filt</command></term>
|
---|
| 184 | <listitem>
|
---|
| 185 | <para>Used by the linker to de-mangle C++ and Java symbols and to keep
|
---|
| 186 | overloaded functions from clashing</para>
|
---|
| 187 | <indexterm zone="ch-system-binutils c-filt">
|
---|
| 188 | <primary sortas="b-c++filt">c++filt</primary>
|
---|
| 189 | </indexterm>
|
---|
| 190 | </listitem>
|
---|
| 191 | </varlistentry>
|
---|
| 192 |
|
---|
| 193 | <varlistentry id="gprof">
|
---|
| 194 | <term><command>gprof</command></term>
|
---|
| 195 | <listitem>
|
---|
| 196 | <para>Displays call graph profile data</para>
|
---|
| 197 | <indexterm zone="ch-system-binutils gprof">
|
---|
| 198 | <primary sortas="b-gprof">gprof</primary>
|
---|
| 199 | </indexterm>
|
---|
| 200 | </listitem>
|
---|
| 201 | </varlistentry>
|
---|
| 202 |
|
---|
| 203 | <varlistentry id="ld">
|
---|
| 204 | <term><command>ld</command></term>
|
---|
| 205 | <listitem>
|
---|
| 206 | <para>A linker that combines a number of object and archive files
|
---|
| 207 | into a single file, relocating their data and tying up symbol
|
---|
| 208 | references</para>
|
---|
| 209 | <indexterm zone="ch-system-binutils ld">
|
---|
| 210 | <primary sortas="b-ld">ld</primary>
|
---|
| 211 | </indexterm>
|
---|
| 212 | </listitem>
|
---|
| 213 | </varlistentry>
|
---|
| 214 |
|
---|
| 215 | <varlistentry id="nm">
|
---|
| 216 | <term><command>nm</command></term>
|
---|
| 217 | <listitem>
|
---|
| 218 | <para>Lists the symbols occurring in a given object file</para>
|
---|
| 219 | <indexterm zone="ch-system-binutils nm">
|
---|
| 220 | <primary sortas="b-nm">nm</primary>
|
---|
| 221 | </indexterm>
|
---|
| 222 | </listitem>
|
---|
| 223 | </varlistentry>
|
---|
| 224 |
|
---|
| 225 | <varlistentry id="objcopy">
|
---|
| 226 | <term><command>objcopy</command></term>
|
---|
| 227 | <listitem>
|
---|
| 228 | <para>Translates one type of object file into another</para>
|
---|
| 229 | <indexterm zone="ch-system-binutils objcopy">
|
---|
| 230 | <primary sortas="b-objcopy">objcopy</primary>
|
---|
| 231 | </indexterm>
|
---|
| 232 | </listitem>
|
---|
| 233 | </varlistentry>
|
---|
| 234 |
|
---|
| 235 | <varlistentry id="objdump">
|
---|
| 236 | <term><command>objdump</command></term>
|
---|
| 237 | <listitem>
|
---|
| 238 | <para>Displays information about the given object file, with options
|
---|
| 239 | controlling the particular information to display; the information
|
---|
| 240 | shown is useful to programmers who are working on the compilation
|
---|
| 241 | tools</para>
|
---|
| 242 | <indexterm zone="ch-system-binutils objdump">
|
---|
| 243 | <primary sortas="b-objdump">objdump</primary>
|
---|
| 244 | </indexterm>
|
---|
| 245 | </listitem>
|
---|
| 246 | </varlistentry>
|
---|
| 247 |
|
---|
| 248 | <varlistentry id="ranlib">
|
---|
| 249 | <term><command>ranlib</command></term>
|
---|
| 250 | <listitem>
|
---|
| 251 | <para>Generates an index of the contents of an archive and stores it
|
---|
| 252 | in the archive; the index lists all of the symbols defined by archive
|
---|
| 253 | members that are relocatable object files</para>
|
---|
| 254 | <indexterm zone="ch-system-binutils ranlib">
|
---|
| 255 | <primary sortas="b-ranlib">ranlib</primary>
|
---|
| 256 | </indexterm>
|
---|
| 257 | </listitem>
|
---|
| 258 | </varlistentry>
|
---|
| 259 |
|
---|
| 260 | <varlistentry id="readelf">
|
---|
| 261 | <term><command>readelf</command></term>
|
---|
| 262 | <listitem>
|
---|
| 263 | <para>Displays information about ELF type binaries</para>
|
---|
| 264 | <indexterm zone="ch-system-binutils readelf">
|
---|
| 265 | <primary sortas="b-readelf">readelf</primary>
|
---|
| 266 | </indexterm>
|
---|
| 267 | </listitem>
|
---|
| 268 | </varlistentry>
|
---|
| 269 |
|
---|
| 270 | <varlistentry id="size">
|
---|
| 271 | <term><command>size</command></term>
|
---|
| 272 | <listitem>
|
---|
| 273 | <para>Lists the section sizes and the total size for the given
|
---|
| 274 | object files</para>
|
---|
| 275 | <indexterm zone="ch-system-binutils size">
|
---|
| 276 | <primary sortas="b-size">size</primary>
|
---|
| 277 | </indexterm>
|
---|
| 278 | </listitem>
|
---|
| 279 | </varlistentry>
|
---|
| 280 |
|
---|
| 281 | <varlistentry id="strings">
|
---|
| 282 | <term><command>strings</command></term>
|
---|
| 283 | <listitem>
|
---|
| 284 | <para>Outputs, for each given file, the sequences of printable
|
---|
| 285 | characters that are of at least the specified length (defaulting to
|
---|
| 286 | four); for object files, it prints, by default, only the strings from
|
---|
| 287 | the initializing and loading sections while for other types of files, it
|
---|
| 288 | scans the entire file</para>
|
---|
| 289 | <indexterm zone="ch-system-binutils strings">
|
---|
| 290 | <primary sortas="b-strings">strings</primary>
|
---|
| 291 | </indexterm>
|
---|
| 292 | </listitem>
|
---|
| 293 | </varlistentry>
|
---|
| 294 |
|
---|
| 295 | <varlistentry id="strip">
|
---|
| 296 | <term><command>strip</command></term>
|
---|
| 297 | <listitem>
|
---|
| 298 | <para>Discards symbols from object files</para>
|
---|
| 299 | <indexterm zone="ch-system-binutils strip">
|
---|
| 300 | <primary sortas="b-strip">strip</primary>
|
---|
| 301 | </indexterm>
|
---|
| 302 | </listitem>
|
---|
| 303 | </varlistentry>
|
---|
| 304 |
|
---|
| 305 | <varlistentry id="libiberty">
|
---|
| 306 | <term><filename class="libraryfile">libiberty</filename></term>
|
---|
| 307 | <listitem>
|
---|
| 308 | <para>Contains routines used by various GNU programs, including
|
---|
| 309 | <command>getopt</command>, <command>obstack</command>,
|
---|
| 310 | <command>strerror</command>, <command>strtol</command>, and
|
---|
| 311 | <command>strtoul</command></para>
|
---|
| 312 | <indexterm zone="ch-system-binutils libiberty">
|
---|
| 313 | <primary sortas="c-libiberty">libiberty</primary>
|
---|
| 314 | </indexterm>
|
---|
| 315 | </listitem>
|
---|
| 316 | </varlistentry>
|
---|
| 317 |
|
---|
| 318 | <varlistentry id="libbfd">
|
---|
| 319 | <term><filename class="libraryfile">libbfd</filename></term>
|
---|
| 320 | <listitem>
|
---|
| 321 | <para>The Binary File Descriptor library</para>
|
---|
| 322 | <indexterm zone="ch-system-binutils libbfd">
|
---|
| 323 | <primary sortas="c-libbfd">libbfd</primary>
|
---|
| 324 | </indexterm>
|
---|
| 325 | </listitem>
|
---|
| 326 | </varlistentry>
|
---|
| 327 |
|
---|
| 328 | <varlistentry id="libopcodes">
|
---|
| 329 | <term><filename class="libraryfile">libopcodes</filename></term>
|
---|
| 330 | <listitem>
|
---|
| 331 | <para>A library for dealing with opcodes—the <quote>readable
|
---|
| 332 | text</quote> versions of instructions for the processor;
|
---|
| 333 | it is used for building utilities like
|
---|
| 334 | <command>objdump</command>.</para>
|
---|
| 335 | <indexterm zone="ch-system-binutils libopcodes">
|
---|
| 336 | <primary sortas="c-libopcodes">libopcodes</primary>
|
---|
| 337 | </indexterm>
|
---|
| 338 | </listitem>
|
---|
| 339 | </varlistentry>
|
---|
| 340 |
|
---|
| 341 | </variablelist>
|
---|
| 342 |
|
---|
| 343 | </sect2>
|
---|
[673b0d8] | 344 |
|
---|
| 345 | </sect1>
|
---|