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