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