Updated, put into this mail directly as it appears you cannot download the original text file from the archives.
Also find attached compiler test output for the /tools native compiler

#==============================================================================
# Sysroot based SANE multilib cross-compiler build for LFS style builds
# Ryan Oliver - 20081219
#==============================================================================
# Yes, toolchain is basically cross-lfs minus the cross-gcc-final, and we
# are natively building the target-native toolchain (after booting
# an appropriate x86_64 kernel) as opposed to performing
# the canadian cross in cross-lfs.
#
# Added --with-sysroot option so we can use native specs/config options
# when cross-compiling (cross toolchain looks under $LFS/tools as opposed to
# just /tools for headers and libs after standard toolchain mods)
#
# This frees us from being tied to STARTFILE_PREFIX_SPEC as the sole
# available mechanism for adjusting startfile search path when cross.
#
# We now adjust STANDARD_STARTFILE_PREFIX_{1,2}
# directly in the driver to set the standard library/startfile search path.
#
# These do not show up in specs, so specs appear
# exactly as intended by gcc (well, apart from our dynamic linker mod)
#------------------------------------------------------------------------------
# Also, this build here is using a combined gcc + binutils tree.
# Will provide another doc for a standard build (basically use cross-lfs and
# perform the relevant gcc/binutils mods described in this doc)
#------------------------------------------------------------------------------


# OK, for me BUILD_HOST today is i686-pc-linux-gnu (Old 2.4 based RH box)
#
# To ensure though that BUILD_HOST does not equal target throughout
# I am fudging it to be i686-build-linux-gnu
#
# This is primarily so glibc does not assume we are native compiling...
# Things get unhappy if you are building on a 2.4 kernel otherwise ;)
#
# We could just as easily fudge the targets to be x86_64-clfs-linux-gnu or
# i686-clfs-linux-gnu
#
# Change to however you want it to be

BUILD_HOST=i686-build-linux-gnu

mkdir ${LFS}/tools
ln -sf ${LFS}/tools /

# Tools linked against the host dont have to live under $LFS
# they can live anywhere (in your home directory for example)
#
# Here we just follow clfs.
#
# This keeps all our binaries/libs compiled and linked against
# the host outside of /tools
#
# It also means that the cross toolchain never gets clobbered making
# it very easy to restart a build
# ( ie: blow away /tools, re-install linux headers, continue at glibc )

mkdir ${LFS}/cross-tools
ln -sf ${LFS}/cross-tools /

# Install Kernel Headers
bzip2 -dc linux-2.6.27.9.tar.bz2
cd linux-2.6.27.9

