diff -rupN old/bfd/config.bfd new/bfd/config.bfd
--- old/bfd/config.bfd	2018-07-09 15:44:53.000000000 +0800
+++ new/bfd/config.bfd	2022-04-07 21:28:47.427331679 +0800
@@ -264,6 +264,11 @@ case "${targ}" in
     targ_selvecs="aarch64_elf64_le_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_be_vec arm_elf32_le_vec"
     want64=true
     ;;
+  aarch64-*-lyos*)
+    targ_defvec=aarch64_elf64_le_vec
+    targ_selvecs=aarch64_elf32_le_vec
+    want64=true
+    ;;    
   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
     targ_defvec=alpha_elf64_fbsd_vec
     targ_selvecs="alpha_elf64_vec alpha_ecoff_le_vec"
@@ -358,6 +363,10 @@ case "${targ}" in
     targ_defvec=arm_elf32_le_vec
     targ_selvecs="arm_elf32_be_vec"
     ;;
+  arm-*-lyos*)
+    targ_defvec=arm_elf32_le_vec
+    targ_selvecs=arm_elf32_be_vec
+    ;;
   arm-*-nto* | nto*arm*)
     targ_defvec=arm_elf32_le_vec
     targ_selvecs=arm_elf32_be_vec
@@ -558,6 +567,10 @@ case "${targ}" in
     targ_defvec=i386_elf32_vec
     targ_selvecs="iamcu_elf32_vec i386_coff_vec"
     ;;
+  i[3-7]86-*-lyos*)
+    targ_defvec=i386_elf32_vec
+    targ_selvecs=
+    ;;
   i[3-7]86-*-solaris2*)
     targ_defvec=i386_elf32_sol2_vec
     targ_selvecs="iamcu_elf32_vec i386_coff_vec i386_pei_vec"
@@ -691,6 +704,11 @@ case "${targ}" in
     targ_selvecs="i386_elf32_vec iamcu_elf32_vec x86_64_elf32_vec i386_pei_vec x86_64_pei_vec l1om_elf64_vec k1om_elf64_vec"
     want64=true
     ;;
+  x86_64-*-lyos*)
+    targ_defvec=x86_64_elf64_vec
+    targ_selvecs=i386_elf32_vec
+    want64=true
+    ;;
   x86_64-*-nacl*)
     targ_defvec=x86_64_elf32_nacl_vec
     targ_selvecs="i386_elf32_nacl_vec x86_64_elf64_nacl_vec arm_elf32_nacl_be_vec arm_elf32_nacl_le_vec"
@@ -1186,6 +1204,11 @@ case "${targ}" in
     ;;
 #endif
 
+  riscv-*-lyos*)
+    targ_defvec=riscv_elf32_vec
+    targ_selvecs="riscv_elf32_vec riscv_elf64_vec"
+    ;;
+
   rl78-*-elf)
     targ_defvec=rl78_elf32_vec
     targ_underscore=yes
diff -rupN old/config.sub new/config.sub
--- old/config.sub	2018-07-06 15:13:31.000000000 +0800
+++ new/config.sub	2021-12-31 22:46:21.580189226 +0800
@@ -1374,6 +1374,7 @@ case $os in
 	     | os2* | vos* | palmos* | uclinux* | nucleus* \
 	     | morphos* | superux* | rtmk* | windiss* \
 	     | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+        | lyos* \
 	     | skyos* | haiku* | rdos* | toppers* | drops* | es* \
 	     | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
 	     | midnightbsd*)
diff -rupN old/gas/configure.tgt new/gas/configure.tgt
--- old/gas/configure.tgt	2018-06-25 02:38:57.000000000 +0800
+++ new/gas/configure.tgt	2022-04-07 21:32:12.396497989 +0800
@@ -127,6 +127,7 @@ case ${generic_target} in
     case ${cpu}-${os} in
       aarch64*-linux-gnu_ilp32)		arch=aarch64:32 ;;
     esac ;;
