From e961c696dcb226d5b58bd8b17b1cf5491d87f846 Mon Sep 17 00:00:00 2001
From: Jan Beulich <jbeulich@suse.com>
Date: Thu, 24 Mar 2022 09:38:55 +0100
Subject: [PATCH] x86: drop L1OM/K1OM support from ld

This was only rudimentary support anyway; none of the sub-architecture
specific insns were ever supported.
---
 ld/Makefile.am                 |  8 -------
 ld/Makefile.in                 | 12 -----------
 ld/configure.tgt               | 24 ++++++++++-----------
 ld/emulparams/elf_k1om.sh      | 39 ----------------------------------
 ld/emulparams/elf_k1om_fbsd.sh |  3 ---
 ld/emulparams/elf_l1om.sh      | 39 ----------------------------------
 ld/emulparams/elf_l1om_fbsd.sh |  3 ---
 ld/po/BLD-POTFILES.in          |  4 ----
 8 files changed, 12 insertions(+), 120 deletions(-)
 delete mode 100644 ld/emulparams/elf_k1om.sh
 delete mode 100644 ld/emulparams/elf_k1om_fbsd.sh
 delete mode 100644 ld/emulparams/elf_l1om.sh
 delete mode 100644 ld/emulparams/elf_l1om_fbsd.sh

diff --git a/ld/Makefile.am b/ld/Makefile.am
index b55a873d927..e53bef13bb8 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -454,10 +454,6 @@ ALL_64_EMULATION_SOURCES = \
 	eelf64rdos.c \
 	eelf64tilegx.c \
 	eelf64tilegx_be.c \
-	eelf_k1om.c \
-	eelf_k1om_fbsd.c \
-	eelf_l1om.c \
-	eelf_l1om_fbsd.c \
 	eelf_mipsel_haiku.c \
 	eelf_x86_64.c \
 	eelf_x86_64_cloudabi.c \
@@ -949,10 +945,6 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64rdos.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64tilegx.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64tilegx_be.Pc@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_k1om.Pc@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_k1om_fbsd.Pc@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_l1om.Pc@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_l1om_fbsd.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_mipsel_haiku.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_cloudabi.Pc@am__quote@
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 61e93eeaf1e..811490d69e3 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -944,10 +944,6 @@ ALL_64_EMULATION_SOURCES = \
 	eelf64rdos.c \
 	eelf64tilegx.c \
 	eelf64tilegx_be.c \
-	eelf_k1om.c \
-	eelf_k1om_fbsd.c \
-	eelf_l1om.c \
-	eelf_l1om_fbsd.c \
 	eelf_mipsel_haiku.c \
 	eelf_x86_64.c \
 	eelf_x86_64_cloudabi.c \
@@ -1452,10 +1448,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_sol2.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_vxworks.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_iamcu.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_k1om.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_k1om_fbsd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_l1om.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_l1om_fbsd.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_mipsel_haiku.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_s390.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64.Po@am__quote@
@@ -2616,10 +2608,6 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64rdos.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64tilegx.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64tilegx_be.Pc@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_k1om.Pc@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_k1om_fbsd.Pc@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_l1om.Pc@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_l1om_fbsd.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_mipsel_haiku.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_cloudabi.Pc@am__quote@
diff --git a/ld/configure.tgt b/ld/configure.tgt
index c7acf3f11ff..89f4a99c66e 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -326,7 +326,7 @@ i[3-7]86-*-bsdi*)	targ_emul=i386bsd
 			;;
 i[3-7]86-*-linux-*)	targ_emul=elf_i386
 			targ_extra_emuls="elf_iamcu"
-			targ64_extra_emuls="elf_x86_64 elf32_x86_64 elf_l1om elf_k1om"
+			targ64_extra_emuls="elf_x86_64 elf32_x86_64"
 			targ64_extra_libpath="elf_x86_64 elf32_x86_64"
 			;;
 i[3-7]86-*-redox*)	targ_emul=elf_i386
@@ -336,7 +336,7 @@ i[3-7]86-*-sysv[45]*)	targ_emul=elf_i386
 			targ_extra_emuls=elf_iamcu
 			;;
 i[3-7]86-*-solaris2*)	targ_emul=elf_i386_sol2