install -dv /tools/include
make mrproper
make ARCH=x86_64 headers_check
make ARCH=x86_64 INSTALL_HDR_PATH=dest headers_install
cp -rv dest/include/* /tools/include

cd ../

#-----------------------------------------------------------------
# Sysrooted toolchain build

# OK this is probably too much, but I wanted to use binutils 2.19
# and use a combined gcc + binutils build tree for some giggles.
#
# The zlib dependency is not an issue when using the hosts zlib,
# (the whole toolchain is linked against the host ).
#
# Haven't really checked if the zlib dependency is satisfied by the
# zlib in the gcc tree...
#
# Easy enough to break the build back into separate binutils and gcc,
# just split the options into the appropriate build
#
# For the book I probably wouldn't recommend the combined tree, because
# no-one ever sticks to the prescribed versions ;)

bzip2 -dc gcc-4.3.2.tar.bz2 | tar xf -
bzip2 -dc binutils-2.19.tar.bz2 | tar xf -
bzip2 -dc mfpr-2.3.2.tar.bz2 | tar xf -
bzip2 -dc gmp-4.2.3.tar.bz2 | tar xf -

mkdir sysroot-toolchain
# Binutils build framework is newer than gcc's
cd gcc-4.3.2; tar -c * | \
  ( cd ../sysroot-toolchain ; tar xf - )
cd ../binutils-2.19; tar -c * | \
  ( cd ../sysroot-toolchain ; tar xf - )
cd ../sysroot-toolchain
mv ../mpfr-2.3.2 ./mpfr
mv ../gmp-4.2.3 ./gmp

# Binutils patches
#--------------------
# The following patch makes genscripts process LIB_PATH
# (--with-libpath option) to provide
# multilib dirs in the linkers search path.
# (get patch from cross-lfs)
#
# It also removes anything specified by --libdir from the linker
# search path (keeps lib64 out of 32bit search paths if installing
# binutils with --libdir=/somewhere/lib64)

patch -Np1 -i ../binutils-2.18-genscripts_multilib-1.patch

# GCC Patches
#--------------------
# Apply the gcc specs patch

patch -Np1 -i ../gcc-4.3.2-specs-1.patch

# For this sysrooted compiler we override STANDARD_STARTFILE_PREFIX{_1,_2}
# from /lib, /usr/lib to be /tools/lib only.
#
# This ensures by default the compiler will look in
# /tools/lib/../lib or /tools/lib/../lib64 as appropriate

echo "
#undef STANDARD_STARTFILE_PREFIX_1
#undef STANDARD_STARTFILE_PREFIX_2
#define STANDARD_STARTFILE_PREFIX_1 \"/tools/lib/\"
#define STANDARD_STARTFILE_PREFIX_2 \"\"" >> gcc/config/linux.h

# Next we ensure that only /tools/include will be used as the
# defined SYSTEM_HEADER_DIR
#
# We adjust CROSS_SYSTEM_HEADER_DIR in this case
# (not NATIVE_SYSTEM_HEADER_DIR)
# as this is a cross compiler

cp -v gcc/Makefile.in{,.orig}
sed -e "s...@\(^CROSS_SYSTEM_HEADER_DIR =\)....@\1 /tools/incl...@g" \
   gcc/Makefile.in.orig > gcc/Makefile.in

# And to be anally retentive, nuke any mention of /usr/include
# out of cppdefault.c
cp -v gcc/cppdefault.c{,.orig}
sed -e '/#define STANDARD_INCLUDE_DIR/s@"/usr/include"@0...@g' \
   gcc/cppdefault.c.orig > gcc/cppdefault.c

mkdir ../sysroot-toolchain-build
cd ../sysroot-toolchain-build

# For this build we will have to inhibit_libc, so we pass
# --with-newlib and --without-headers
# ( we could also just set -Dinhibit_libc)
#
# Alternatively, if the binutils/gcc build was split we could
# install glibc headers after the binutils build but before gcc
# and dispense with the above

AR=ar AS=as ../sysroot-toolchain/configure \
  --with-sysroot=${LFS} \
  --prefix=/cross-tools \
  --target=x86_64-pc-linux-gnu \
  --with-local-prefix=/tools \
  --without-headers \
  --with-newlib \
  --disable-nls \
  --disable-shared \
  --disable-decimal-float \
  --disable-libgomp \
  --disable-libmudflap \
  --disable-libssp \
  --disable-threads \
  --enable-languages=c \
  --enable-64-bit-bfd \
  --with-lib-path=/tools/lib

make
make install

# OK, now we have a SANE multilib capable cross compiler

# Build glibc (here pretty much straight from cross-lfs)

export PATH=/cross-tools/bin:${PATH}

cd ../
bzip2 -dc glibc-2.9-20081215.tar.bz2 | tar xf -

mv glibc-2.9-20081215{,-32}
cd glibc-2.9-20081215-32

# Disable linking to libgcc_eh
patch -Np1 -i ../glibc-2.9-libgcc_eh-1.patch

mkdir ../glibc-build-32
cd ../glibc-build-32

echo "libc_cv_forced_unwind=yes" > config.cache
echo "libc_cv_c_cleanup=yes" >> config.cache
echo "libc_cv_gnu89_inline=yes" >> config.cache

# OK , we should be able to use our new compiler as BUILD_CC
# (of course if on ix86 -m32 must be supplied)
#
# BUILD_CC is used to compile the tools glibc uses to build/configure
# components of itself with, these run on the host system and are not
# installed, so its probably just as safe to use the hosts gcc to avoid
# any potential issues
#
# Also BUILD_HOST should not equal the target, we may be running on
# a 2.4 kernel, you never know

BUILD_CC="gcc" CC="x86_64-pc-linux-gnu-gcc -m32" \
   AR="x86_64-pc-linux-gnu-ar" RANLIB="x86_64-pc-linux-gnu-ranlib" \
   CFLAGS="-march=athlon64 -mtune=generic -g -O2" \
   ../glibc-2.9-20081215-32/configure --prefix=/tools \
   --host=i686-pc-linux-gnu --build=${BUILD_HOST} \
   --disable-profile --enable-add-ons \
   --with-tls --enable-kernel=2.6.0 --with-__thread \
   --with-binutils=/cross-tools/bin --with-headers=/tools/include \
   --cache-file=config.cache

make
make install

# Build 64-bit GLIBC
cd ../
bzip2 -dc glibc-2.9-20081215.tar.bz2 | tar xf -

mv glibc-2.9-20081215{,-64}
cd glibc-2.9-20081215-64

# Disable linking to libgcc_eh
patch -Np1 -i ../glibc-2.9-libgcc_eh-1.patch

mkdir ../glibc-build-64
cd ../glibc-build-64

echo "libc_cv_forced_unwind=yes" > config.cache
echo "libc_cv_c_cleanup=yes" >> config.cache
echo "libc_cv_gnu89_inline=yes" >> config.cache

echo "slibdir=/tools/lib64" >> configparms

# CFLAGS can be nuked from below if desired
BUILD_CC="gcc" CC="x86_64-pc-linux-gnu-gcc -m64" \
   AR="x86_64-pc-linux-gnu-ar" \
   RANLIB="x86_64-pc-linux-gnu-ranlib" \
   CFLAGS="-march=athlon64 -mtune=generic -g -O2" \
   ../glibc-2.9-20081215-32/configure --prefix=/tools \
   --host=x86_64-pc-linux-gnu --build=${BUILD_HOST} \
   --libdir=/tools/lib64 \
   --disable-profile --enable-add-ons \
   --with-tls --enable-kernel=2.6.0 --with-__thread \
   --with-binutils=/cross-tools/bin --with-headers=/tools/include \
   --cache-file=config.cache

make
make install

# Here in cross-lfs we would build our final cross-gcc which
# would supply the self hosted toolchain with libgcc_s.so
# and a cross c++ compiler + libstdc++ etc.
#
# This would allow us build binutils-2.19 with gold if we wanted to
# in the next phase. (not a good idea atm)
#
# If g++ does become a dependency a gcc-cross-final build would be
# required.
#
# As nothing apart from gold has the g++ dependency (atm)
# we can dispense with that step for a native build

#-----------------------------------------------------------------
# If you are running a 2.4 kernel or not running a multilib x86_64
# capable kernel you need to build one now and reboot
#-----------------------------------------------------------------

export PATH=/cross-tools/bin:${PATH}

# Build the binutils zlib dependency into /tools

# Build zlib for target
cd ../

# Build zlib 32 bit
gzip -dc zlib-1.2.3.tar.gc | tar xf -
mv zlib-1.2.3 zlib-1.2.3-32

cd zlib-1.2.3-32
CC="x86_64-pc-linux-gnu-gcc -m32" \
  ./configure --prefix=/tools --shared --libdir=/tools/lib

make
make install

cd ../

# Build zlib 64 bit
gzip -dc zlib-1.2.3.tar.gc | tar xf -
mv zlib-1.2.3 zlib-1.2.3-64

cd zlib-1.2.3-64
CC="x86_64-pc-linux-gnu-gcc -m64" \
  ./configure --prefix=/tools --shared --libdir=/tools/lib64

make
make install

cd ../

# Combined build again here, again can be split up easily enough

# We already unpacked gcc and binutils
# unpack mpfr and gmp again
bzip2 -dc mpfr-2.3.2.tar.bz2 | tar xf -
bzip2 -dc gmp-4.2.3.tar.bz2 | tar xf -

# Binutils build framework is newer than gcc's

mkdir native-toolchain
cd gcc-4.3.2; tar -c * | ( cd ../native-toolchain ; tar xf - )
cd ../binutils-2.19; tar -c * | ( cd ../native-toolchain ; tar xf - )
cd ../native-toolchain
mv ../mpfr-2.3.2 ./mfpr
mv ../gmp-4.2.3 ./gmp

# Binutils patches
#--------------------

patch -Np1 -i ../binutils-2.18-genscripts_multilib-1.patch

# GCC Patches
#--------------------

patch -Np1 -i ../gcc-4.3.2-specs-1.patch

# For this native compiler we override STANDARD_STARTFILE_PREFIX{_1,_2}
# from /lib, /usr/lib to be /tools/lib only.
#
# This ensures by default the compiler will look in
# /tools/lib/../lib or /tools/lib/../lib64 as appropriate

echo "
#undef STANDARD_STARTFILE_PREFIX_1
#undef STANDARD_STARTFILE_PREFIX_2
#define STANDARD_STARTFILE_PREFIX_1 \"/tools/lib/\"
#define STANDARD_STARTFILE_PREFIX_2 \"\"" >> gcc/config/linux.h

# Next we ensure that only /tools/include will be used as the defined
# SYSTEM_HEADER_DIR
#
# We adjust NATIVE_SYSTEM_HEADER_DIR in this case
# (not CROSS_SYSTEM_HEADER_DIR) as this is a native compiler
#

cp -v gcc/Makefile.in{,.orig}
sed -e "s...@\(^NATIVE_SYSTEM_HEADER_DIR =\)....@\1 /tools/incl...@g" \
   gcc/Makefile.in.orig > gcc/Makefile.in

# And to be anally retentive, nuke any mention of /usr/include
# out of cppdefault.c
cp -v gcc/cppdefault.c{,.orig}
sed -e '/#define STANDARD_INCLUDE_DIR/s@"/usr/include"@0...@g' \
   gcc/cppdefault.c.orig > gcc/cppdefault.c

mkdir ../native-toolchain-build
cd ../native-toolchain-build

# Target, build and host are all set here
# This isn't necessary, I just want the toolchain installed
# with the name x86_64-pc-linux-gnu not x86_64-unknown-linux-gnu

# Also up to you whether you bootstrap or not, I tried it both ways,
# Mostly the same result from the testsuites (which mirror HJL's results)

CC="x86_64-pc-linux-gnu-gcc" \
AR="x86_64-pc-linux-gnu-ar" \
AS="x86_64-pc-linux-gnu-as" \
RANLIB="x86_64-pc-linux-gnu-ranlib" \
../native-toolchain/configure \
  --prefix=/tools \
  --target=x86_64-pc-linux-gnu \
  --build=x86_64-pc-linux-gnu \
  --host=x86_64-pc-linux-gnu \
  --with-local-prefix=/tools \
  --disable-nls \
  --enable-shared \
  --enable-languages=c,c++ \
  --enable-__cxa_atexit \
  --enable-c99 \
  --enable-long-long \
  --enable-threads=posix \
  --enable-64-bit-bfd \
  --with-lib-path=/tools/lib \
  --disable-bootstrap

make

# NOTE: If running tests multilib ensure you set RUNTESTFLAGS
# as shown below, which ensures both 32 and 64bit tests are performed
#make -k check RUNTESTFLAGS="--target_board=unix\{-m32,\}"

# GCC Test results match HJL's results with a pre-release (by a week or so)
# gcc-4.3.2 (dont know what binutils he was using, probably a 2.18 HJL ;) )

make install

# Update path so we now prefer tools in /tools over /cross-tools
export PATH=/tools/bin:${PATH}

# Rest of chapter 5 as per usual, using -m32 or -m64 (and --with-libpath)
# as desired for the ch5 binaries.
#
# If there are any -B/foo/lib options, nuke them,
# they are totally unnecessary and counter productive

#====================================================================
# OK, how to build yourself out ch6
#--------------------------------------------------------------------

# install linux headers

# Build glibc 32 and 64 as per cross-lfs

# Toolchain adjustment
#
# Perform the standard specs edit to readjust the dynamic linker
# and cpp search path
#
# You have a couple of options on how to repoint the linker to pickup the
# new startfiles in /usr/lib
#
# IF creating a specs file in the standard location under
# /tools/lib/gcc/x86_64-pc-linux-gnu/4.2.3 you can
#
# a) set LIBRARY_PATH=/lib:/usr/lib or
#        LPATH=/lib:/usr/lib
#    in the environment
# b) Edit md_startfile_prefix*
# c) Edit startfile_prefix_spec
#
# If using the -specs switch to specify specs in a non-standard location
# set LIBRARY_PATH=/lib:/usr/lib or LPATH=/lib:/usr/lib in the environment
#
# It doesn't hurt to keep LIBRARY_PATH set if you forget to unset it later
#



# Build zlib 32 bit
./configure --prefix=/usr --shared --libdir=/lib

# Build zlib 64 bit
./configure --prefix=/tools --shared --libdir=/lib64

# Rest of build as per cross-lfs multilib


r...@rei:/u2/build# /tools/bin/gcc -v -m32 -Wl,-verbose foo.c
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with: ../native-toolchain/configure --prefix=/tools 
--target=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu 
--host=x86_64-pc-linux-gnu --with-local-prefix=/tools --disable-nls 
--enable-shared --enable-languages=c,c++ --enable-__cxa_atexit --enable-c99 
--enable-long-long --enable-threads=posix --enable-64-bit-bfd 
--with-lib-path=/tools/lib
Thread model: posix
gcc version 4.3.2 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-m32' '-mtune=generic'
 /u2/lfs/tools/bin/../libexec/gcc/x86_64-pc-linux-gnu/4.3.2/cc1 -quiet -v 
-imultilib 32 -iprefix /u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/ 
foo.c -quiet -dumpbase foo.c -m32 -mtune=generic -auxbase foo -version -o 
/tmp/ccmqP3dt.s
ignoring nonexistent directory 
"/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/include"
ignoring duplicate directory 
"/u2/lfs/tools/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/4.3.2/include"
ignoring duplicate directory 
"/u2/lfs/tools/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/4.3.2/include-fixed"
ignoring nonexistent directory 
"/u2/lfs/tools/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/include
 /u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/include-fixed
 /tools/include
End of search list.
GNU C (GCC) version 4.3.2 (x86_64-pc-linux-gnu)
        compiled by GNU C version 4.3.2, GMP version 4.2.3, MPFR version 2.3.2.
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=128427
Compiler executable checksum: 072007c4adee2ff414f18049e179ccb2
foo.c: In function 'main':
foo.c:2: warning: incompatible implicit declaration of built-in function 
'printf'
COLLECT_GCC_OPTIONS='-v' '-m32' '-mtune=generic'
 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/bin/as
 -v -V -Qy --32 -o /tmp/ccIRTKvP.o /tmp/ccmqP3dt.s
GNU assembler version 2.19 (x86_64-pc-linux-gnu) using BFD version (GNU 
Binutils) 2.19
COMPILER_PATH=/u2/lfs/tools/bin/../libexec/gcc/x86_64-pc-linux-gnu/4.3.2/:/u2/lfs/tools/bin/../libexec/gcc/:/usr/libexec/gcc/x86_64-pc-linux-gnu/:/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/bin/
LIBRARY_PATH=/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/:/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/lib/../lib/:/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib/:/tools/lib/../lib/:/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/:/u2/lfs/tools/bin/../lib/gcc/:/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/lib/:/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../:/tools/lib/
COLLECT_GCC_OPTIONS='-v' '-m32' '-mtune=generic'
 /u2/lfs/tools/bin/../libexec/gcc/x86_64-pc-linux-gnu/4.3.2/collect2 
--eh-frame-hdr -m elf_i386 -dynamic-linker /tools/lib/ld-linux.so.2 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib/crt1.o 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib/crti.o 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/crtbegin.o 
-L/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/32 
-L/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/lib/../lib
 -L/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib 
-L/tools/lib/../lib -L/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2 
-L/u2/lfs/tools/bin/../lib/gcc 
-L/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/lib
 -L/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../.. -L/tools/lib 
-verbose /tmp/ccIRTKvP.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc 
--as-needed -lgcc_s --no-as-needed 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/crtend.o 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib/crtn.o
GNU ld (GNU Binutils) 2.19
  Supported emulations:
   elf_x86_64
   elf_i386
   i386linux
using internal linker script:
==================================================
/* Script for -z combreloc: combine and sort reloc sections */
OUTPUT_FORMAT("elf32-i386", "elf32-i386",
              "elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(_start)
SEARCH_DIR("/tools/i386-pc-linux-gnu/lib"); SEARCH_DIR("/tools/lib");
SECTIONS
{
  /* Read-only sections, merged into text segment: */
  PROVIDE (__executable_start = 0x08048000); . = 0x08048000 + SIZEOF_HEADERS;
  .interp         : { *(.interp) }
  .note.gnu.build-id : { *(.note.gnu.build-id) }
  .hash           : { *(.hash) }
  .gnu.hash       : { *(.gnu.hash) }
  .dynsym         : { *(.dynsym) }
  .dynstr         : { *(.dynstr) }
  .gnu.version    : { *(.gnu.version) }
  .gnu.version_d  : { *(.gnu.version_d) }
  .gnu.version_r  : { *(.gnu.version_r) }
  .rel.dyn        :
    {
      *(.rel.init)
      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
      *(.rel.fini)
      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
      *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
      *(.rel.ctors)
      *(.rel.dtors)
      *(.rel.got)
      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
    }
  .rela.dyn       :
    {
      *(.rela.init)
      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
      *(.rela.fini)
      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
      *(.rela.ctors)
      *(.rela.dtors)
      *(.rela.got)
      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
    }
  .rel.plt        : { *(.rel.plt) }
  .rela.plt       : { *(.rela.plt) }
  .init           :
  {
    KEEP (*(.init))
  } =0x90909090
  .plt            : { *(.plt) }
  .text           :
  {
    *(.text .stub .text.* .gnu.linkonce.t.*)
    /* .gnu.warning sections are handled specially by elf32.em.  */
    *(.gnu.warning)
  } =0x90909090
  .fini           :
  {
    KEEP (*(.fini))
  } =0x90909090
  PROVIDE (__etext = .);
  PROVIDE (_etext = .);
  PROVIDE (etext = .);
  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  .rodata1        : { *(.rodata1) }
  .eh_frame_hdr : { *(.eh_frame_hdr) }
  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
  /* Adjust the address for the data segment.  We want to adjust up to
     the same address within the page on the next page up.  */
  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & 
(CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), 
CONSTANT (COMMONPAGESIZE));
  /* Exception handling  */
  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  /* Thread Local Storage sections  */
  .tdata          : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  .preinit_array     :
  {
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP (*(.preinit_array))
    PROVIDE_HIDDEN (__preinit_array_end = .);
  }
  .init_array     :
  {
     PROVIDE_HIDDEN (__init_array_start = .);
     KEEP (*(SORT(.init_array.*)))
     KEEP (*(.init_array))
     PROVIDE_HIDDEN (__init_array_end = .);
  }
  .fini_array     :
  {
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP (*(.fini_array))
    KEEP (*(SORT(.fini_array.*)))
    PROVIDE_HIDDEN (__fini_array_end = .);
  }
  .ctors          :
  {
    /* gcc uses crtbegin.o to find the start of
       the constructors, so we make sure it is
       first.  Because this is a wildcard, it
       doesn't matter if the user does not
       actually link against crtbegin.o; the
       linker won't look for a file to match a
       wildcard.  The wildcard also means that it
       doesn't matter which directory crtbegin.o
       is in.  */
    KEEP (*crtbegin.o(.ctors))
    KEEP (*crtbegin?.o(.ctors))
    /* We don't want to include the .ctor section from
       the crtend.o file until after the sorted ctors.
       The .ctor section from the crtend file contains the
       end of ctors marker and it must be last */
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
    KEEP (*(SORT(.ctors.*)))
    KEEP (*(.ctors))
  }
  .dtors          :
  {
    KEEP (*crtbegin.o(.dtors))
    KEEP (*crtbegin?.o(.dtors))
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
    KEEP (*(SORT(.dtors.*)))
    KEEP (*(.dtors))
  }
  .jcr            : { KEEP (*(.jcr)) }
  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) 
