aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog14
-rw-r--r--ld/Makefile.am4
-rw-r--r--ld/Makefile.in5
-rw-r--r--ld/configure.tgt7
-rw-r--r--ld/emulparams/elf32_x86_64.sh35
5 files changed, 62 insertions, 3 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index e1beb63..8bac5f0 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,17 @@
+2010-12-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ * emulparams/elf32_x86_64.sh: New.
+
+ * configure.tgt (targ64_extra_emuls): Add elf32_x86_64 for
+ i[3-7]86-*-linux-*.
+ (targ_extra_libpath): Likewise.
+ (targ_extra_emuls): Add elf32_x86_64 for x86_64-*-linux-*.
+ (targ_extra_libpath): Likewise.
+
+ * Makefile.am (ALL_64_EMULATION_SOURCES): Add eelf32_x86_64.c.
+ (eelf32_x86_64.c): New.
+ * Makefile.in: Regenerated.
+
2010-12-20 Alan Modra <amodra@gmail.com>
PR ld/12327
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 9f016df..aa6d7c5 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -442,6 +442,7 @@ ALL_64_EMULATION_SOURCES = \
eshelf64_nbsd.c \
eshlelf64_nbsd.c \
eelf_x86_64.c \
+ eelf32_x86_64.c \
eelf_x86_64_fbsd.c \
eelf_x86_64_sol2.c \
eelf_l1om.c \
@@ -1167,6 +1168,9 @@ eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
eelf_x86_64.c: $(srcdir)/emulparams/elf_x86_64.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_x86_64 "$(tdir_elf_x86_64)"
+eelf32_x86_64.c: $(srcdir)/emulparams/elf32_x86_64.sh \
+ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32_x86_64 "$(tdir_elf32_x86_64)"
eelf_x86_64_fbsd.c: $(srcdir)/emulparams/elf_x86_64_fbsd.sh \
$(srcdir)/emulparams/elf_x86_64.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 3cb6234..dd5bd2d 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -742,6 +742,7 @@ ALL_64_EMULATION_SOURCES = \
eshelf64_nbsd.c \
eshlelf64_nbsd.c \
eelf_x86_64.c \
+ eelf32_x86_64.c \
eelf_x86_64_fbsd.c \
eelf_x86_64_sol2.c \
eelf_l1om.c \
@@ -1057,6 +1058,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_spu.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_tic6x_be.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_tic6x_le.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_x86_64.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32b4300.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32bfin.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32bfinfd.Po@am__quote@
@@ -2591,6 +2593,9 @@ eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
eelf_x86_64.c: $(srcdir)/emulparams/elf_x86_64.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_x86_64 "$(tdir_elf_x86_64)"
+eelf32_x86_64.c: $(srcdir)/emulparams/elf32_x86_64.sh \
+ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32_x86_64 "$(tdir_elf32_x86_64)"
eelf_x86_64_fbsd.c: $(srcdir)/emulparams/elf_x86_64_fbsd.sh \
$(srcdir)/emulparams/elf_x86_64.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 4e90739..44fae09 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -199,12 +199,13 @@ i[3-7]86-*-linux*aout*) targ_emul=i386linux
i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
i[3-7]86-*-linux-*) targ_emul=elf_i386
targ_extra_emuls=i386linux
- targ64_extra_emuls="elf_x86_64 elf_l1om"
+ targ64_extra_emuls="elf_x86_64 elf32_x86_64 elf_l1om"
targ64_extra_libpath=elf_x86_64
+ targ_extra_libpath=elf32_x86_64
tdir_i386linux=${targ_alias}aout ;;
x86_64-*-linux-*) targ_emul=elf_x86_64
- targ_extra_emuls="elf_i386 i386linux elf_l1om"
- targ_extra_libpath=elf_i386
+ targ_extra_emuls="elf32_x86_64 elf_i386 i386linux elf_l1om"
+ targ_extra_libpath="elf_i386 elf32_x86_64"
tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'` ;;
i[3-7]86-*-sysv[45]*) targ_emul=elf_i386 ;;
diff --git a/ld/emulparams/elf32_x86_64.sh b/ld/emulparams/elf32_x86_64.sh
new file mode 100644
index 0000000..6dc13fc
--- /dev/null
+++ b/ld/emulparams/elf32_x86_64.sh
@@ -0,0 +1,35 @@
+SCRIPT_NAME=elf
+ELFSIZE=32
+OUTPUT_FORMAT="elf32-x86-64"
+NO_REL_RELOCS=yes
+TEXT_START_ADDR=0x400000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
+ARCH="i386:x64-32"
+MACHINE=
+NOP=0x90909090
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
+NO_SMALL_DATA=yes
+LARGE_SECTIONS=yes
+SEPARATE_GOTPLT=24
+IREL_IN_PLT=
+
+if [ "x${host}" = "x${target}" ]; then
+ case " $EMULATION_LIBPATH " in
+ *" ${EMULATION_NAME} "*)
+ NATIVE=yes
+ esac
+fi
+
+# Linux modifies the default library search path to first include
+# a 32-bit specific directory.
+case "$target" in
+ x86_64*-linux*|i[3-7]86-*-linux-*)
+ case "$EMULATION_NAME" in
+ *32*) LIBPATH_SUFFIX=32 ;;
+ *64*) LIBPATH_SUFFIX=64 ;;
+ esac
+ ;;
+esac