-			targ_extra_emuls="elf_i386_ldso elf_i386 elf_iamcu elf_x86_64_sol2 elf_x86_64 elf_l1om elf_k1om"
+			targ_extra_emuls="elf_i386_ldso elf_i386 elf_iamcu elf_x86_64_sol2 elf_x86_64"
 			targ_extra_libpath=$targ_extra_emuls
 			;;
 i[3-7]86-*-unixware)	targ_emul=elf_i386
@@ -957,27 +957,27 @@ x86_64-*-haiku*)	targ_emul=elf_x86_64_haiku
 			targ_extra_emuls="elf_x86_64 elf_i386_haiku"
 			;;
 x86_64-*-linux-gnux32)	targ_emul=elf32_x86_64
-			targ_extra_emuls="elf_x86_64 elf_i386 elf_iamcu elf_l1om elf_k1om"
-			targ_extra_libpath="elf_i386 elf_iamcu elf_x86_64 elf_l1om elf_k1om"
+			targ_extra_emuls="elf_x86_64 elf_i386 elf_iamcu"
+			targ_extra_libpath="elf_i386 elf_iamcu elf_x86_64"
 			tdir_elf_iamcu=`echo ${targ_alias} | sed -e 's/x86_64/i386/' -e 's/-linux-gnux32/-linux-gnu/'`
 			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/' -e 's/-linux-gnux32/-linux-gnu/'`
 			;;
 x86_64-*-linux-*)	targ_emul=elf_x86_64
-			targ_extra_emuls="elf32_x86_64 elf_i386 elf_iamcu elf_l1om elf_k1om"
-			targ_extra_libpath="elf_i386 elf32_x86_64 elf_l1om elf_k1om"
+			targ_extra_emuls="elf32_x86_64 elf_i386 elf_iamcu"
+			targ_extra_libpath="elf_i386 elf32_x86_64"
 			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
 			;;
 x86_64-*-redox*)	targ_emul=elf_x86_64
 			targ_extra_emuls=elf_i386
 			;;
 x86_64-*-solaris2*)	targ_emul=elf_x86_64_sol2
-			targ_extra_emuls="elf_x86_64 elf_i386_sol2 elf_i386_ldso elf_i386 elf_iamcu elf_l1om elf_k1om"
+			targ_extra_emuls="elf_x86_64 elf_i386_sol2 elf_i386_ldso elf_i386 elf_iamcu"
 			targ_extra_libpath=$targ_extra_emuls
 			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
 			;;
 x86_64-*-netbsd* | x86_64-*-openbsd*)
 			targ_emul=elf_x86_64