*(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
  .dynamic        : { *(.dynamic) }
  .got            : { *(.got) }
  . = DATA_SEGMENT_RELRO_END (12, .);
  .got.plt        : { *(.got.plt) }
  .data           :
  {
    *(.data .data.* .gnu.linkonce.d.*)
    SORT(CONSTRUCTORS)
  }
  .data1          : { *(.data1) }
  _edata = .; PROVIDE (edata = .);
  __bss_start = .;
  .bss            :
  {
   *(.dynbss)
   *(.bss .bss.* .gnu.linkonce.b.*)
   *(COMMON)
   /* Align here to ensure that the .bss section occupies space up to
      _end.  Align after .bss to ensure correct alignment even if the
      .bss section disappears because there are no input sections.
      FIXME: Why do we need it? When there is no .bss section, we don't
      pad the .data section.  */
   . = ALIGN(. != 0 ? 32 / 8 : 1);
  }
  . = ALIGN(32 / 8);
  . = ALIGN(32 / 8);
  _end = .; PROVIDE (end = .);
  . = DATA_SEGMENT_END (.);
  /* Stabs debugging sections.  */
  .stab          0 : { *(.stab) }
  .stabstr       0 : { *(.stabstr) }
  .stab.excl     0 : { *(.stab.excl) }
  .stab.exclstr  0 : { *(.stab.exclstr) }
  .stab.index    0 : { *(.stab.index) }
  .stab.indexstr 0 : { *(.stab.indexstr) }
  .comment       0 : { *(.comment) }
  /* DWARF debug sections.
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section so we begin them at 0.  */
  /* DWARF 1 */
  .debug          0 : { *(.debug) }
  .line           0 : { *(.line) }
  /* GNU DWARF 1 extensions */
  .debug_srcinfo  0 : { *(.debug_srcinfo) }
  .debug_sfnames  0 : { *(.debug_sfnames) }
  /* DWARF 1.1 and DWARF 2 */
  .debug_aranges  0 : { *(.debug_aranges) }
  .debug_pubnames 0 : { *(.debug_pubnames) }
  /* DWARF 2 */
  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
  .debug_abbrev   0 : { *(.debug_abbrev) }
  .debug_line     0 : { *(.debug_line) }
  .debug_frame    0 : { *(.debug_frame) }
  .debug_str      0 : { *(.debug_str) }
  .debug_loc      0 : { *(.debug_loc) }
  .debug_macinfo  0 : { *(.debug_macinfo) }
  /* SGI/MIPS DWARF 2 extensions */
  .debug_weaknames 0 : { *(.debug_weaknames) }
  .debug_funcnames 0 : { *(.debug_funcnames) }
  .debug_typenames 0 : { *(.debug_typenames) }
  .debug_varnames  0 : { *(.debug_varnames) }
  /* DWARF 3 */
  .debug_pubtypes 0 : { *(.debug_pubtypes) }
  .debug_ranges   0 : { *(.debug_ranges) }
  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
}