+  aarch64*-*-lyos*)			fmt=elf;;
 
   alpha-*-*vms*)			fmt=evax ;;
   alpha-*-osf*)				fmt=ecoff ;;
@@ -142,6 +143,7 @@ case ${generic_target} in
   arm-*-eabi* | arm-*-rtems*)		fmt=elf em=armeabi ;;
   arm-*-symbianelf*)			fmt=elf em=symbian ;;
   arm-*-kaos*)				fmt=elf ;;
+  arm-*-lyos*)				fmt=elf ;;
   arm-*-conix*)				fmt=elf ;;
   arm-*-freebsd[89].* | armeb-*-freebsd[89].*)
 					fmt=elf  em=freebsd ;;
@@ -214,6 +216,7 @@ case ${generic_target} in
   i386-*-elf*)				fmt=elf ;;
   i386-*-fuchsia*)			fmt=elf ;;
   i386-*-kaos*)				fmt=elf ;;
+  i386-*-lyos*)				fmt=elf ;;
   i386-*-bsd*)				fmt=aout em=386bsd ;;
   i386-*-nacl*)				fmt=elf em=nacl
     case ${cpu} in
diff -rupN old/ld/configure.tgt new/ld/configure.tgt
--- old/ld/configure.tgt	2018-07-09 15:44:53.000000000 +0800
+++ new/ld/configure.tgt	2022-04-07 21:36:56.900179215 +0800
@@ -70,6 +70,8 @@ aarch64_be-*-linux*)	targ_emul=aarch64li
 aarch64-*-linux*)	targ_emul=aarch64linux
 			targ_extra_libpath="aarch64linuxb aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi"
 			targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb $targ_extra_libpath" ;;
+aarch64-*-lyos*)	targ_emul=aarch64lyos
+			targ_extra_emuls="aarch64elf $targ_extra_libpath" ;;            
 alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
 			targ_emul=elf64alpha_fbsd
 			targ_extra_emuls="elf64alpha alpha"
@@ -119,6 +121,7 @@ arm-*-elf | arm*-*-eabi* | arm-*-rtems*)
 			targ_emul=armelf ;;
 arm*-*-symbianelf*)	targ_emul=armsymbian;;
 arm-*-kaos*)		targ_emul=armelf ;;
+arm-*-lyos*)		targ_emul=armelf ;;
 arm9e-*-elf)		targ_emul=armelf ;;
 arm*b-*-linux-*eabi*)	targ_emul=armelfb_linux_eabi
 			targ_extra_emuls=armelf_linux_eabi
@@ -256,6 +259,10 @@ 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"
 			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'` ;;
+x86_64-*-lyos*)
+			targ_emul=elf_x86_64
+			targ_extra_emuls=elf_i386
+			;;
 i[3-7]86-*-redox*)	targ_emul=elf_i386
 			targ_extra_emuls=elf_x86_64 ;;
 x86_64-*-redox*)	targ_emul=elf_x86_64
@@ -312,6 +319,7 @@ x86_64-*-elf* | x86_64-*-rtems* | x86_64
 			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
 			;;
 i[3-7]86-*-kaos*)	targ_emul=elf_i386 ;;
+i[3-7]86-*-lyos*)	targ_emul=elf_i386 ;;
 i[3-7]86-*-dragonfly*)	targ_emul=elf_i386
 			targ_extra_emuls="elf_iamcu i386bsd" ;;
 x86_64-*-dragonfly*)	targ_emul=elf_x86_64
