| 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-system-binutils" role="wrap"> |
|---|
| 9 | <?dbhtml filename="binutils.html"?> |
|---|
| 10 | |
|---|
| 11 | <title>Binutils-&binutils-version;</title> |
|---|
| 12 | |
|---|
| 13 | <indexterm zone="ch-system-binutils"> |
|---|
| 14 | <primary sortas="a-Binutils">Binutils</primary> |
|---|
| 15 | </indexterm> |
|---|
| 16 | |
|---|
| 17 | <sect2 role="package"> |
|---|
| 18 | <title/> |
|---|
| 19 | |
|---|
| 20 | <para>The Binutils package contains a linker, an assembler, and other |
|---|
| 21 | tools for handling object files.</para> |
|---|
| 22 | |
|---|
| 23 | <segmentedlist> |
|---|
| 24 | <segtitle>&dependencies;</segtitle> |
|---|
| 25 | |
|---|
| 26 | <seglistitem> |
|---|
| 27 | <seg>Bash, Binutils, Coreutils, Diffutils, Expect, GCC, Gettext, |
|---|
| 28 | Glibc, Grep, Make, Patch, Perl, Sed, Tcl, and Texinfo</seg> |
|---|
| 29 | </seglistitem> |
|---|
| 30 | </segmentedlist> |
|---|
| 31 | |
|---|
| 32 | </sect2> |
|---|
| 33 | |
|---|
| 34 | <sect2 role="installation"> |
|---|
| 35 | <title>Installation of Binutils</title> |
|---|
| 36 | |
|---|
| 37 | <para os="b">Verify that the PTYs are working properly inside the build |
|---|
| 38 | environment. Check that everything is set up correctly by performing a |
|---|
| 39 | simple test:</para> |
|---|
| 40 | |
|---|
| 41 | <screen os="c" role="nodump"><userinput>expect -c "spawn ls"</userinput></screen> |
|---|
| 42 | |
|---|
| 43 | <para os="d">If the following message shows up, the environment is not |
|---|
| 44 | set up for proper PTY operation:</para> |
|---|
| 45 | |
|---|
| 46 | <screen os="e"><computeroutput>The system has no more ptys. |
|---|
| 47 | Ask your system administrator to create more.</computeroutput></screen> |
|---|
| 48 | |
|---|
| 49 | <para os="f">This issue needs to be resolved before running the test suites |
|---|
| 50 | for Binutils and GCC.</para> |
|---|
| 51 | |
|---|
| 52 | <para os="g">The Binutils documentation recommends building Binutils outside of the |
|---|
| 53 | source directory in a dedicated build directory:</para> |
|---|
| 54 | |
|---|
| 55 | <screen os="h"><userinput>mkdir -v ../binutils-build |
|---|
| 56 | cd ../binutils-build</userinput></screen> |
|---|
| 57 | |
|---|
| 58 | <para os="i">Prepare Binutils for compilation:</para> |
|---|
| 59 | |
|---|
| 60 | <screen os="ca"><userinput>../binutils-&binutils-version;/configure --prefix=/usr \ |
|---|
| 61 | --enable-shared</userinput></screen> |
|---|
| 62 | |
|---|
| 63 | <para os="j">Compile the package:</para> |
|---|
| 64 | |
|---|
| 65 | <screen os="k"><userinput>make configure-host</userinput></screen> |
|---|
| 66 | |
|---|
| 67 | <important os="l"> |
|---|
| 68 | <para>During <command>make configure-host</command> you may receive the |
|---|
| 69 | following error message. It is safe to ignore.</para> |
|---|
| 70 | |
|---|
| 71 | <screen><computeroutput>WARNING: `flex' is missing on your system. You should only |
|---|
| 72 | need it if you modified a `.l' file. You may need the `Flex' |
|---|
| 73 | package in order for those modifications to take effect. You |
|---|
| 74 | can get `Flex' from any GNU archive site.</computeroutput></screen> |
|---|
| 75 | </important> |
|---|
| 76 | |
|---|
| 77 | <screen os="m"><userinput>make tooldir=/usr</userinput></screen> |
|---|
| 78 | |
|---|
| 79 | <variablelist os="n"> |
|---|
| 80 | <title>The meaning of the make parameter:</title> |
|---|
| 81 | |
|---|
| 82 | <varlistentry> |
|---|
| 83 | <term><parameter>tooldir=/usr</parameter></term> |
|---|
| 84 | <listitem> |
|---|
| 85 | <para>Normally, the tooldir (the directory where the executables |
|---|
| 86 | will ultimately be located) is set to <filename |
|---|
| 87 | class="directory">$(exec_prefix)/$(target_alias)</filename>. Because this |
|---|
| 88 | is a custom system, this target-specific directory in <filename |
|---|
| 89 | class="directory">/usr</filename> is not required.</para> |
|---|
| 90 | </listitem> |
|---|
| 91 | </varlistentry> |
|---|
| 92 | </variablelist> |
|---|
| 93 | |
|---|
| 94 | <important os="o"> |
|---|
| 95 | <para>The test suite for Binutils in this section is considered critical. |
|---|
| 96 | Do not skip it under any circumstances.</para> |
|---|
| 97 | </important> |
|---|
| 98 | |
|---|
| 99 | <para os="p">Test the results:</para> |
|---|
| 100 | |
|---|
| 101 | <screen os="q"><userinput>make check</userinput></screen> |
|---|
| 102 | |
|---|
| 103 | <para os="r">Install the package:</para> |
|---|
| 104 | |
|---|
| 105 | <screen os="s"><userinput>make tooldir=/usr install</userinput></screen> |
|---|
| 106 | |
|---|
| 107 | <para os="t">Install the <filename class="headerfile">libiberty</filename> header |
|---|
| 108 | file that is needed by some packages:</para> |
|---|
| 109 | |
|---|
| 110 | <screen os="u"><userinput>cp -v ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen> |
|---|
| 111 | |
|---|
| 112 | </sect2> |
|---|
| 113 | |
|---|
| 114 | <sect2 id="contents-binutils" role="content"> |
|---|
| 115 | <title>Contents of Binutils</title> |
|---|
| 116 | |
|---|
| 117 | <segmentedlist> |
|---|
| 118 | <segtitle>Installed programs</segtitle> |
|---|
| 119 | <segtitle>Installed libraries</segtitle> |
|---|
| 120 | |
|---|
| 121 | <seglistitem> |
|---|
| 122 | <seg>addr2line, ar, as, c++filt, gprof, ld, nm, objcopy, objdump, |
|---|
| 123 | ranlib, readelf, size, strings, and strip</seg> |
|---|
| 124 | <seg>libiberty.a, libbfd.[a,so], and libopcodes.[a,so]</seg> |
|---|
| 125 | </seglistitem> |
|---|
| 126 | </segmentedlist> |
|---|
| 127 | |
|---|
| 128 | <variablelist> |
|---|
| 129 | <bridgehead renderas="sect3">Short Descriptions</bridgehead> |
|---|
| 130 | <?dbfo list-presentation="list"?> |
|---|
| 131 | <?dbhtml list-presentation="table"?> |
|---|
| 132 | |
|---|
| 133 | <varlistentry id="addr2line"> |
|---|
| 134 | <term><command>addr2line</command></term> |
|---|
| 135 | <listitem> |
|---|
| 136 | <para>Translates program addresses to file names and line numbers; |
|---|
| 137 | given an address and the name of an executable, it uses the debugging |
|---|
| 138 | information in the executable to determine which source file and line |
|---|
| 139 | number are associated with the address</para> |
|---|
| 140 | <indexterm zone="ch-system-binutils addr2line"> |
|---|
| 141 | <primary sortas="b-addr2line">addr2line</primary> |
|---|
| 142 | </indexterm> |
|---|
| 143 | </listitem> |
|---|
| 144 | </varlistentry> |
|---|
| 145 | |
|---|
| 146 | <varlistentry id="ar"> |
|---|
| 147 | <term><command>ar</command></term> |
|---|
| 148 | <listitem> |
|---|
| 149 | <para>Creates, modifies, and extracts from archives</para> |
|---|
| 150 | <indexterm zone="ch-system-binutils ar"> |
|---|
| 151 | <primary sortas="b-ar">ar</primary> |
|---|
| 152 | </indexterm> |
|---|
| 153 | </listitem> |
|---|
| 154 | </varlistentry> |
|---|
| 155 | |
|---|
| 156 | <varlistentry id="as"> |
|---|
| 157 | <term><command>as</command></term> |
|---|
| 158 | <listitem> |
|---|
| 159 | <para>An assembler that assembles the output of <command>gcc</command> |
|---|
| 160 | into object files</para> |
|---|
| 161 | <indexterm zone="ch-system-binutils as"> |
|---|
| 162 | <primary sortas="b-as">as</primary> |
|---|
| 163 | </indexterm> |
|---|
| 164 | </listitem> |
|---|
| 165 | </varlistentry> |
|---|
| 166 | |
|---|
| 167 | <varlistentry id="c-filt"> |
|---|
| 168 | <term><command>c++filt</command></term> |
|---|
| 169 | <listitem> |
|---|
| 170 | <para>Used by the linker to de-mangle C++ and Java symbols and to keep |
|---|
| 171 | overloaded functions from clashing</para> |
|---|
| 172 | <indexterm zone="ch-system-binutils c-filt"> |
|---|
| 173 | <primary sortas="b-c++filt">c++filt</primary> |
|---|
| 174 | </indexterm> |
|---|
| 175 | </listitem> |
|---|
| 176 | </varlistentry> |
|---|
| 177 | |
|---|
| 178 | <varlistentry id="gprof"> |
|---|
| 179 | <term><command>gprof</command></term> |
|---|
| 180 | <listitem> |
|---|
| 181 | <para>Displays call graph profile data</para> |
|---|
| 182 | <indexterm zone="ch-system-binutils gprof"> |
|---|
| 183 | <primary sortas="b-gprof">gprof</primary> |
|---|
| 184 | </indexterm> |
|---|
| 185 | </listitem> |
|---|
| 186 | </varlistentry> |
|---|
| 187 | |
|---|
| 188 | <varlistentry id="ld"> |
|---|
| 189 | <term><command>ld</command></term> |
|---|
| 190 | <listitem> |
|---|
| 191 | <para>A linker that combines a number of object and archive files |
|---|
| 192 | into a single file, relocating their data and tying up symbol |
|---|
| 193 | references</para> |
|---|
| 194 | <indexterm zone="ch-system-binutils ld"> |
|---|
| 195 | <primary sortas="b-ld">ld</primary> |
|---|
| 196 | </indexterm> |
|---|
| 197 | </listitem> |
|---|
| 198 | </varlistentry> |
|---|
| 199 | |
|---|
| 200 | <varlistentry id="nm"> |
|---|
| 201 | <term><command>nm</command></term> |
|---|
| 202 | <listitem> |
|---|
| 203 | <para>Lists the symbols occurring in a given object file</para> |
|---|
| 204 | <indexterm zone="ch-system-binutils nm"> |
|---|
| 205 | <primary sortas="b-nm">nm</primary> |
|---|
| 206 | </indexterm> |
|---|
| 207 | </listitem> |
|---|
| 208 | </varlistentry> |
|---|
| 209 | |
|---|
| 210 | <varlistentry id="objcopy"> |
|---|
| 211 | <term><command>objcopy</command></term> |
|---|
| 212 | <listitem> |
|---|
| 213 | <para>Translates one type of object file into another</para> |
|---|
| 214 | <indexterm zone="ch-system-binutils objcopy"> |
|---|
| 215 | <primary sortas="b-objcopy">objcopy</primary> |
|---|
| 216 | </indexterm> |
|---|
| 217 | </listitem> |
|---|
| 218 | </varlistentry> |
|---|
| 219 | |
|---|
| 220 | <varlistentry id="objdump"> |
|---|
| 221 | <term><command>objdump</command></term> |
|---|
| 222 | <listitem> |
|---|
| 223 | <para>Displays information about the given object file, with options |
|---|
| 224 | controlling the particular information to display; the information |
|---|
| 225 | shown is useful to programmers who are working on the compilation |
|---|
| 226 | tools</para> |
|---|
| 227 | <indexterm zone="ch-system-binutils objdump"> |
|---|
| 228 | <primary sortas="b-objdump">objdump</primary> |
|---|
| 229 | </indexterm> |
|---|
| 230 | </listitem> |
|---|
| 231 | </varlistentry> |
|---|
| 232 | |
|---|
| 233 | <varlistentry id="ranlib"> |
|---|
| 234 | <term><command>ranlib</command></term> |
|---|
| 235 | <listitem> |
|---|
| 236 | <para>Generates an index of the contents of an archive and stores it |
|---|
| 237 | in the archive; the index lists all of the symbols defined by archive |
|---|
| 238 | members that are relocatable object files</para> |
|---|
| 239 | <indexterm zone="ch-system-binutils ranlib"> |
|---|
| 240 | <primary sortas="b-ranlib">ranlib</primary> |
|---|
| 241 | </indexterm> |
|---|
| 242 | </listitem> |
|---|
| 243 | </varlistentry> |
|---|
| 244 | |
|---|
| 245 | <varlistentry id="readelf"> |
|---|
| 246 | <term><command>readelf</command></term> |
|---|
| 247 | <listitem> |
|---|
| 248 | <para>Displays information about ELF type binaries</para> |
|---|
| 249 | <indexterm zone="ch-system-binutils readelf"> |
|---|
| 250 | <primary sortas="b-readelf">readelf</primary> |
|---|
| 251 | </indexterm> |
|---|
| 252 | </listitem> |
|---|
| 253 | </varlistentry> |
|---|
| 254 | |
|---|
| 255 | <varlistentry id="size"> |
|---|
| 256 | <term><command>size</command></term> |
|---|
| 257 | <listitem> |
|---|
| 258 | <para>Lists the section sizes and the total size for the given |
|---|
| 259 | object files</para> |
|---|
| 260 | <indexterm zone="ch-system-binutils size"> |
|---|
| 261 | <primary sortas="b-size">size</primary> |
|---|
| 262 | </indexterm> |
|---|
| 263 | </listitem> |
|---|
| 264 | </varlistentry> |
|---|
| 265 | |
|---|
| 266 | <varlistentry id="strings"> |
|---|
| 267 | <term><command>strings</command></term> |
|---|
| 268 | <listitem> |
|---|
| 269 | <para>Outputs, for each given file, the sequences of printable |
|---|
| 270 | characters that are of at least the specified length (defaulting to |
|---|
| 271 | four); for object files, it prints, by default, only the strings from |
|---|
| 272 | the initializing and loading sections while for other types of files, |
|---|
| 273 | it scans the entire file</para> |
|---|
| 274 | <indexterm zone="ch-system-binutils strings"> |
|---|
| 275 | <primary sortas="b-strings">strings</primary> |
|---|
| 276 | </indexterm> |
|---|
| 277 | </listitem> |
|---|
| 278 | </varlistentry> |
|---|
| 279 | |
|---|
| 280 | <varlistentry id="strip"> |
|---|
| 281 | <term><command>strip</command></term> |
|---|
| 282 | <listitem> |
|---|
| 283 | <para>Discards symbols from object files</para> |
|---|
| 284 | <indexterm zone="ch-system-binutils strip"> |
|---|
| 285 | <primary sortas="b-strip">strip</primary> |
|---|
| 286 | </indexterm> |
|---|
| 287 | </listitem> |
|---|
| 288 | </varlistentry> |
|---|
| 289 | |
|---|
| 290 | <varlistentry id="libiberty"> |
|---|
| 291 | <term><filename class="libraryfile">libiberty</filename></term> |
|---|
| 292 | <listitem> |
|---|
| 293 | <para>Contains routines used by various GNU programs, including |
|---|
| 294 | <command>getopt</command>, <command>obstack</command>, |
|---|
| 295 | <command>strerror</command>, <command>strtol</command>, and |
|---|
| 296 | <command>strtoul</command></para> |
|---|
| 297 | <indexterm zone="ch-system-binutils libiberty"> |
|---|
| 298 | <primary sortas="c-libiberty">libiberty</primary> |
|---|
| 299 | </indexterm> |
|---|
| 300 | </listitem> |
|---|
| 301 | </varlistentry> |
|---|
| 302 | |
|---|
| 303 | <varlistentry id="libbfd"> |
|---|
| 304 | <term><filename class="libraryfile">libbfd</filename></term> |
|---|
| 305 | <listitem> |
|---|
| 306 | <para>The Binary File Descriptor library</para> |
|---|
| 307 | <indexterm zone="ch-system-binutils libbfd"> |
|---|
| 308 | <primary sortas="c-libbfd">libbfd</primary> |
|---|
| 309 | </indexterm> |
|---|
| 310 | </listitem> |
|---|
| 311 | </varlistentry> |
|---|
| 312 | |
|---|
| 313 | <varlistentry id="libopcodes"> |
|---|
| 314 | <term><filename class="libraryfile">libopcodes</filename></term> |
|---|
| 315 | <listitem> |
|---|
| 316 | <para>A library for dealing with opcodes—the <quote>readable |
|---|
| 317 | text</quote> versions of instructions for the processor; |
|---|
| 318 | it is used for building utilities like |
|---|
| 319 | <command>objdump</command>.</para> |
|---|
| 320 | <indexterm zone="ch-system-binutils libopcodes"> |
|---|
| 321 | <primary sortas="c-libopcodes">libopcodes</primary> |
|---|
| 322 | </indexterm> |
|---|
| 323 | </listitem> |
|---|
| 324 | </varlistentry> |
|---|
| 325 | |
|---|
| 326 | </variablelist> |
|---|
| 327 | |
|---|
| 328 | </sect2> |
|---|
| 329 | |
|---|
| 330 | </sect1> |
|---|