==================================================
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib/crt1.o 
succeeded
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib/crt1.o
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib/crti.o 
succeeded
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib/crti.o
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/crtbegin.o succeeded
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/crtbegin.o
attempt to open /tmp/ccIRTKvP.o succeeded
/tmp/ccIRTKvP.o
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/libgcc.so failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/libgcc.a succeeded
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/libgcc_s.so failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/libgcc_s.a failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/lib/../lib/libgcc_s.so
 failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/lib/../lib/libgcc_s.a
 failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib/libgcc_s.so
 succeeded
-lgcc_s 
(/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib/libgcc_s.so)
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/libc.so failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/libc.a failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/lib/../lib/libc.so
 failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/lib/../lib/libc.a
 failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib/libc.so 
succeeded
opened script file 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib/libc.so
opened script file 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib/libc.so
attempt to open /tools/lib/libc.so.6 succeeded
/tools/lib/libc.so.6
attempt to open /tools/lib/libc_nonshared.a succeeded
(/tools/lib/libc_nonshared.a)elf-init.oS
attempt to open /tools/lib/ld-linux.so.2 succeeded
/tools/lib/ld-linux.so.2
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/libgcc.so failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/libgcc.a succeeded
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/libgcc_s.so failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/libgcc_s.a failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/lib/../lib/libgcc_s.so
 failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/lib/../lib/libgcc_s.a
 failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib/libgcc_s.so
 succeeded
