r173 - in trunk/BOOK: chapter05 chapter06

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sat Feb 12 12:42:35 PST 2005


Author: manuel
Date: 2005-02-12 13:42:34 -0700 (Sat, 12 Feb 2005)
New Revision: 173

Added:
   trunk/BOOK/chapter05/binutils-cross.xml
   trunk/BOOK/chapter05/binutils.xml
   trunk/BOOK/chapter06/binutils.xml
Modified:
   trunk/BOOK/chapter05/chapter05.xml
   trunk/BOOK/chapter06/chapter06.xml
Log:
Added the Binutils pages.

Added: trunk/BOOK/chapter05/binutils-cross.xml
===================================================================
--- trunk/BOOK/chapter05/binutils-cross.xml	2005-02-12 19:47:11 UTC (rev 172)
+++ trunk/BOOK/chapter05/binutils-cross.xml	2005-02-12 20:42:34 UTC (rev 173)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+<sect1 id="ch-tools-binutils-cross" role="wrap">
+<title>Binutils-&binutils-version; Cross Linker</title>
+<?dbhtml filename="binutils-cross.html"?>
+
+<indexterm zone="ch-tools-binutils-cross">
+<primary sortas="a-Binutils">Binutils</primary>
+<secondary>tools, cross linker</secondary></indexterm>
+
+<sect2 role="package"><title/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+href="../chapter06/binutils.xml" xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
+
+<segmentedlist>
+<segtitle>&buildtime;</segtitle>
+<segtitle>&diskspace;</segtitle>
+<seglistitem><seg>?? SBU</seg><seg>?? MB</seg></seglistitem>
+</segmentedlist>
+
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+href="../chapter06/binutils.xml" xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/>
+
+</sect2>
+
+<sect2 role="installation">
+<title>Installation of Binutils</title>
+
+<para>This package is known to have issues when its default
+optimization flags (including the <parameter>-march</parameter> and
+<parameter>-mcpu</parameter> options) are changed. If any environment
+variables that override default optimizations have been defined, such
+as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
+unset them when building Binutils.</para>
+
+<para condition="uclibc">Apply the next patch to ... EDIT ME</para>
+
+<screen condition="uclibc"><userinput>patch -Np1 -i ../binutils-&binutils-version;-uClibc_conf-1.patch</userinput></screen>
+
+<para>The Binutils documentation recommends building Binutils outside of the
+source directory in a dedicated build directory:</para>
+
+<screen><userinput>mkdir ../binutils-build
+cd ../binutils-build</userinput></screen>
+
+<para>Prepare Binutils for compilation:</para>
+
+<screen><userinput>../binutils-&binutils-version;/configure --prefix=/tools \
+    --disable-shared  --disable-nls --target=${target}</userinput></screen>
+
+<para>Compile the package:</para>
+
+<screen><userinput>make</userinput></screen>
+
+<para>Install the package:</para>
+
+<screen><userinput>make install</userinput></screen>
+
+<para>Next, prepare the linker for the <quote>Adjusting</quote> phase
+later on:</para>
+
+<screen><userinput>make -C ld clean
+make -C ld LIB_PATH=/tools/lib</userinput></screen>
+
+<warning><para><emphasis>Do not</emphasis> remove the Binutils
+build and source directories yet. These will be needed again in their
+current state to get the post libc tool chain to build.</para></warning>
+
+</sect2>
+
+<sect2 role="content"><title/>
+<para>Details on this package are located in <xref
+linkend="contents-binutils" role="."/></para>
+</sect2>
+
+</sect1>
+


Property changes on: trunk/BOOK/chapter05/binutils-cross.xml
___________________________________________________________________
Name: svn:keywords
   + "Author Date Revision Id"

