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