-lgcc_s 
(/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib/libgcc_s.so)
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/crtend.o succeeded
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/crtend.o
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib/crtn.o 
succeeded
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib/crtn.o
ld-linux.so.2 needed by /tools/lib/libc.so.6
found ld-linux.so.2 at /tools/lib/ld-linux.so.2


r...@rei:/u2/build# readelf -l a.out

Elf file type is EXEC (Executable file)
Entry point 0x80482d0
There are 7 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  PHDR           0x000034 0x08048034 0x08048034 0x000e0 0x000e0 R E 0x4
  INTERP         0x000114 0x08048114 0x08048114 0x00019 0x00019 R   0x1
      [Requesting program interpreter: /tools/lib/ld-linux.so.2]
  LOAD           0x000000 0x08048000 0x08048000 0x00478 0x00478 R E 0x1000
  LOAD           0x000478 0x08049478 0x08049478 0x00100 0x00108 RW  0x1000
  DYNAMIC        0x00048c 0x0804948c 0x0804948c 0x000c8 0x000c8 RW  0x4
  NOTE           0x000130 0x08048130 0x08048130 0x00020 0x00020 R   0x4
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4

 Section to Segment mapping:
  Segment Sections...
   00     
   01     .interp 
   02     .interp .note.ABI-tag .hash .dynsym .dynstr .gnu.version 
.gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .eh_frame 
   03     .ctors .dtors .jcr .dynamic .got .got.plt .data .bss 
   04     .dynamic 
   05     .note.ABI-tag 
   06     
r...@rei:/u2/build# /tools/bin/gcc -v -m64 -Wl,-verbose foo.c
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with: ../native-toolchain/configure --prefix=/tools 
--target=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu 
--host=x86_64-pc-linux-gnu --with-local-prefix=/tools --disable-nls 
--enable-shared --enable-languages=c,c++ --enable-__cxa_atexit --enable-c99 
--enable-long-long --enable-threads=posix --enable-64-bit-bfd 
--with-lib-path=/tools/lib
Thread model: posix
gcc version 4.3.2 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-m64' '-mtune=generic'
 /u2/lfs/tools/bin/../libexec/gcc/x86_64-pc-linux-gnu/4.3.2/cc1 -quiet -v 
-iprefix /u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/ foo.c -quiet 
-dumpbase foo.c -m64 -mtune=generic -auxbase foo -version -o /tmp/ccqEQP5a.s
ignoring nonexistent directory 
"/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/include"
ignoring duplicate directory 
"/u2/lfs/tools/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/4.3.2/include"
ignoring duplicate directory 
"/u2/lfs/tools/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/4.3.2/include-fixed"
ignoring nonexistent directory 
"/u2/lfs/tools/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/include
 /u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/include-fixed
 /tools/include
End of search list.
GNU C (GCC) version 4.3.2 (x86_64-pc-linux-gnu)
        compiled by GNU C version 4.3.2, GMP version 4.2.3, MPFR version 2.3.2.
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=128427
Compiler executable checksum: 072007c4adee2ff414f18049e179ccb2
foo.c: In function 'main':
foo.c:2: warning: incompatible implicit declaration of built-in function 
'printf'
COLLECT_GCC_OPTIONS='-v' '-m64' '-mtune=generic'
 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/bin/as
 -v -V -Qy --64 -o /tmp/ccqyqpif.o /tmp/ccqEQP5a.s
GNU assembler version 2.19 (x86_64-pc-linux-gnu) using BFD version (GNU 
Binutils) 2.19
COMPILER_PATH=/u2/lfs/tools/bin/../libexec/gcc/x86_64-pc-linux-gnu/4.3.2/:/u2/lfs/tools/bin/../libexec/gcc/:/usr/libexec/gcc/x86_64-pc-linux-gnu/:/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/bin/
LIBRARY_PATH=/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/:/u2/lfs/tools/bin/../lib/gcc/:/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/:/tools/lib/../lib64/:/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/lib/:/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../:/tools/lib/
COLLECT_GCC_OPTIONS='-v' '-m64' '-mtune=generic'
 /u2/lfs/tools/bin/../libexec/gcc/x86_64-pc-linux-gnu/4.3.2/collect2 
--eh-frame-hdr -m elf_x86_64 -dynamic-linker /tools/lib64/ld-linux-x86-64.so.2 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/crt1.o 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/crti.o 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/crtbegin.o 
-L/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2 
-L/u2/lfs/tools/bin/../lib/gcc 
-L/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64 
-L/tools/lib/../lib64 
-L/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/lib
 -L/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../.. -L/tools/lib 
-verbose /tmp/ccqyqpif.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc 
--as-needed -lgcc_s --no-as-needed 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/crtend.o 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/crtn.o
GNU ld (GNU Binutils) 2.19
  Supported emulations:
   elf_x86_64
   elf_i386
   i386linux
using internal linker script:
==================================================
/* Script for -z combreloc: combine and sort reloc sections */
OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64",
              "elf64-x86-64")