Added: trunk/BOOK/chapter05/binutils.xml
===================================================================
--- trunk/BOOK/chapter05/binutils.xml	2005-02-12 19:47:11 UTC (rev 172)
+++ trunk/BOOK/chapter05/binutils.xml	2005-02-12 20:42:34 UTC (rev 173)
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+<sect1 id="ch-tools-binutils" role="wrap">
+<title>Binutils-&binutils-version;</title>
+<?dbhtml filename="binutils.html"?>
+
+<indexterm zone="ch-tools-binutils">
+<primary sortas="a-Binutils">Binutils</primary>
+<secondary>tools</secondary></indexterm>
+
+<sect2 role="package"><title/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+href="../chapter06/binutils.xml" xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
+
+<segmentedlist>
+<segtitle>&buildtime;</segtitle>
+<segtitle>&diskspace;</segtitle>
+<seglistitem><seg>?? SBU</seg><seg>?? MB</seg></seglistitem>
+</segmentedlist>
+
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+href="../chapter06/binutils.xml" xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/>
+
+</sect2>
+
+<sect2 role="installation">
+<title>Installation of Binutils</title>
+
+<para>This package is known to have issues when its default
+optimization flags (including the <parameter>-march</parameter> and
+<parameter>-mcpu</parameter> options) are changed. If any environment
+variables that override default optimizations have been defined, such
+as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
+unset them when building Binutils.</para>
+
+<para condition="uclibc">Apply the next patch to ... EDIT ME</para>
+
+<screen condition="uclibc"><userinput>patch -Np1 -i ../binutils-&binutils-version;-uClibc_conf-1.patch</userinput></screen>
+
+<para>Apply a patch to add elf header markings used by PaX and Grsecurity kernels.</para>
+
+<screen><userinput>patch -Np1 -i ../binutils-&binutils-version;-pt_pax-1.patch</userinput></screen>
+
+<para>The Binutils documentation recommends building Binutils outside of the
+source directory in a dedicated build directory:</para>
+
+<screen><userinput>mkdir ../binutils-build
+cd ../binutils-build</userinput></screen>
+
+<para>Prepare Binutils for compilation:</para>
+
+<screen><userinput>env CC=${target}-gcc \
+../binutils-&binutils-version;/configure --prefix=/tools ${disable_nls} \
+    --host=${target} --build=${target} --target=${target} \
+    --enable-shared --with-lib-path=/tools/lib</userinput></screen>
+
+<para>Compile the package:</para>
+
+<screen><userinput>make</userinput></screen>
+
+<para condition="glibc">To test the results, issue: <userinput>make
+check</userinput>. There are no expected failures, except for 3 
+unresolved tests due to missing g++.</para>
+
+<para condition="uclibc">To test the results, issue: <userinput>make -k
+check</userinput>. There are 27 known failures.</para>
+
+<para>Install the package:</para>
+
+<screen><userinput>make install</userinput></screen>
+
+<para>Now prepare the linker for the <quote>Re-adjusting</quote> phase in the next
+chapter:</para>
+
+<screen><userinput>make -C ld clean
+make -C ld LIB_PATH=/usr/lib:/lib</userinput></screen>
+
+<warning><para><emphasis>Do not</emphasis> remove the Binutils source and
+build directories yet. These directories will be needed again in the next
+chapter in their current state.</para></warning>
+
+</sect2>
+
+<sect2 role="content"><title/>
+<para>Details on this package are located in <xref
+linkend="contents-binutils" role="."/></para>
+</sect2>
+
+</sect1>
+


Property changes on: trunk/BOOK/chapter05/binutils.xml
___________________________________________________________________
Name: svn:keywords
   + "Author Date Revision Id"

Modified: trunk/BOOK/chapter05/chapter05.xml
===================================================================
--- trunk/BOOK/chapter05/chapter05.xml	2005-02-12 19:47:11 UTC (rev 172)
+++ trunk/BOOK/chapter05/chapter05.xml	2005-02-12 20:42:34 UTC (rev 173)
@@ -11,16 +11,16 @@
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="linux-libc-headers.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="glibc-headers.xml"/>
-<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="uclibc-headers.xml"/><!--
-<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="binutils-cross.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="uclibc-headers.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="binutils-cross.xml"/><!--
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gcc-cross.xml"/>-->
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="glibc.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="uclibc.xml"/><!--
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="adjusting.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="tcl.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="expect.xml"/>
-<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="dejagnu.xml"/>
-<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="binutils-native.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="dejagnu.xml"/>-->
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="binutils.xml"/><!--
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gcc-native.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gawk.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="coreutils.xml"/>

