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