OUTPUT_ARCH(i386:x86-64)
ENTRY(_start)
SEARCH_DIR("/tools/x86_64-pc-linux-gnu/lib64"); SEARCH_DIR("/tools/lib64"); 
SEARCH_DIR("/tools/x86_64-pc-linux-gnu/lib"); SEARCH_DIR("/tools/lib");
SECTIONS
{
  /* Read-only sections, merged into text segment: */
  PROVIDE (__executable_start = 0x400000); . = 0x400000 + SIZEOF_HEADERS;
  .interp         : { *(.interp) }
  .note.gnu.build-id : { *(.note.gnu.build-id) }
  .hash           : { *(.hash) }
  .gnu.hash       : { *(.gnu.hash) }
  .dynsym         : { *(.dynsym) }
  .dynstr         : { *(.dynstr) }
  .gnu.version    : { *(.gnu.version) }
  .gnu.version_d  : { *(.gnu.version_d) }
  .gnu.version_r  : { *(.gnu.version_r) }
  .rel.dyn        :
    {
      *(.rel.init)
      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
      *(.rel.fini)
      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
      *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
      *(.rel.ctors)
      *(.rel.dtors)
      *(.rel.got)
      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
      *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*)
      *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*)
      *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*)
    }
  .rela.dyn       :
    {
      *(.rela.init)
      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
      *(.rela.fini)
      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
      *(.rela.ctors)
      *(.rela.dtors)
      *(.rela.got)
      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
      *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)
      *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)
      *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)
    }
  .rel.plt        : { *(.rel.plt) }
  .rela.plt       : { *(.rela.plt) }
  .init           :
  {
    KEEP (*(.init))
  } =0x90909090
  .plt            : { *(.plt) }
  .text           :
  {
    *(.text .stub .text.* .gnu.linkonce.t.*)
    /* .gnu.warning sections are handled specially by elf32.em.  */
    *(.gnu.warning)
  } =0x90909090
  .fini           :
  {
    KEEP (*(.fini))
  } =0x90909090
  PROVIDE (__etext = .);
  PROVIDE (_etext = .);
  PROVIDE (etext = .);
  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  .rodata1        : { *(.rodata1) }
  .eh_frame_hdr : { *(.eh_frame_hdr) }
  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
  /* Adjust the address for the data segment.  We want to adjust up to
     the same address within the page on the next page up.  */
  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & 
(CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), 
CONSTANT (COMMONPAGESIZE));
  /* Exception handling  */
  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  /* Thread Local Storage sections  */
  .tdata          : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  .preinit_array     :
  {
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP (*(.preinit_array))
    PROVIDE_HIDDEN (__preinit_array_end = .);
  }
  .init_array     :
  {
     PROVIDE_HIDDEN (__init_array_start = .);
     KEEP (*(SORT(.init_array.*)))
     KEEP (*(.init_array))
     PROVIDE_HIDDEN (__init_array_end = .);
  }
  .fini_array     :
  {
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP (*(.fini_array))
    KEEP (*(SORT(.fini_array.*)))
    PROVIDE_HIDDEN (__fini_array_end = .);
  }
  .ctors          :
  {
    /* gcc uses crtbegin.o to find the start of
       the constructors, so we make sure it is
       first.  Because this is a wildcard, it
       doesn't matter if the user does not
       actually link against crtbegin.o; the
       linker won't look for a file to match a
       wildcard.  The wildcard also means that it
       doesn't matter which directory crtbegin.o
       is in.  */
    KEEP (*crtbegin.o(.ctors))
    KEEP (*crtbegin?.o(.ctors))
    /* We don't want to include the .ctor section from
       the crtend.o file until after the sorted ctors.
       The .ctor section from the crtend file contains the
       end of ctors marker and it must be last */
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
    KEEP (*(SORT(.ctors.*)))
    KEEP (*(.ctors))
  }
  .dtors          :
  {
    KEEP (*crtbegin.o(.dtors))
    KEEP (*crtbegin?.o(.dtors))
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
    KEEP (*(SORT(.dtors.*)))
    KEEP (*(.dtors))
  }
  .jcr            : { KEEP (*(.jcr)) }
  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) 
*(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
  .dynamic        : { *(.dynamic) }
  .got            : { *(.got) }
  . = DATA_SEGMENT_RELRO_END (24, .);
  .got.plt        : { *(.got.plt) }
  .data           :
  {
    *(.data .data.* .gnu.linkonce.d.*)
    SORT(CONSTRUCTORS)
  }
  .data1          : { *(.data1) }
  _edata = .; PROVIDE (edata = .);
  __bss_start = .;
  .bss            :
  {
   *(.dynbss)
   *(.bss .bss.* .gnu.linkonce.b.*)
   *(COMMON)
   /* Align here to ensure that the .bss section occupies space up to
      _end.  Align after .bss to ensure correct alignment even if the
      .bss section disappears because there are no input sections.
      FIXME: Why do we need it? When there is no .bss section, we don't
      pad the .data section.  */
   . = ALIGN(. != 0 ? 64 / 8 : 1);
  }
  .lbss   :
  {
    *(.dynlbss)
    *(.lbss .lbss.* .gnu.linkonce.lb.*)
    *(LARGE_COMMON)
  }
  . = ALIGN(64 / 8);
  .lrodata   ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) 