Added: trunk/BOOK/chapter06/binutils.xml
===================================================================
--- trunk/BOOK/chapter06/binutils.xml	2005-02-12 19:47:11 UTC (rev 172)
+++ trunk/BOOK/chapter06/binutils.xml	2005-02-12 20:42:34 UTC (rev 173)
@@ -0,0 +1,259 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+<sect1 id="ch-system-binutils" role="wrap">
+<title>Binutils-&binutils-version;</title>
+<?dbhtml filename="binutils.html"?>
+
+<indexterm zone="ch-system-binutils">
+<primary sortas="a-Binutils">Binutils</primary>
+</indexterm>
+
+<sect2 role="package"><title/>
+<para>The Binutils package contains a linker, an assembler, and other tools for
+handling object files.</para>
+
+<segmentedlist>
+<segtitle>&buildtime;</segtitle>
+<segtitle>&diskspace;</segtitle>
+<seglistitem><seg>?? SBU</seg><seg>?? MB</seg></seglistitem>
+</segmentedlist>
+
+<segmentedlist>
+<segtitle>Binutils installation depends on</segtitle>
+<seglistitem><seg>Bash, Bison, Coreutils, Diffutils, Flex, GCC, Gettext,
+Glibc, Grep, M4, Make, Perl, Sed, and Texinfo</seg></seglistitem>
+</segmentedlist>
+
+</sect2>
+
+<sect2 role="installation">
+<title>Installation of Binutils</title>
+
+<para>This package is known to have issues when its default
+optimization flags (including the <parameter>-march</parameter> and
+<parameter>-mcpu</parameter> options) are changed. If any environment
+variables that override default optimizations have been defined, such
+as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
+unset them when building Binutils.</para>
+
+<para condition="uclibc">Apply the next patch to ... EDIT ME</para>
+
+<screen condition="uclibc"><userinput>patch -Np1 -i ../binutils-&binutils-version;-uClibc_conf-1.patch</userinput></screen>
+
+<para>Apply the next two patches to ... EDIT ME</para>
+
+<screen><userinput>patch -Np1 -i ../binutils-&binutils-version;-hardened_cflags-1.patch
+patch -Np1 -i ../binutils-&binutils-version;-pt_pax-1.patch</userinput></screen>
+
+<para>The Binutils documentation recommends building Binutils outside of the
+source directory in a dedicated build directory:</para>
+
+<screen><userinput>mkdir ../binutils-build
+cd ../binutils-build</userinput></screen>
+
+<para>Prepare Binutils for compilation:</para>
+
+<screen><userinput>../binutils-2.15.94.0.2/configure --prefix=/usr \
+    --host=${target} --build=${target} --target=${target} \
+    --enable-shared --disable-static ${disable_nls}</userinput></screen>
+
+<para>Compile the package:</para>
+
+<screen><userinput>make tooldir=/usr</userinput></screen>
+
+<para>Run the test suite if you like. The objcopy test have a bug. It is not 
+respecting a modified <envar>CC</envar>, <envar>CXX</envar>, 
+<envar>CFLAGS</envar>, or <envar>CXXFLAGS</envar> environment, 
+and so 3 tests fail due to <parameter>-fpic</parameter> and 
+<parameter>-fstack-protector</parameter>. The tests can pass if we 
+clear the specs file:</para>
+
+<screen><userinput>gcc -dumpspecs > $(gcc --print-file specs)
+perl -pi -e 's: /tools${ldso}: ${ldso}:g;' \
+    -e 's@\*startfile_prefix_spec:\n@$_/usr/lib/@g;' \
+    $(gcc --print-file specs)
+make check</userinput></screen>
+
+<para>Then restore the hardened specs with the script we made in chapter 5:</para>
+
+<screen><userinput>/tools/bin/hardened-specs.sh</userinput></screen>
+
+<para>Install the package:</para>
+
+<screen><userinput>make tooldir=/usr install
+install -m644 ../binutils-2.15.94.0.2/include/libiberty.h /usr/include</userinput></screen>
+
+<para>Remove a static lib:</para>
+
+<screen><userinput>rm /usr/lib/libiberty.a</userinput></screen>
+
+</sect2>
+
+
+<sect2 id="contents-binutils" role="content"><title>Contents of Binutils</title>
+
+<segmentedlist>
+<segtitle>Installed programs</segtitle>
+<segtitle>Installed libraries</segtitle>
+<seglistitem><seg>addr2line, ar, as, c++filt, gprof, ld, nm, objcopy, objdump, 
+ranlib, readelf, size, strings, and strip</seg>
+<seg>libbfd.[a,so], and libopcodes.[a,so]</seg></seglistitem>
+</segmentedlist>
+
+<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
+<?dbfo list-presentation="list"?>
+
+<varlistentry id="addr2line">
+<term><command>addr2line</command></term>
+<listitem>
+<para>Translates program addresses to file names and line numbers;
+given an address and the name of an executable, it uses the debugging
+information in the executable to determine which source file and line
+number are associated with the address</para>
+<indexterm zone="ch-system-binutils addr2line"><primary sortas="b-addr2line">addr2line</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="ar">
+<term><command>ar</command></term>
+<listitem>
+<para>Creates, modifies, and extracts from archives</para>
+<indexterm zone="ch-system-binutils ar"><primary sortas="b-ar">ar</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="as">
+<term><command>as</command></term>
+<listitem>
+<para>An assembler that assembles the output of <command>gcc</command>
+into object files</para>
+<indexterm zone="ch-system-binutils as"><primary sortas="b-as">as</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="c-filt">
+<term><command>c++filt</command></term>
+<listitem>
+<para>Used by the linker to de-mangle C++ and Java symbols and to keep
+overloaded functions from clashing</para>
+<indexterm zone="ch-system-binutils c-filt"><primary sortas="b-c++filt">c++filt</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="gprof">
+<term><command>gprof</command></term>
+<listitem>
+<para>Displays call graph profile data</para>
+<indexterm zone="ch-system-binutils gprof"><primary sortas="b-gprof">gprof</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="ld">
+<term><command>ld</command></term>
+<listitem>
+<para>A linker that combines a number of object and archive files into a single file, 
+relocating their data and tying up symbol references</para>
+<indexterm zone="ch-system-binutils ld"><primary sortas="b-ld">ld</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="nm">
+<term><command>nm</command></term>
+<listitem>
+<para>Lists the symbols occurring in a given object file</para>
+<indexterm zone="ch-system-binutils nm"><primary sortas="b-nm">nm</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="objcopy">
+<term><command>objcopy</command></term>
+<listitem>
+<para>Translates one type of object file into another</para>
+<indexterm zone="ch-system-binutils objcopy"><primary sortas="b-objcopy">objcopy</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="objdump">
+<term><command>objdump</command></term>
+<listitem>
+<para>Displays information about the given object file, with options
+controlling the particular information to display; the information
+shown is useful to programmers who are working on the compilation
+tools</para>
+<indexterm zone="ch-system-binutils objdump"><primary sortas="b-objdump">objdump</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="ranlib">
+<term><command>ranlib</command></term>
+<listitem>
+<para>Generates an index of the contents of an archive and stores it
+in the archive; the index lists all of the symbols defined by archive
+members that are relocatable object files</para>
+<indexterm zone="ch-system-binutils ranlib"><primary sortas="b-ranlib">ranlib</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="readelf">
+<term><command>readelf</command></term>
+<listitem>
+<para>Displays information about ELF type binaries</para>
+<indexterm zone="ch-system-binutils readelf"><primary sortas="b-readelf">readelf</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="size">
+<term><command>size</command></term>
+<listitem>
+<para>Lists the section sizes and the total size for the given object files</para>
+<indexterm zone="ch-system-binutils size"><primary sortas="b-size">size</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="strings">
+<term><command>strings</command></term>
+<listitem>
+<para>Outputs, for each given file, the sequences of printable
+characters that are of at least the specified length (defaulting to
+four); for object files, it prints, by default, only the strings from
+the initializing and loading sections while for other types of files, it
+scans the entire file</para>
+<indexterm zone="ch-system-binutils strings"><primary sortas="b-strings">strings</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="strip">
+<term><command>strip</command></term>
+<listitem>
+<para>Discards symbols from object files</para>
+<indexterm zone="ch-system-binutils strip"><primary sortas="b-strip">strip</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libbfd">
+<term><filename class="libraryfile">libbfd</filename></term>
+<listitem>
+<para>The Binary File Descriptor library</para>
+<indexterm zone="ch-system-binutils libbfd"><primary sortas="c-libbfd">libbfd</primary></indexterm>
+</listitem>
+</varlistentry>
+
+<varlistentry id="libopcodes">
+<term><filename class="libraryfile">libopcodes</filename></term>
+<listitem>
+<para>A library for dealing with opcodes—the <quote>readable
+text</quote> versions of instructions for the processor;
+it is used for building utilities like
+<command>objdump</command>.</para>
+<indexterm zone="ch-system-binutils libopcodes"><primary sortas="c-libopcodes">libopcodes</primary></indexterm>
+</listitem>
+</varlistentry>
+</variablelist>
+
+</sect2>
+
+</sect1>
+


Property changes on: trunk/BOOK/chapter06/binutils.xml
___________________________________________________________________
Name: svn:keywords
   + "Author Date Revision Id"

Modified: trunk/BOOK/chapter06/chapter06.xml
===================================================================
--- trunk/BOOK/chapter06/chapter06.xml	2005-02-12 19:47:11 UTC (rev 172)
+++ trunk/BOOK/chapter06/chapter06.xml	2005-02-12 20:42:34 UTC (rev 173)
@@ -21,8 +21,8 @@
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="man-pages.xml"/>-->
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="glibc.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="uclibc.xml"/><!--
-<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="readjusting.xml"/>
-<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="binutils.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="readjusting.xml"/>-->
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="binutils.xml"/><!--
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gcc.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="coreutils.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="zlib.xml"/>




More information about the hlfs-dev mailing list