cd /usr/src
tar xfvz binutils-2.5.2.tar.gz
cd binutils-2.5.2
patch -p0 < ELF-HOWTO
where ELF-HOWTO is this file. The patch, made by H.J. Lu, fixes some binutils-2.5.2 bugs and allow the support for ELF.
find . -name *.rej -print
should find nothing
find . -name *.orig -print -exec rm -f {} \;
vi bfd/elf32-i386.c
at line 194 you should find:
#define ELF_DYNAMIC_INTERPRETER "/usr/lib/libc.so.1"
change it to:
#define ELF_DYNAMIC_INTERPRETER "/lib/elf/ld-linux.so.1"
The libc-4.6.27 will put the dynamic linker in /lib/elf and ld-linux.so.1 will be a symlink to the real linker -> /lib/elf/ld-linux.so.1.0.14 This is needed because the ELF executables will use this run-time linker to link the shared libraries.
If you have an i386:
./configure i386-linuxelf
for a 486:
./configure i486-linuxelf
have a little break during configuration, it may take few minutes.
vi Makefile
at line 36 you should find:
prefix = /usr/local
change it to:
prefix = /usr/i486-linuxelf
to reflect the installation directory tree we have chosen.
at line 82 you should find:
CFLAGS = -g
change it to:
CFLAGS = -O2 -m486 -fomit-frame-pointer
(use the -m486 only if you have an i486) for optimization.
vi ld/Makefile
at line 189 you should find:
EMUL=i386linux
EMUL_EXTRA1=elf_i386
change it to:
EMUL_EXTRA1=i386linux
EMUL=elf_i386
to set the default emulation to elf_i386 (this will be the ELF linker, not the jump-table one).
do the
make
and have a long coffee break.
do the
make install
and it is done.
Now if you are short of disk space you may want to
cd /usr/src
rm -rf binutils-2.5.2
Next Chapter, Previous Chapter
Table of contents of this chapter, General table of contents
Top of the document, Beginning of this Chapter