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