diff -rupN old/ld/emulparams/aarch64lyos.sh new/ld/emulparams/aarch64lyos.sh
--- old/ld/emulparams/aarch64lyos.sh	1970-01-01 08:00:00.000000000 +0800
+++ new/ld/emulparams/aarch64lyos.sh	2022-04-07 21:38:46.851265757 +0800
@@ -0,0 +1,44 @@
+ARCH=aarch64
+MACHINE=
+NOP=0x1f2003d5
+
+SCRIPT_NAME=elf
+ELFSIZE=64
+OUTPUT_FORMAT="elf64-littleaarch64"
+BIG_OUTPUT_FORMAT="elf64-bigaarch64"
+LITTLE_OUTPUT_FORMAT="elf64-littleaarch64"
+NO_REL_RELOCS=yes
+
+TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=aarch64elf
+
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
+
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
+SEPARATE_GOTPLT=24
+IREL_IN_PLT=
+
+TEXT_START_ADDR=0x400000
+
+DATA_START_SYMBOLS='PROVIDE (__data_start = .);';
+
+NO_SMALL_DATA=yes
+
+OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__bss_start__ = .${CREATE_SHLIB+)};"
+OTHER_BSS_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_end__ = .${CREATE_SHLIB+)}; ${CREATE_SHLIB+PROVIDE (}__bss_end__ = .${CREATE_SHLIB+)};"
+OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};"
+
+OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
+ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }'
+
+PLT=".plt          ${RELOCATING-0} : ALIGN(16) { *(.plt)${RELOCATING+${IREL_IN_PLT+ *(.iplt)}} }"
+
+case "$target" in
+  aarch64*-lyos*)
+    case "$EMULATION_NAME" in
+      aarch64lyos*) LIBPATH_SUFFIX=64 ;;
+    esac
+    ;;
+esac
diff -rupN old/ld/emulparams/elf64lriscv.sh new/ld/emulparams/elf64lriscv.sh
--- old/ld/emulparams/elf64lriscv.sh	2018-06-25 02:38:57.000000000 +0800
+++ new/ld/emulparams/elf64lriscv.sh	2021-12-31 22:46:21.580189226 +0800
@@ -12,4 +12,7 @@ case "$target" in
 	LIBPATH_SUFFIX="64/lp64d 64";;
     esac
     ;;
+  riscv64*-lyos*)
+    TEXT_START_ADDR=0x20000000
+    ;;
 esac
diff -rupN old/ld/emulparams/elf_i386.sh new/ld/emulparams/elf_i386.sh
--- old/ld/emulparams/elf_i386.sh	2018-06-25 02:38:57.000000000 +0800
+++ new/ld/emulparams/elf_i386.sh	2021-12-31 22:46:21.580189226 +0800
@@ -34,4 +34,7 @@ case "$target" in
 	;;
     esac
     ;;
+  i[3-7]86*-lyos*)
+    TEXT_START_ADDR=0x40000000
+    ;;
 esac
diff -rupN old/ld/emulparams/elf_x86_64.sh new/ld/emulparams/elf_x86_64.sh
--- old/ld/emulparams/elf_x86_64.sh	2018-06-25 02:38:57.000000000 +0800
+++ new/ld/emulparams/elf_x86_64.sh	2021-12-31 22:46:21.580189226 +0800
@@ -37,7 +37,7 @@ fi
 # Linux/Solaris modify the default library search path to first include
 # a 64-bit specific directory.
 case "$target" in
-  x86_64*-linux*|i[3-7]86-*-linux-*)
+  x86_64*-linux*|i[3-7]86-*-linux-*|x86_64*-lyos*)
     case "$EMULATION_NAME" in
       *64*)
 	LIBPATH_SUFFIX=64
diff -rupN old/ld/Makefile.am new/ld/Makefile.am
--- old/ld/Makefile.am	2018-06-25 02:38:57.000000000 +0800
+++ new/ld/Makefile.am	2022-04-07 21:34:50.529399562 +0800
@@ -396,6 +396,7 @@ ALL_64_EMULATION_SOURCES = \
 	eaarch64linuxb.c \
 	eaarch64linux32.c \
 	eaarch64linux32b.c \
+	eaarch64lyos.c \
 	eelf32_x86_64.c \
 	eelf32_x86_64_nacl.c \
 	eelf32b4300.c \
@@ -1542,6 +1543,10 @@ eaarch64linux32b.c: $(srcdir)/emulparams
   $(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \
   $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 
+eaarch64lyos.c: $(srcdir)/emulparams/aarch64lyos.sh \
+  $(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \
+  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+
 epc532macha.c: $(srcdir)/emulparams/pc532macha.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
 