:
  {
    *(.lrodata .lrodata.* .gnu.linkonce.lr.*)
  }
  .ldata   ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
  {
    *(.ldata .ldata.* .gnu.linkonce.l.*)
    . = ALIGN(. != 0 ? 64 / 8 : 1);
  }
  . = ALIGN(64 / 8);
  _end = .; PROVIDE (end = .);
  . = DATA_SEGMENT_END (.);
  /* Stabs debugging sections.  */
  .stab          0 : { *(.stab) }
  .stabstr       0 : { *(.stabstr) }
  .stab.excl     0 : { *(.stab.excl) }
  .stab.exclstr  0 : { *(.stab.exclstr) }
  .stab.index    0 : { *(.stab.index) }
  .stab.indexstr 0 : { *(.stab.indexstr) }
  .comment       0 : { *(.comment) }
  /* DWARF debug sections.
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section so we begin them at 0.  */
  /* DWARF 1 */
  .debug          0 : { *(.debug) }
  .line           0 : { *(.line) }
  /* GNU DWARF 1 extensions */
  .debug_srcinfo  0 : { *(.debug_srcinfo) }
  .debug_sfnames  0 : { *(.debug_sfnames) }
  /* DWARF 1.1 and DWARF 2 */
  .debug_aranges  0 : { *(.debug_aranges) }
  .debug_pubnames 0 : { *(.debug_pubnames) }
  /* DWARF 2 */
  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
  .debug_abbrev   0 : { *(.debug_abbrev) }
  .debug_line     0 : { *(.debug_line) }
  .debug_frame    0 : { *(.debug_frame) }
  .debug_str      0 : { *(.debug_str) }
  .debug_loc      0 : { *(.debug_loc) }
  .debug_macinfo  0 : { *(.debug_macinfo) }
  /* SGI/MIPS DWARF 2 extensions */
  .debug_weaknames 0 : { *(.debug_weaknames) }
  .debug_funcnames 0 : { *(.debug_funcnames) }
  .debug_typenames 0 : { *(.debug_typenames) }
  .debug_varnames  0 : { *(.debug_varnames) }
  /* DWARF 3 */
  .debug_pubtypes 0 : { *(.debug_pubtypes) }
  .debug_ranges   0 : { *(.debug_ranges) }
  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
}


==================================================
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/crt1.o 
succeeded
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/crt1.o
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/crti.o 
succeeded
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/crti.o
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/crtbegin.o succeeded
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/crtbegin.o
attempt to open /tmp/ccqyqpif.o succeeded
/tmp/ccqyqpif.o
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/libgcc.so failed
attempt to open /u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/libgcc.a 
succeeded
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/libgcc_s.so failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/libgcc_s.a failed
attempt to open /u2/lfs/tools/bin/../lib/gcc/libgcc_s.so failed
attempt to open /u2/lfs/tools/bin/../lib/gcc/libgcc_s.a failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/libgcc_s.so
 succeeded
-lgcc_s 
(/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/libgcc_s.so)
attempt to open /u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/libc.so 
failed
attempt to open /u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/libc.a 
failed
attempt to open /u2/lfs/tools/bin/../lib/gcc/libc.so failed
attempt to open /u2/lfs/tools/bin/../lib/gcc/libc.a failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/libc.so
 succeeded
opened script file 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/libc.so
opened script file 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/libc.so
attempt to open /tools/lib64/libc.so.6 succeeded
/tools/lib64/libc.so.6
attempt to open /tools/lib64/libc_nonshared.a succeeded
(/tools/lib64/libc_nonshared.a)elf-init.oS
attempt to open /tools/lib64/ld-linux-x86-64.so.2 succeeded
/tools/lib64/ld-linux-x86-64.so.2
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/libgcc.so failed
attempt to open /u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/libgcc.a 
succeeded
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/libgcc_s.so failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/libgcc_s.a failed
attempt to open /u2/lfs/tools/bin/../lib/gcc/libgcc_s.so failed
attempt to open /u2/lfs/tools/bin/../lib/gcc/libgcc_s.a failed
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/libgcc_s.so
 succeeded
-lgcc_s 
(/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/libgcc_s.so)
attempt to open /u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/crtend.o 
succeeded
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/crtend.o
attempt to open 
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/crtn.o 
succeeded
/u2/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/crtn.o
ld-linux-x86-64.so.2 needed by /tools/lib64/libc.so.6
found ld-linux-x86-64.so.2 at /tools/lib64/ld-linux-x86-64.so.2

r...@rei:/u2/build# readelf -l a.out

Elf file type is EXEC (Executable file)
Entry point 0x4003d0
There are 8 program headers, starting at offset 64

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  PHDR           0x0000000000000040 0x0000000000400040 0x0000000000400040
                 0x00000000000001c0 0x00000000000001c0  R E    8
  INTERP         0x0000000000000200 0x0000000000400200 0x0000000000400200
                 0x0000000000000022 0x0000000000000022  R      1
      [Requesting program interpreter: /tools/lib64/ld-linux-x86-64.so.2]
  LOAD           0x0000000000000000 0x0000000000400000 0x0000000000400000
                 0x000000000000068c 0x000000000000068c  R E    200000
  LOAD           0x0000000000000690 0x0000000000600690 0x0000000000600690
                 0x00000000000001f8 0x0000000000000208  RW     200000
  DYNAMIC        0x00000000000006b8 0x00000000006006b8 0x00000000006006b8
                 0x0000000000000190 0x0000000000000190  RW     8
  NOTE           0x0000000000000224 0x0000000000400224 0x0000000000400224
                 0x0000000000000020 0x0000000000000020  R      4
  GNU_EH_FRAME   0x00000000000005d0 0x00000000004005d0 0x00000000004005d0
                 0x0000000000000024 0x0000000000000024  R      4
  GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000  RW     8

 Section to Segment mapping:
  Segment Sections...
   00     
   01     .interp 
   02     .interp .note.ABI-tag .hash .dynsym .dynstr .gnu.version 
.gnu.version_r .rela.dyn .rela.plt .init .plt .text .fini .rodata .eh_frame_hdr 
.eh_frame 
   03     .ctors .dtors .jcr .dynamic .got .got.plt .data .bss 
   04     .dynamic 
   05     .note.ABI-tag 
   06     .eh_frame_hdr 
   07     
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to