binutils.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  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-fin-sbu;</seg>
  27. <seg>&binutils-fin-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-pc-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>Four tests named <quote>Run property ...</quote> are known to
  124. fail.</para>
  125. <para>Install the package:</para>
  126. <screen><userinput remap="install">make tooldir=/usr install -j1</userinput></screen>
  127. <para>Remove useless static libraries:</para>
  128. <screen><userinput remap="install">rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes}.a</userinput></screen>
  129. </sect2>
  130. <sect2 id="contents-binutils" role="content">
  131. <title>Contents of Binutils</title>
  132. <segmentedlist>
  133. <segtitle>Installed programs</segtitle>
  134. <segtitle>Installed libraries</segtitle>
  135. <segtitle>Installed directory</segtitle>
  136. <seglistitem>
  137. <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, ld, ld.bfd, ld.gold, nm,
  138. objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
  139. <seg>libbfd.so, libctf.so, libctf-nobfd.so, and libopcodes.so</seg>
  140. <seg>/usr/lib/ldscripts</seg>
  141. </seglistitem>
  142. </segmentedlist>
  143. <variablelist>
  144. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  145. <?dbfo list-presentation="list"?>
  146. <?dbhtml list-presentation="table"?>
  147. <varlistentry id="addr2line">
  148. <term><command>addr2line</command></term>
  149. <listitem>
  150. <para>Translates program addresses to file names and line numbers;
  151. given an address and the name of an executable, it uses the debugging
  152. information in the executable to determine which source file and line
  153. number are associated with the address</para>
  154. <indexterm zone="ch-system-binutils addr2line">
  155. <primary sortas="b-addr2line">addr2line</primary>
  156. </indexterm>
  157. </listitem>
  158. </varlistentry>
  159. <varlistentry id="ar">
  160. <term><command>ar</command></term>
  161. <listitem>
  162. <para>Creates, modifies, and extracts from archives</para>
  163. <indexterm zone="ch-system-binutils ar">
  164. <primary sortas="b-ar">ar</primary>
  165. </indexterm>
  166. </listitem>
  167. </varlistentry>
  168. <varlistentry id="as">
  169. <term><command>as</command></term>
  170. <listitem>
  171. <para>An assembler that assembles the output of <command>gcc</command>
  172. into object files</para>
  173. <indexterm zone="ch-system-binutils as">
  174. <primary sortas="b-as">as</primary>
  175. </indexterm>
  176. </listitem>
  177. </varlistentry>
  178. <varlistentry id="c-filt">
  179. <term><command>c++filt</command></term>
  180. <listitem>
  181. <para>Used by the linker to de-mangle C++ and Java symbols and to keep
  182. overloaded functions from clashing</para>
  183. <indexterm zone="ch-system-binutils c-filt">
  184. <primary sortas="b-c++filt">c++filt</primary>
  185. </indexterm>
  186. </listitem>
  187. </varlistentry>
  188. <varlistentry id="dwp">
  189. <term><command>dwp</command></term>
  190. <listitem>
  191. <para>The DWARF packaging utility</para>
  192. <indexterm zone="ch-system-binutils dwp">
  193. <primary sortas="dwp">dwp</primary>
  194. </indexterm>
  195. </listitem>
  196. </varlistentry>
  197. <varlistentry id="elfedit">
  198. <term><command>elfedit</command></term>
  199. <listitem>
  200. <para>Updates the ELF header of ELF files</para>
  201. <indexterm zone="ch-system-binutils elfedit">
  202. <primary sortas="b-elfedit">elfedit</primary>
  203. </indexterm>
  204. </listitem>
  205. </varlistentry>
  206. <varlistentry id="gprof">
  207. <term><command>gprof</command></term>
  208. <listitem>
  209. <para>Displays call graph profile data</para>
  210. <indexterm zone="ch-system-binutils gprof">
  211. <primary sortas="b-gprof">gprof</primary>
  212. </indexterm>
  213. </listitem>
  214. </varlistentry>
  215. <varlistentry id="ld">
  216. <term><command>ld</command></term>
  217. <listitem>
  218. <para>A linker that combines a number of object and archive files
  219. into a single file, relocating their data and tying up symbol
  220. references</para>
  221. <indexterm zone="ch-system-binutils ld">
  222. <primary sortas="b-ld">ld</primary>
  223. </indexterm>
  224. </listitem>
  225. </varlistentry>
  226. <varlistentry id="ld.gold">
  227. <term><command>ld.gold</command></term>
  228. <listitem>
  229. <para>A cut down version of ld that only supports the
  230. elf object file format</para>
  231. <indexterm zone="ch-system-binutils ld.gold">
  232. <primary sortas="b-ld.gold">ld.gold</primary>
  233. </indexterm>
  234. </listitem>
  235. </varlistentry>
  236. <varlistentry id="ld.bfd">
  237. <term><command>ld.bfd</command></term>
  238. <listitem>
  239. <para>Hard link to <command>ld</command></para>
  240. <indexterm zone="ch-system-binutils ld.bfd">
  241. <primary sortas="b-ld.bfd">ld.bfd</primary>
  242. </indexterm>
  243. </listitem>
  244. </varlistentry>
  245. <varlistentry id="nm">
  246. <term><command>nm</command></term>
  247. <listitem>
  248. <para>Lists the symbols occurring in a given object file</para>
  249. <indexterm zone="ch-system-binutils nm">
  250. <primary sortas="b-nm">nm</primary>
  251. </indexterm>
  252. </listitem>
  253. </varlistentry>
  254. <varlistentry id="objcopy">
  255. <term><command>objcopy</command></term>
  256. <listitem>
  257. <para>Translates one type of object file into another</para>
  258. <indexterm zone="ch-system-binutils objcopy">
  259. <primary sortas="b-objcopy">objcopy</primary>
  260. </indexterm>
  261. </listitem>
  262. </varlistentry>
  263. <varlistentry id="objdump">
  264. <term><command>objdump</command></term>
  265. <listitem>
  266. <para>Displays information about the given object file, with options
  267. controlling the particular information to display; the information
  268. shown is useful to programmers who are working on the compilation
  269. tools</para>
  270. <indexterm zone="ch-system-binutils objdump">
  271. <primary sortas="b-objdump">objdump</primary>
  272. </indexterm>
  273. </listitem>
  274. </varlistentry>
  275. <varlistentry id="ranlib">
  276. <term><command>ranlib</command></term>
  277. <listitem>
  278. <para>Generates an index of the contents of an archive and stores it
  279. in the archive; the index lists all of the symbols defined by archive
  280. members that are relocatable object files</para>
  281. <indexterm zone="ch-system-binutils ranlib">
  282. <primary sortas="b-ranlib">ranlib</primary>
  283. </indexterm>
  284. </listitem>
  285. </varlistentry>
  286. <varlistentry id="readelf">
  287. <term><command>readelf</command></term>
  288. <listitem>
  289. <para>Displays information about ELF type binaries</para>
  290. <indexterm zone="ch-system-binutils readelf">
  291. <primary sortas="b-readelf">readelf</primary>
  292. </indexterm>
  293. </listitem>
  294. </varlistentry>
  295. <varlistentry id="size">
  296. <term><command>size</command></term>
  297. <listitem>
  298. <para>Lists the section sizes and the total size for the given
  299. object files</para>
  300. <indexterm zone="ch-system-binutils size">
  301. <primary sortas="b-size">size</primary>
  302. </indexterm>
  303. </listitem>
  304. </varlistentry>
  305. <varlistentry id="strings">
  306. <term><command>strings</command></term>
  307. <listitem>
  308. <para>Outputs, for each given file, the sequences of printable
  309. characters that are of at least the specified length (defaulting to
  310. four); for object files, it prints, by default, only the strings from
  311. the initializing and loading sections while for other types of files, it
  312. scans the entire file</para>
  313. <indexterm zone="ch-system-binutils strings">
  314. <primary sortas="b-strings">strings</primary>
  315. </indexterm>
  316. </listitem>
  317. </varlistentry>
  318. <varlistentry id="strip">
  319. <term><command>strip</command></term>
  320. <listitem>
  321. <para>Discards symbols from object files</para>
  322. <indexterm zone="ch-system-binutils strip">
  323. <primary sortas="b-strip">strip</primary>
  324. </indexterm>
  325. </listitem>
  326. </varlistentry>
  327. <varlistentry id="libbfd">
  328. <term><filename class="libraryfile">libbfd</filename></term>
  329. <listitem>
  330. <para>The Binary File Descriptor library</para>
  331. <indexterm zone="ch-system-binutils libbfd">
  332. <primary sortas="c-libbfd">libbfd</primary>
  333. </indexterm>
  334. </listitem>
  335. </varlistentry>
  336. <varlistentry id="libctf">
  337. <term><filename class="libraryfile">libctf</filename></term>
  338. <listitem>
  339. <para>The Compat ANSI-C Type Format debugging support library</para>
  340. <indexterm zone="ch-system-binutils libctf">
  341. <primary sortas="c-libctf">libctf</primary>
  342. </indexterm>
  343. </listitem>
  344. </varlistentry>
  345. <varlistentry id="libctf-nobfd">
  346. <term><filename class="libraryfile">libctf-nobfd</filename></term>
  347. <listitem>
  348. <para>A libctf variant which does not use libbfd functionality</para>
  349. <indexterm zone="ch-system-binutils libctf-nobfd">
  350. <primary sortas="c-libctf-nobfd">libctf-nobfd</primary>
  351. </indexterm>
  352. </listitem>
  353. </varlistentry>
  354. <varlistentry id="libopcodes">
  355. <term><filename class="libraryfile">libopcodes</filename></term>
  356. <listitem>
  357. <para>A library for dealing with opcodes&mdash;the <quote>readable
  358. text</quote> versions of instructions for the processor;
  359. it is used for building utilities like
  360. <command>objdump</command></para>
  361. <indexterm zone="ch-system-binutils libopcodes">
  362. <primary sortas="c-libopcodes">libopcodes</primary>
  363. </indexterm>
  364. </listitem>
  365. </varlistentry>
  366. </variablelist>
  367. </sect2>
  368. </sect1>