-			targ_extra_emuls="elf_i386 elf_iamcu elf_l1om elf_k1om"
+			targ_extra_emuls="elf_i386 elf_iamcu"
 			tdir_elf_iamcu=`echo ${targ_alias} | \
 			    sed -e 's/x86_64/i386/' -e 's/aout//'`
 			tdir_elf_i386=`echo ${targ_alias} | \
@@ -985,16 +985,16 @@ x86_64-*-netbsd* | x86_64-*-openbsd*)
 			;;
 x86_64-*-elf* | x86_64-*-rtems* | x86_64-*-fuchsia* | x86_64-*-genode*)
 			targ_emul=elf_x86_64
-			targ_extra_emuls="elf_i386 elf_iamcu elf32_x86_64 elf_l1om elf_k1om"
-			targ_extra_libpath="elf_i386 elf_iamcu elf32_x86_64 elf_l1om elf_k1om"
+			targ_extra_emuls="elf_i386 elf_iamcu elf32_x86_64"
+			targ_extra_libpath="elf_i386 elf_iamcu elf32_x86_64"
 			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
 			;;
 x86_64-*-dragonfly*)	targ_emul=elf_x86_64
-			targ_extra_emuls="elf_i386 elf_iamcu elf_l1om elf_k1om"
+			targ_extra_emuls="elf_i386 elf_iamcu"
 			;;
 x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
 			targ_emul=elf_x86_64_fbsd
-			targ_extra_emuls="elf_i386_fbsd elf_x86_64 elf_i386 elf_iamcu elf_l1om elf_l1om_fbsd elf_k1om elf_k1om_fbsd"
+			targ_extra_emuls="elf_i386_fbsd elf_x86_64 elf_i386 elf_iamcu"
 			targ_extra_libpath="elf_i386_fbsd"
 			tdir_elf_i386_fbsd=`echo ${targ_alias} \
 			    | sed -e 's/x86_64/i386/'`
diff --git a/ld/emulparams/elf_k1om.sh b/ld/emulparams/elf_k1om.sh
deleted file mode 100644
index b27f5ea861a..00000000000
--- a/ld/emulparams/elf_k1om.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-source_sh ${srcdir}/emulparams/plt_unwind.sh
-source_sh ${srcdir}/emulparams/extern_protected_data.sh
-source_sh ${srcdir}/emulparams/dynamic_undefined_weak.sh
-source_sh ${srcdir}/emulparams/call_nop.sh
-SCRIPT_NAME=elf
-ELFSIZE=64
-OUTPUT_FORMAT="elf64-k1om"
-NO_REL_RELOCS=yes
-TEXT_START_ADDR=0x400000
-MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
-COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
-ARCH="k1om"
-MACHINE=
-TEMPLATE_NAME=elf
-EXTRA_EM_FILE="elf-x86"
-GENERATE_SHLIB_SCRIPT=yes
-GENERATE_PIE_SCRIPT=yes
-NO_SMALL_DATA=yes
-LARGE_SECTIONS=yes
-LARGE_BSS_AFTER_BSS=
-SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 24 ? 24 : 0"
-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 64-bit specific directory.
-case "$target" in
-  *k1om*-linux*)
-    case "$EMULATION_NAME" in
-      *k1om*) LIBPATH_SUFFIX=64 ;;
-    esac
-    ;;
-esac
diff --git a/ld/emulparams/elf_k1om_fbsd.sh b/ld/emulparams/elf_k1om_fbsd.sh
deleted file mode 100644
index 1ffe059f4f2..00000000000
--- a/ld/emulparams/elf_k1om_fbsd.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-source_sh ${srcdir}/emulparams/elf_k1om.sh
-source_sh ${srcdir}/emulparams/elf_fbsd.sh
-OUTPUT_FORMAT="elf64-k1om-freebsd"
diff --git a/ld/emulparams/elf_l1om.sh b/ld/emulparams/elf_l1om.sh
deleted file mode 100644
index 70d76829d7b..00000000000
--- a/ld/emulparams/elf_l1om.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-source_sh ${srcdir}/emulparams/plt_unwind.sh
-source_sh ${srcdir}/emulparams/extern_protected_data.sh
-source_sh ${srcdir}/emulparams/dynamic_undefined_weak.sh
-source_sh ${srcdir}/emulparams/call_nop.sh
-SCRIPT_NAME=elf
-ELFSIZE=64
-OUTPUT_FORMAT="elf64-l1om"
-NO_REL_RELOCS=yes
-TEXT_START_ADDR=0x400000
-MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
-COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
-ARCH="l1om"
-MACHINE=
-TEMPLATE_NAME=elf
-EXTRA_EM_FILE="elf-x86"
-GENERATE_SHLIB_SCRIPT=yes
-GENERATE_PIE_SCRIPT=yes
-NO_SMALL_DATA=yes
-LARGE_SECTIONS=yes
-LARGE_BSS_AFTER_BSS=
-SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 24 ? 24 : 0"
-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 64-bit specific directory.
-case "$target" in
-  *l1om*-linux*)
-    case "$EMULATION_NAME" in
-      *l1om*) LIBPATH_SUFFIX=64 ;;
-    esac
-    ;;
-esac
diff --git a/ld/emulparams/elf_l1om_fbsd.sh b/ld/emulparams/elf_l1om_fbsd.sh
deleted file mode 100644
index 0d52b60722a..00000000000
--- a/ld/emulparams/elf_l1om_fbsd.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-source_sh ${srcdir}/emulparams/elf_l1om.sh
-source_sh ${srcdir}/emulparams/elf_fbsd.sh
-OUTPUT_FORMAT="elf64-l1om-freebsd"
diff --git a/ld/po/BLD-POTFILES.in b/ld/po/BLD-POTFILES.in
index 9f9500d8cb4..f2703a396ab 100644
--- a/ld/po/BLD-POTFILES.in
+++ b/ld/po/BLD-POTFILES.in
@@ -207,10 +207,6 @@ eelf_i386_ldso.c
 eelf_i386_sol2.c
 eelf_i386_vxworks.c
 eelf_iamcu.c
-eelf_k1om.c
-eelf_k1om_fbsd.c
-eelf_l1om.c
-eelf_l1om_fbsd.c
 eelf_mipsel_haiku.c
 eelf_s390.c
 eelf_x86_64.c