[a9e389d] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[bd48e48] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[a9e389d] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-cross-tools-binutils" role="wrap">
|
---|
| 9 | <?dbhtml filename="binutils.html"?>
|
---|
| 10 |
|
---|
[8f65e24] | 11 | <title>Binutils-&binutils-version;</title>
|
---|
[a9e389d] | 12 |
|
---|
| 13 | <indexterm zone="ch-cross-tools-binutils">
|
---|
| 14 | <primary sortas="a-Binutils">Binutils</primary>
|
---|
| 15 | <secondary>cross tools</secondary>
|
---|
| 16 | </indexterm>
|
---|
| 17 |
|
---|
| 18 | <sect2 role="package">
|
---|
| 19 | <title/>
|
---|
| 20 |
|
---|
| 21 | <para>The Binutils package contains a linker, an assembler, and other
|
---|
| 22 | tools for handling object files.</para>
|
---|
| 23 |
|
---|
| 24 | </sect2>
|
---|
| 25 |
|
---|
| 26 | <sect2 role="installation">
|
---|
| 27 | <title>Installation of Cross Binutils</title>
|
---|
| 28 |
|
---|
[e666df1] | 29 | <para os="a">It is important that Binutils be the first package compiled
|
---|
[9de8668] | 30 | because both the C library and GCC perform various tests on the available
|
---|
[a9e389d] | 31 | linker and assembler to determine which of their own features to
|
---|
| 32 | enable.</para>
|
---|
| 33 |
|
---|
[e666df1] | 34 | <para os="b">The Binutils documentation recommends building Binutils outside of the
|
---|
[a9e389d] | 35 | source directory in a dedicated build directory:</para>
|
---|
| 36 |
|
---|
[e666df1] | 37 | <screen os="c"><userinput>mkdir -v ../binutils-build
|
---|
[a9e389d] | 38 | cd ../binutils-build</userinput></screen>
|
---|
| 39 |
|
---|
[e666df1] | 40 | <para os="d">Prepare Binutils for compilation:</para>
|
---|
[a9e389d] | 41 |
|
---|
[b8ac103] | 42 | <screen os="e"><userinput>../binutils-&binutils-version;/configure \
|
---|
| 43 | --prefix=${CLFS}/cross-tools \
|
---|
| 44 | --target=${CLFS_TARGET} \
|
---|
[94e2400] | 45 | --with-sysroot=${CLFS}/cross-tools/${CLFS_TARGET} \
|
---|
[b8ac103] | 46 | --disable-nls \
|
---|
[62fdf1a] | 47 | --disable-multilib</userinput></screen>
|
---|
[a9e389d] | 48 |
|
---|
[e666df1] | 49 | <variablelist os="f">
|
---|
[a9e389d] | 50 | <title>The meaning of the configure options:</title>
|
---|
| 51 |
|
---|
[e666df1] | 52 | <varlistentry os="f1">
|
---|
[a9e389d] | 53 | <term><parameter>--prefix=${CLFS}/cross-tools</parameter></term>
|
---|
| 54 | <listitem>
|
---|
| 55 | <para>This tells the configure script to prepare to install the
|
---|
| 56 | package in the <filename class="directory">${CLFS}/cross-tools</filename>
|
---|
| 57 | directory.</para>
|
---|
| 58 | </listitem>
|
---|
| 59 | </varlistentry>
|
---|
| 60 |
|
---|
[e666df1] | 61 | <varlistentry os="f3">
|
---|
[a9e389d] | 62 | <term><parameter>--target=${CLFS_TARGET}</parameter></term>
|
---|
| 63 | <listitem>
|
---|
[8704f34] | 64 | <para>This creates a cross-architecture executable that creates files
|
---|
| 65 | for ${CLFS_TARGET} but runs on the host system.</para>
|
---|
[a9e389d] | 66 | </listitem>
|
---|
| 67 | </varlistentry>
|
---|
| 68 |
|
---|
[e666df1] | 69 | <varlistentry os="f4">
|
---|
[94e2400] | 70 | <term><parameter>--with-sysroot=${CLFS}/cross-tools/${CLFS_TARGET}</parameter></term>
|
---|
[a9e389d] | 71 | <listitem>
|
---|
| 72 | <para>This tells configure that ${CLFS} is going to be the root
|
---|
| 73 | of our system. It will now use the specified sysroot, ${CLFS}, as
|
---|
| 74 | a prefix of the default search paths.</para>
|
---|
| 75 | </listitem>
|
---|
| 76 | </varlistentry>
|
---|
| 77 |
|
---|
[e666df1] | 78 | <varlistentry os="f5">
|
---|
[a9e389d] | 79 | <term><parameter>--disable-nls</parameter></term>
|
---|
| 80 | <listitem>
|
---|
| 81 | <para>This disables internationalization as i18n is not needed for the
|
---|
| 82 | cross-compile tools.</para>
|
---|
| 83 | </listitem>
|
---|
| 84 | </varlistentry>
|
---|
| 85 |
|
---|
[e666df1] | 86 | <varlistentry os="f7">
|
---|
[a9e389d] | 87 | <term><parameter>--disable-multilib</parameter></term>
|
---|
| 88 | <listitem>
|
---|
| 89 | <para>This option disables the building of a multilib
|
---|
| 90 | capable binutils.</para>
|
---|
| 91 | </listitem>
|
---|
| 92 | </varlistentry>
|
---|
| 93 |
|
---|
| 94 | </variablelist>
|
---|
| 95 |
|
---|
[e666df1] | 96 | <para os="g">Compile the package:</para>
|
---|
[a9e389d] | 97 |
|
---|
[e666df1] | 98 | <screen os="h"><userinput>make configure-host
|
---|
[a9e389d] | 99 | make</userinput></screen>
|
---|
| 100 |
|
---|
[e666df1] | 101 | <variablelist os="i">
|
---|
[a9e389d] | 102 | <title>The meaning of the make options:</title>
|
---|
| 103 |
|
---|
[e666df1] | 104 | <varlistentry os="i1">
|
---|
[a9e389d] | 105 | <term><parameter>configure-host</parameter></term>
|
---|
| 106 | <listitem>
|
---|
| 107 | <para>This checks the host environment and makes sure all the
|
---|
| 108 | necessary tools are available to compile Binutils.</para>
|
---|
| 109 | </listitem>
|
---|
| 110 | </varlistentry>
|
---|
| 111 |
|
---|
| 112 | </variablelist>
|
---|
| 113 |
|
---|
[e666df1] | 114 | <para os="j">Install the package:</para>
|
---|
[a9e389d] | 115 |
|
---|
[e666df1] | 116 | <screen os="k"><userinput>make install</userinput></screen>
|
---|
[a9e389d] | 117 |
|
---|
| 118 | </sect2>
|
---|
| 119 |
|
---|
| 120 | <sect2 id="contents-binutils" role="content">
|
---|
| 121 | <title>Contents of Binutils</title>
|
---|
| 122 |
|
---|
| 123 | <segmentedlist>
|
---|
| 124 | <segtitle>Installed programs</segtitle>
|
---|
| 125 | <segtitle>Installed libraries</segtitle>
|
---|
| 126 |
|
---|
| 127 | <seglistitem>
|
---|
[3c24b73] | 128 | <seg>addr2line, ar, as, c++filt, elfedit, gprof, ld, nm, objcopy,
|
---|
| 129 | objdump, ranlib, readelf, size, strings, and strip</seg>
|
---|
[a9e389d] | 130 | <seg>libiberty.a, libbfd.[a,so], and libopcodes.[a,so]</seg>
|
---|
| 131 | </seglistitem>
|
---|
| 132 | </segmentedlist>
|
---|
| 133 |
|
---|
| 134 | <variablelist>
|
---|
| 135 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 136 | <?dbfo list-presentation="list"?>
|
---|
| 137 | <?dbhtml list-presentation="table"?>
|
---|
| 138 |
|
---|
| 139 | <varlistentry id="addr2line">
|
---|
| 140 | <term><command>addr2line</command></term>
|
---|
| 141 | <listitem>
|
---|
| 142 | <para>Translates program addresses to file names and line numbers;
|
---|
| 143 | given an address and the name of an executable, it uses the debugging
|
---|
| 144 | information in the executable to determine which source file and line
|
---|
| 145 | number are associated with the address</para>
|
---|
[6561a0f] | 146 | <indexterm zone="ch-cross-tools-binutils addr2line">
|
---|
[a9e389d] | 147 | <primary sortas="b-addr2line">addr2line</primary>
|
---|
| 148 | </indexterm>
|
---|
| 149 | </listitem>
|
---|
| 150 | </varlistentry>
|
---|
| 151 |
|
---|
| 152 | <varlistentry id="ar">
|
---|
| 153 | <term><command>ar</command></term>
|
---|
| 154 | <listitem>
|
---|
| 155 | <para>Creates, modifies, and extracts from archives</para>
|
---|
[6561a0f] | 156 | <indexterm zone="ch-cross-tools-binutils ar">
|
---|
[a9e389d] | 157 | <primary sortas="b-ar">ar</primary>
|
---|
| 158 | </indexterm>
|
---|
| 159 | </listitem>
|
---|
| 160 | </varlistentry>
|
---|
| 161 |
|
---|
| 162 | <varlistentry id="as">
|
---|
| 163 | <term><command>as</command></term>
|
---|
| 164 | <listitem>
|
---|
| 165 | <para>An assembler that assembles the output of <command>gcc</command>
|
---|
| 166 | into object files</para>
|
---|
[6561a0f] | 167 | <indexterm zone="ch-cross-tools-binutils as">
|
---|
[a9e389d] | 168 | <primary sortas="b-as">as</primary>
|
---|
| 169 | </indexterm>
|
---|
| 170 | </listitem>
|
---|
| 171 | </varlistentry>
|
---|
| 172 |
|
---|
| 173 | <varlistentry id="c-filt">
|
---|
| 174 | <term><command>c++filt</command></term>
|
---|
| 175 | <listitem>
|
---|
| 176 | <para>Used by the linker to de-mangle C++ and Java symbols and to keep
|
---|
| 177 | overloaded functions from clashing</para>
|
---|
[6561a0f] | 178 | <indexterm zone="ch-cross-tools-binutils c-filt">
|
---|
[a9e389d] | 179 | <primary sortas="b-c++filt">c++filt</primary>
|
---|
| 180 | </indexterm>
|
---|
| 181 | </listitem>
|
---|
| 182 | </varlistentry>
|
---|
| 183 |
|
---|
[3c24b73] | 184 | <varlistentry id="elfedit">
|
---|
| 185 | <term><command>elfedit</command></term>
|
---|
| 186 | <listitem>
|
---|
| 187 | <para>Examine and modify ELF metadata within an ELF object</para>
|
---|
| 188 | <indexterm zone="ch-cross-tools-binutils elfedit">
|
---|
| 189 | <primary sortas="b-elfedit">elfedit</primary>
|
---|
| 190 | </indexterm>
|
---|
| 191 | </listitem>
|
---|
| 192 | </varlistentry>
|
---|
| 193 |
|
---|
[a9e389d] | 194 | <varlistentry id="gprof">
|
---|
| 195 | <term><command>gprof</command></term>
|
---|
| 196 | <listitem>
|
---|
| 197 | <para>Displays call graph profile data</para>
|
---|
[6561a0f] | 198 | <indexterm zone="ch-cross-tools-binutils gprof">
|
---|
[a9e389d] | 199 | <primary sortas="b-gprof">gprof</primary>
|
---|
| 200 | </indexterm>
|
---|
| 201 | </listitem>
|
---|
| 202 | </varlistentry>
|
---|
| 203 |
|
---|
| 204 | <varlistentry id="ld">
|
---|
| 205 | <term><command>ld</command></term>
|
---|
| 206 | <listitem>
|
---|
| 207 | <para>A linker that combines a number of object and archive files
|
---|
| 208 | into a single file, relocating their data and tying up symbol
|
---|
| 209 | references</para>
|
---|
[6561a0f] | 210 | <indexterm zone="ch-cross-tools-binutils ld">
|
---|
[a9e389d] | 211 | <primary sortas="b-ld">ld</primary>
|
---|
| 212 | </indexterm>
|
---|
| 213 | </listitem>
|
---|
| 214 | </varlistentry>
|
---|
| 215 |
|
---|
| 216 | <varlistentry id="nm">
|
---|
| 217 | <term><command>nm</command></term>
|
---|
| 218 | <listitem>
|
---|
| 219 | <para>Lists the symbols occurring in a given object file</para>
|
---|
[6561a0f] | 220 | <indexterm zone="ch-cross-tools-binutils nm">
|
---|
[a9e389d] | 221 | <primary sortas="b-nm">nm</primary>
|
---|
| 222 | </indexterm>
|
---|
| 223 | </listitem>
|
---|
| 224 | </varlistentry>
|
---|
| 225 |
|
---|
[3c24b73] | 226 | <varlistentry id="objcopy">
|
---|
| 227 | <term><command>objcopy</command></term>
|
---|
| 228 | <listitem>
|
---|
| 229 | <para>Copy the contents of one object file to another</para>
|
---|
| 230 | <indexterm zone="ch-cross-tools-binutils objcopy">
|
---|
| 231 | <primary sortas="b-objcopy">objcopy</primary>
|
---|
| 232 | </indexterm>
|
---|
| 233 | </listitem>
|
---|
| 234 | </varlistentry>
|
---|
| 235 |
|
---|
[a9e389d] | 236 | <varlistentry id="objdump">
|
---|
| 237 | <term><command>objdump</command></term>
|
---|
| 238 | <listitem>
|
---|
| 239 | <para>Displays information about the given object file, with options
|
---|
| 240 | controlling the particular information to display; the information
|
---|
| 241 | shown is useful to programmers who are working on the compilation
|
---|
| 242 | tools</para>
|
---|
[6561a0f] | 243 | <indexterm zone="ch-cross-tools-binutils objdump">
|
---|
[a9e389d] | 244 | <primary sortas="b-objdump">objdump</primary>
|
---|
| 245 | </indexterm>
|
---|
| 246 | </listitem>
|
---|
| 247 | </varlistentry>
|
---|
| 248 |
|
---|
| 249 | <varlistentry id="ranlib">
|
---|
| 250 | <term><command>ranlib</command></term>
|
---|
| 251 | <listitem>
|
---|
| 252 | <para>Generates an index of the contents of an archive and stores it
|
---|
| 253 | in the archive; the index lists all of the symbols defined by archive
|
---|
| 254 | members that are relocatable object files</para>
|
---|
[6561a0f] | 255 | <indexterm zone="ch-cross-tools-binutils ranlib">
|
---|
[a9e389d] | 256 | <primary sortas="b-ranlib">ranlib</primary>
|
---|
| 257 | </indexterm>
|
---|
| 258 | </listitem>
|
---|
| 259 | </varlistentry>
|
---|
| 260 |
|
---|
| 261 | <varlistentry id="readelf">
|
---|
| 262 | <term><command>readelf</command></term>
|
---|
| 263 | <listitem>
|
---|
| 264 | <para>Displays information about ELF type binaries</para>
|
---|
[6561a0f] | 265 | <indexterm zone="ch-cross-tools-binutils readelf">
|
---|
[a9e389d] | 266 | <primary sortas="b-readelf">readelf</primary>
|
---|
| 267 | </indexterm>
|
---|
| 268 | </listitem>
|
---|
| 269 | </varlistentry>
|
---|
| 270 |
|
---|
| 271 | <varlistentry id="size">
|
---|
| 272 | <term><command>size</command></term>
|
---|
| 273 | <listitem>
|
---|
| 274 | <para>Lists the section sizes and the total size for the given
|
---|
| 275 | object files</para>
|
---|
[6561a0f] | 276 | <indexterm zone="ch-cross-tools-binutils size">
|
---|
[a9e389d] | 277 | <primary sortas="b-size">size</primary>
|
---|
| 278 | </indexterm>
|
---|
| 279 | </listitem>
|
---|
| 280 | </varlistentry>
|
---|
| 281 |
|
---|
| 282 | <varlistentry id="strings">
|
---|
| 283 | <term><command>strings</command></term>
|
---|
| 284 | <listitem>
|
---|
| 285 | <para>Outputs, for each given file, the sequences of printable
|
---|
| 286 | characters that are of at least the specified length (defaulting to
|
---|
| 287 | four); for object files, it prints, by default, only the strings from
|
---|
| 288 | the initializing and loading sections while for other types of files,
|
---|
| 289 | it scans the entire file</para>
|
---|
[6561a0f] | 290 | <indexterm zone="ch-cross-tools-binutils strings">
|
---|
[a9e389d] | 291 | <primary sortas="b-strings">strings</primary>
|
---|
| 292 | </indexterm>
|
---|
| 293 | </listitem>
|
---|
| 294 | </varlistentry>
|
---|
| 295 |
|
---|
| 296 | <varlistentry id="strip">
|
---|
| 297 | <term><command>strip</command></term>
|
---|
| 298 | <listitem>
|
---|
| 299 | <para>Discards symbols from object files</para>
|
---|
[6561a0f] | 300 | <indexterm zone="ch-cross-tools-binutils strip">
|
---|
[a9e389d] | 301 | <primary sortas="b-strip">strip</primary>
|
---|
| 302 | </indexterm>
|
---|
| 303 | </listitem>
|
---|
| 304 | </varlistentry>
|
---|
| 305 |
|
---|
| 306 | <varlistentry id="libiberty">
|
---|
| 307 | <term><filename class="libraryfile">libiberty</filename></term>
|
---|
| 308 | <listitem>
|
---|
| 309 | <para>Contains routines used by various GNU programs, including
|
---|
| 310 | <command>getopt</command>, <command>obstack</command>,
|
---|
| 311 | <command>strerror</command>, <command>strtol</command>, and
|
---|
| 312 | <command>strtoul</command></para>
|
---|
[6561a0f] | 313 | <indexterm zone="ch-cross-tools-binutils libiberty">
|
---|
[a9e389d] | 314 | <primary sortas="c-libiberty">libiberty</primary>
|
---|
| 315 | </indexterm>
|
---|
| 316 | </listitem>
|
---|
| 317 | </varlistentry>
|
---|
| 318 |
|
---|
| 319 | <varlistentry id="libbfd">
|
---|
| 320 | <term><filename class="libraryfile">libbfd</filename></term>
|
---|
| 321 | <listitem>
|
---|
| 322 | <para>The Binary File Descriptor library</para>
|
---|
[6561a0f] | 323 | <indexterm zone="ch-cross-tools-binutils libbfd">
|
---|
[a9e389d] | 324 | <primary sortas="c-libbfd">libbfd</primary>
|
---|
| 325 | </indexterm>
|
---|
| 326 | </listitem>
|
---|
| 327 | </varlistentry>
|
---|
| 328 |
|
---|
| 329 | <varlistentry id="libopcodes">
|
---|
| 330 | <term><filename class="libraryfile">libopcodes</filename></term>
|
---|
| 331 | <listitem>
|
---|
| 332 | <para>A library for dealing with opcodes—the <quote>readable
|
---|
| 333 | text</quote> versions of instructions for the processor;
|
---|
| 334 | it is used for building utilities like
|
---|
| 335 | <command>objdump</command>.</para>
|
---|
[6561a0f] | 336 | <indexterm zone="ch-cross-tools-binutils libopcodes">
|
---|
[a9e389d] | 337 | <primary sortas="c-libopcodes">libopcodes</primary>
|
---|
| 338 | </indexterm>
|
---|
| 339 | </listitem>
|
---|
| 340 | </varlistentry>
|
---|
| 341 |
|
---|
| 342 | </variablelist>
|
---|
| 343 |
|
---|
| 344 | </sect2>
|
---|
| 345 |
|
---|
| 346 | </sect1>
|
---|