binutils.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="ch-system-binutils" role="wrap">
  8. <?dbhtml filename="binutils.html"?>
  9. <sect1info condition="script">
  10. <productname>binutils</productname>
  11. <productnumber>&binutils-version;</productnumber>
  12. <address>&binutils-url;</address>
  13. </sect1info>
  14. <title>Binutils-&binutils-version;</title>
  15. <indexterm zone="ch-system-binutils">
  16. <primary sortas="a-Binutils">Binutils</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>The Binutils package contains a linker, an assembler, and other
  21. tools for handling object files.</para>
  22. <segmentedlist>
  23. <segtitle>&buildtime;</segtitle>
  24. <segtitle>&diskspace;</segtitle>
  25. <seglistitem>
  26. <seg>&binutils-ch6-sbu;</seg>
  27. <seg>&binutils-ch6-du;</seg>
  28. </seglistitem>
  29. </segmentedlist>
  30. </sect2>
  31. <sect2 role="installation">
  32. <title>Installation of Binutils</title>
  33. <para>Verify that the PTYs are working properly inside the chroot
  34. environment by performing a simple test:</para>
  35. <screen><userinput remap="test">expect -c "spawn ls"</userinput></screen>
  36. <para>This command should output the following:</para>
  37. <screen><computeroutput>spawn ls</computeroutput></screen>
  38. <para>If, instead, the output includes the message below, then the environment
  39. is not set up for proper PTY operation. This issue needs to be resolved before
  40. running the test suites for Binutils and GCC:</para>
  41. <screen><computeroutput>The system has no more ptys.
  42. Ask your system administrator to create more.</computeroutput></screen>
  43. <para>Now remove one test that prevents the tests from running
  44. to completion:</para>
  45. <screen><userinput remap="pre">sed -i '/@\tincremental_copy/d' gold/testsuite/Makefile.in</userinput></screen>
  46. <para>The Binutils documentation recommends building Binutils
  47. in a dedicated build directory:</para>
  48. <screen><userinput remap="pre">mkdir -v build
  49. cd build</userinput></screen>
  50. <para>Prepare Binutils for compilation:</para>
  51. <screen><userinput remap="configure">../configure --prefix=/usr \
  52. --enable-gold \
  53. --enable-ld=default \
  54. --enable-plugins \
  55. --enable-shared \
  56. --disable-werror \
  57. --enable-64-bit-bfd \
  58. --with-system-zlib</userinput></screen>
  59. <variablelist>
  60. <title>The meaning of the configure parameters:</title>
  61. <varlistentry>
  62. <term><parameter>--enable-gold</parameter></term>
  63. <listitem>
  64. <para>Build the gold linker and install it as ld.gold (along side the
  65. default linker).</para>
  66. </listitem>
  67. </varlistentry>
  68. <varlistentry>
  69. <term><parameter>--enable-ld=default</parameter></term>
  70. <listitem>
  71. <para>Build the original bfd linker and install it as both ld (the
  72. default linker) and ld.bfd.</para>
  73. </listitem>
  74. </varlistentry>
  75. <varlistentry>
  76. <term><parameter>--enable-plugins</parameter></term>
  77. <listitem>
  78. <para>Enables plugin support for the linker.</para>
  79. </listitem>
  80. </varlistentry>
  81. <varlistentry>
  82. <term><parameter>--enable-64-bit-bfd</parameter></term>
  83. <listitem>
  84. <para>Enables 64-bit support (on hosts with narrower word sizes).
  85. May not be needed on 64-bit systems, but does no harm.</para>
  86. </listitem>
  87. </varlistentry>
  88. <varlistentry>
  89. <term><parameter>--with-system-zlib</parameter></term>
  90. <listitem>
  91. <para>Use the installed zlib library rather than building the
  92. included version.</para>
  93. </listitem>
  94. </varlistentry>
  95. </variablelist>
  96. <para>Compile the package:</para>
  97. <screen><userinput remap="make">make tooldir=/usr</userinput></screen>
  98. <variablelist>
  99. <title>The meaning of the make parameter:</title>
  100. <varlistentry>
  101. <term><parameter>tooldir=/usr</parameter></term>
  102. <listitem>
  103. <para>Normally, the tooldir (the directory where the executables will
  104. ultimately be located) is set to <filename
  105. class="directory">$(exec_prefix)/$(target_alias)</filename>. For
  106. example, x86_64 machines would expand that to <filename
  107. class="directory">/usr/x86_64-unknown-linux-gnu</filename>. Because this is
  108. a custom system, this target-specific directory in <filename
  109. class="directory">/usr</filename> is not required. <filename
  110. class="directory">$(exec_prefix)/$(target_alias)</filename> would be
  111. used if the system was used to cross-compile (for example, compiling a
  112. package on an Intel machine that generates code that can be executed
  113. on PowerPC machines).</para>
  114. </listitem>
  115. </varlistentry>
  116. </variablelist>
  117. <important>
  118. <para>The test suite for Binutils in this section is considered critical.
  119. Do not skip it under any circumstances.</para>
  120. </important>
  121. <para>Test the results:</para>
  122. <screen><userinput remap="test">make -k check</userinput></screen>
  123. <para>The ver_test_pr16504.sh test is known to fail.</para>
  124. <para>Install the package:</para>
  125. <screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
  126. </sect2>
  127. <sect2 id="contents-binutils" role="content">
  128. <title>Contents of Binutils</title>
  129. <segmentedlist>
  130. <segtitle>Installed programs</segtitle>
  131. <segtitle>Installed libraries</segtitle>
  132. <segtitle>Installed directory</segtitle>
  133. <seglistitem>
  134. <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, ld, ld.bfd, ld.gold, nm,
  135. objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
  136. <seg>libbfd.{a,so} and libopcodes.{a,so}</seg>
  137. <seg>/usr/lib/ldscripts</seg>
  138. </seglistitem>
  139. </segmentedlist>
  140. <variablelist>
  141. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  142. <?dbfo list-presentation="list"?>
  143. <?dbhtml list-presentation="table"?>
  144. <varlistentry id="addr2line">
  145. <term><command>addr2line</command></term>
  146. <listitem>
  147. <para>Translates program addresses to file names and line numbers;
  148. given an address and the name of an executable, it uses the debugging
  149. information in the executable to determine which source file and line
  150. number are associated with the address</para>
  151. <indexterm zone="ch-system-binutils addr2line">
  152. <primary sortas="b-addr2line">addr2line</primary>
  153. </indexterm>
  154. </listitem>
  155. </varlistentry>
  156. <varlistentry id="ar">
  157. <term><command>ar</command></term>
  158. <listitem>
  159. <para>Creates, modifies, and extracts from archives</para>
  160. <indexterm zone="ch-system-binutils ar">
  161. <primary sortas="b-ar">ar</primary>
  162. </indexterm>
  163. </listitem>
  164. </varlistentry>
  165. <varlistentry id="as">
  166. <term><command>as</command></term>
  167. <listitem>
  168. <para>An assembler that assembles the output of <command>gcc</command>
  169. into object files</para>
  170. <indexterm zone="ch-system-binutils as">
  171. <primary sortas="b-as">as</primary>
  172. </indexterm>
  173. </listitem>
  174. </varlistentry>
  175. <varlistentry id="c-filt">
  176. <term><command>c++filt</command></term>
  177. <listitem>
  178. <para>Used by the linker to de-mangle C++ and Java symbols and to keep
  179. overloaded functions from clashing</para>
  180. <indexterm zone="ch-system-binutils c-filt">
  181. <primary sortas="b-c++filt">c++filt</primary>
  182. </indexterm>
  183. </listitem>
  184. </varlistentry>
  185. <varlistentry id="dwp">
  186. <term><command>dwp</command></term>
  187. <listitem>
  188. <para>The DWARF packaging utility</para>
  189. <indexterm zone="ch-system-binutils dwp">
  190. <primary sortas="dwp">dwp</primary>
  191. </indexterm>
  192. </listitem>
  193. </varlistentry>
  194. <varlistentry id="elfedit">
  195. <term><command>elfedit</command></term>
  196. <listitem>
  197. <para>Updates the ELF header of ELF files</para>
  198. <indexterm zone="ch-system-binutils elfedit">
  199. <primary sortas="b-elfedit">elfedit</primary>
  200. </indexterm>
  201. </listitem>
  202. </varlistentry>
  203. <varlistentry id="gprof">
  204. <term><command>gprof</command></term>
  205. <listitem>
  206. <para>Displays call graph profile data</para>
  207. <indexterm zone="ch-system-binutils gprof">
  208. <primary sortas="b-gprof">gprof</primary>
  209. </indexterm>
  210. </listitem>
  211. </varlistentry>
  212. <varlistentry id="ld">
  213. <term><command>ld</command></term>
  214. <listitem>
  215. <para>A linker that combines a number of object and archive files
  216. into a single file, relocating their data and tying up symbol
  217. references</para>
  218. <indexterm zone="ch-system-binutils ld">
  219. <primary sortas="b-ld">ld</primary>
  220. </indexterm>
  221. </listitem>
  222. </varlistentry>
  223. <varlistentry id="ld.gold">
  224. <term><command>ld.gold</command></term>
  225. <listitem>
  226. <para>A cut down version of ld that only supports the
  227. elf object file format</para>
  228. <indexterm zone="ch-system-binutils ld.gold">
  229. <primary sortas="b-ld.gold">ld.gold</primary>
  230. </indexterm>
  231. </listitem>
  232. </varlistentry>
  233. <varlistentry id="ld.bfd">
  234. <term><command>ld.bfd</command></term>
  235. <listitem>
  236. <para>Hard link to <command>ld</command></para>
  237. <indexterm zone="ch-system-binutils ld.bfd">
  238. <primary sortas="b-ld.bfd">ld.bfd</primary>
  239. </indexterm>
  240. </listitem>
  241. </varlistentry>
  242. <varlistentry id="nm">
  243. <term><command>nm</command></term>
  244. <listitem>
  245. <para>Lists the symbols occurring in a given object file</para>
  246. <indexterm zone="ch-system-binutils nm">
  247. <primary sortas="b-nm">nm</primary>
  248. </indexterm>
  249. </listitem>
  250. </varlistentry>
  251. <varlistentry id="objcopy">
  252. <term><command>objcopy</command></term>
  253. <listitem>
  254. <para>Translates one type of object file into another</para>
  255. <indexterm zone="ch-system-binutils objcopy">
  256. <primary sortas="b-objcopy">objcopy</primary>
  257. </indexterm>
  258. </listitem>
  259. </varlistentry>
  260. <varlistentry id="objdump">
  261. <term><command>objdump</command></term>
  262. <listitem>
  263. <para>Displays information about the given object file, with options
  264. controlling the particular information to display; the information
  265. shown is useful to programmers who are working on the compilation
  266. tools</para>
  267. <indexterm zone="ch-system-binutils objdump">
  268. <primary sortas="b-objdump">objdump</primary>
  269. </indexterm>
  270. </listitem>
  271. </varlistentry>
  272. <varlistentry id="ranlib">
  273. <term><command>ranlib</command></term>
  274. <listitem>
  275. <para>Generates an index of the contents of an archive and stores it
  276. in the archive; the index lists all of the symbols defined by archive
  277. members that are relocatable object files</para>
  278. <indexterm zone="ch-system-binutils ranlib">
  279. <primary sortas="b-ranlib">ranlib</primary>
  280. </indexterm>
  281. </listitem>
  282. </varlistentry>
  283. <varlistentry id="readelf">
  284. <term><command>readelf</command></term>
  285. <listitem>
  286. <para>Displays information about ELF type binaries</para>
  287. <indexterm zone="ch-system-binutils readelf">
  288. <primary sortas="b-readelf">readelf</primary>
  289. </indexterm>
  290. </listitem>
  291. </varlistentry>
  292. <varlistentry id="size">
  293. <term><command>size</command></term>
  294. <listitem>
  295. <para>Lists the section sizes and the total size for the given
  296. object files</para>
  297. <indexterm zone="ch-system-binutils size">
  298. <primary sortas="b-size">size</primary>
  299. </indexterm>
  300. </listitem>
  301. </varlistentry>
  302. <varlistentry id="strings">
  303. <term><command>strings</command></term>
  304. <listitem>
  305. <para>Outputs, for each given file, the sequences of printable
  306. characters that are of at least the specified length (defaulting to
  307. four); for object files, it prints, by default, only the strings from
  308. the initializing and loading sections while for other types of files, it
  309. scans the entire file</para>
  310. <indexterm zone="ch-system-binutils strings">
  311. <primary sortas="b-strings">strings</primary>
  312. </indexterm>
  313. </listitem>
  314. </varlistentry>
  315. <varlistentry id="strip">
  316. <term><command>strip</command></term>
  317. <listitem>
  318. <para>Discards symbols from object files</para>
  319. <indexterm zone="ch-system-binutils strip">
  320. <primary sortas="b-strip">strip</primary>
  321. </indexterm>
  322. </listitem>
  323. </varlistentry>
  324. <varlistentry id="libbfd">
  325. <term><filename class="libraryfile">libbfd</filename></term>
  326. <listitem>
  327. <para>The Binary File Descriptor library</para>
  328. <indexterm zone="ch-system-binutils libbfd">
  329. <primary sortas="c-libbfd">libbfd</primary>
  330. </indexterm>
  331. </listitem>
  332. </varlistentry>
  333. <varlistentry id="libctf">
  334. <term><filename class="libraryfile">libctf</filename></term>
  335. <listitem>
  336. <para>The Compat ANSI-C Type Format debugging support library</para>
  337. <indexterm zone="ch-system-binutils libctf">
  338. <primary sortas="c-libctf">libctf</primary>
  339. </indexterm>
  340. </listitem>
  341. </varlistentry>
  342. <varlistentry id="libctf-nobfd">
  343. <term><filename class="libraryfile">libctf-nobfd</filename></term>
  344. <listitem>
  345. <para>A libctf variant which does not use libbfd functionality</para>
  346. <indexterm zone="ch-system-binutils libctf-nobfd">
  347. <primary sortas="c-libctf-nobfd">libctf-nobfd</primary>
  348. </indexterm>
  349. </listitem>
  350. </varlistentry>
  351. <varlistentry id="libopcodes">
  352. <term><filename class="libraryfile">libopcodes</filename></term>
  353. <listitem>
  354. <para>A library for dealing with opcodes&mdash;the <quote>readable
  355. text</quote> versions of instructions for the processor;
  356. it is used for building utilities like
  357. <command>objdump</command></para>
  358. <indexterm zone="ch-system-binutils libopcodes">
  359. <primary sortas="c-libopcodes">libopcodes</primary>
  360. </indexterm>
  361. </listitem>
  362. </varlistentry>
  363. </variablelist>
  364. </sect2>
  365. </sect1>