aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlexander von Gluck IV <kallisti5@unixzen.com>2021-09-02 12:19:14 +0100
committerNick Clifton <nickc@redhat.com>2021-09-02 12:19:14 +0100
commitd85e70a35bffa755fd3e9f4ccc6bf6c64953e85d (patch)
tree4fe42b81c0faa1a152338545a5318863f7fbbc41 /ld
parent718aefcf55cc5a9de3f73d9a37259f8f792b1cef (diff)
downloadgdb-d85e70a35bffa755fd3e9f4ccc6bf6c64953e85d.zip
gdb-d85e70a35bffa755fd3e9f4ccc6bf6c64953e85d.tar.gz
gdb-d85e70a35bffa755fd3e9f4ccc6bf6c64953e85d.tar.bz2
Add support for the haiku operating system. These are the os support patches we have been grooming and maintaining for quite a few years over on git.haiku-os.org. All of these architectures are working and most have been stable for quite some time.
Diffstat (limited to 'ld')
-rw-r--r--ld/Makefile.am6
-rw-r--r--ld/Makefile.in12
-rwxr-xr-xld/configure4
-rw-r--r--ld/configure.tgt20
-rw-r--r--ld/emulparams/aarch64haiku.sh39
-rw-r--r--ld/emulparams/armelf_haiku.sh33
-rw-r--r--ld/emulparams/elf32ppchaiku.sh7
-rw-r--r--ld/emulparams/elf_haiku.sh1
-rw-r--r--ld/emulparams/elf_i386_haiku.sh7
-rw-r--r--ld/emulparams/elf_mipsel_haiku.sh3
-rw-r--r--ld/emulparams/elf_x86_64_haiku.sh2
11 files changed, 132 insertions, 2 deletions
diff --git a/ld/Makefile.am b/ld/Makefile.am
index f8e9932..0abbde4 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -167,6 +167,7 @@ ALL_EMULATION_SOURCES = \
earmelf.c \
earmelf_fbsd.c \
earmelf_fuchsia.c \
+ earmelf_haiku.c \
earmelf_linux.c \
earmelf_linux_eabi.c \
earmelf_linux_fdpiceabi.c \
@@ -258,6 +259,7 @@ ALL_EMULATION_SOURCES = \
eelf32ppc.c \
eelf32ppc_fbsd.c \
eelf32ppclinux.c \
+ eelf32ppchaiku.c \
eelf32ppcnto.c \
eelf32ppcsim.c \
eelf32ppcvxworks.c \
@@ -279,9 +281,11 @@ ALL_EMULATION_SOURCES = \
eelf_i386.c \
eelf_i386_be.c \
eelf_i386_fbsd.c \
+ eelf_i386_haiku.c \
eelf_i386_ldso.c \
eelf_i386_sol2.c \
eelf_i386_vxworks.c \
+ eelf_mipsel_haiku.c \
eelf_iamcu.c \
eelf_s390.c \
eh8300elf.c \
@@ -383,6 +387,7 @@ ALL_64_EMULATION_SOURCES = \
eaarch64cloudabib.c \
eaarch64fbsd.c \
eaarch64fbsdb.c \
+ eaarch64haiku.c \
eaarch64linux.c \
eaarch64linuxb.c \
eaarch64linux32.c \
@@ -454,6 +459,7 @@ ALL_64_EMULATION_SOURCES = \
eelf_k1om_fbsd.c \
eelf_x86_64.c \
eelf_x86_64_cloudabi.c \
+ eelf_x86_64_haiku.c \
eelf_x86_64_fbsd.c \
eelf_x86_64_sol2.c \
ehppa64linux.c \
diff --git a/ld/Makefile.in b/ld/Makefile.in
index ef2e99e..2b83b5e 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -657,6 +657,7 @@ ALL_EMULATION_SOURCES = \
earmelf.c \
earmelf_fbsd.c \
earmelf_fuchsia.c \
+ earmelf_haiku.c \
earmelf_linux.c \
earmelf_linux_eabi.c \
earmelf_linux_fdpiceabi.c \
@@ -747,6 +748,7 @@ ALL_EMULATION_SOURCES = \
eelf32or1k_linux.c \
eelf32ppc.c \
eelf32ppc_fbsd.c \
+ eelf32ppchaiku.c \
eelf32ppclinux.c \
eelf32ppcnto.c \
eelf32ppcsim.c \
@@ -769,10 +771,12 @@ ALL_EMULATION_SOURCES = \
eelf_i386.c \
eelf_i386_be.c \
eelf_i386_fbsd.c \
+ eelf_i386_haiku.c \
eelf_i386_ldso.c \
eelf_i386_sol2.c \
eelf_i386_vxworks.c \
eelf_iamcu.c \
+ eelf_mipsel_haiku.c \
eelf_s390.c \
eh8300elf.c \
eh8300elf_linux.c \
@@ -872,6 +876,7 @@ ALL_64_EMULATION_SOURCES = \
eaarch64cloudabib.c \
eaarch64fbsd.c \
eaarch64fbsdb.c \
+ eaarch64haiku.c \
eaarch64linux.c \
eaarch64linuxb.c \
eaarch64linux32.c \
@@ -943,6 +948,7 @@ ALL_64_EMULATION_SOURCES = \
eelf_k1om_fbsd.c \
eelf_x86_64.c \
eelf_x86_64_cloudabi.c \
+ eelf_x86_64_haiku.c \
eelf_x86_64_fbsd.c \
eelf_x86_64_sol2.c \
ehppa64linux.c \
@@ -1242,6 +1248,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64elfb.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64fbsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64fbsdb.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64haiku.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linux.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linux32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linux32b.Po@am__quote@
@@ -1261,6 +1268,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_fbsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_fuchsia.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_haiku.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_linux.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_linux_eabi.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_linux_fdpiceabi.Po@am__quote@
@@ -1379,6 +1387,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32or1k_linux.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppc_fbsd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppchaiku.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppclinux.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppcnto.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppcsim.Po@am__quote@
@@ -1433,6 +1442,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_be.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_fbsd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_haiku.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_ldso.Po@am__quote@
@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@
@@ -2437,6 +2447,7 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_sol2.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_vxworks.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_iamcu.Pc@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_mipsel_haiku.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_s390.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eh8300elf.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eh8300elf_linux.Pc@am__quote@
@@ -2598,6 +2609,7 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_k1om_fbsd.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@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_haiku.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_fbsd.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_x86_64_sol2.Pc@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ehppa64linux.Pc@am__quote@
diff --git a/ld/configure b/ld/configure
index 33b7de3..6ea123b 100755
--- a/ld/configure
+++ b/ld/configure
@@ -10616,7 +10616,7 @@ haiku*)
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
@@ -14266,7 +14266,7 @@ haiku*)
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=yes
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
diff --git a/ld/configure.tgt b/ld/configure.tgt
index d46ed62..5411104 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -77,6 +77,9 @@ 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-*-haiku*) targ_emul=aarch64haiku
+ targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb armelf_haiku $targ_extra_libpath"
+ ;;
alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
targ_emul=elf64alpha_fbsd
targ_extra_emuls="elf64alpha alpha"
@@ -199,6 +202,9 @@ arm*-*-conix*) targ_emul=armelf
arm*-*-fuchsia*) targ_emul=armelf_fuchsia
targ_extra_emuls="armelfb_fuchsia armelf armelfb"
;;
+arm*-*-haiku*) arg_emul=armelf_haiku
+ targ_extra_emuls=armelf
+ ;;
avr-*-*) targ_emul=avr2
targ_extra_emuls="avr1 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega1 avrxmega2 avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7 avrtiny"
;;
@@ -395,6 +401,8 @@ i[3-7]86-*-beospe*) targ_emul=i386beos
;;
i[3-7]86-*-beos*) targ_emul=elf_i386_be
;;
+i[3-7]86-*-haiku*) targ_emul=elf_i386_haiku
+ ;;
i[3-7]86-*-vxworks*) targ_emul=elf_i386_vxworks
;;
i[3-7]86-*-chaos) targ_emul=elf_i386_chaos
@@ -448,6 +456,8 @@ m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf
;;
m68*-*-netbsd*) targ_emul=m68kelfnbsd
;;
+m68*-*-haiku*) targ_emul=m68kelf
+ ;;
m68*-*-*) targ_emul=m68kelf
;;
mcore-*-pe) targ_emul=mcorepe ;
@@ -477,6 +487,9 @@ mips*-sgi-irix6*) targ_emul=elf32bmipn32
targ_extra_emuls="elf32bsmip elf64bmip"
targ_extra_libpath=$targ_extra_emuls
;;
+mips*el-*-haiku*) targ_emul=elf_mipsel_haiku
+ targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
+ ;;
mips*el-*-netbsd*) targ_emul=elf32ltsmip
targ_extra_emuls="elf32btsmip elf64ltsmip elf64btsmip"
;;
@@ -733,6 +746,8 @@ powerpc-*-aix*) targ_emul=aixppc
powerpc-*-beos*) targ_emul=aixppc
targ_extra_ofiles=
;;
+powerpc-*-haiku*) targ_emul=elf32ppchaiku
+ ;;
powerpc-*-windiss*) targ_emul=elf32ppcwindiss
;;
pru*-*-*) targ_emul=pruelf
@@ -869,6 +884,8 @@ sparc64-*-solaris2* | sparcv9-*-solaris2*)
targ_extra_libpath=$targ_extra_emuls
tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
;;
+sparc64-*-haiku*) targ_emul=elf64_sparc
+ ;;
sparc64-*-*) targ_emul=elf64_sparc
;;
sparc*-*-linux-*) targ_emul=elf32_sparc
@@ -936,6 +953,9 @@ x86_64-*-rdos*) targ_emul=elf64rdos
;;
x86_64-*-cloudabi*) targ_emul=elf_x86_64_cloudabi
;;
+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"
diff --git a/ld/emulparams/aarch64haiku.sh b/ld/emulparams/aarch64haiku.sh
new file mode 100644
index 0000000..b0298ec
--- /dev/null
+++ b/ld/emulparams/aarch64haiku.sh
@@ -0,0 +1,39 @@
+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=elf
+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 = .);';
+
+# AArch64 does not support .s* sections.
+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)) }'
+# Ensure each PLT entry is aligned to a cache line.
+PLT=".plt ${RELOCATING-0} : ALIGN(16) { *(.plt)${RELOCATING+${IREL_IN_PLT+ *(.iplt)}} }"
+
+. ${srcdir}/emulparams/elf_haiku.sh
diff --git a/ld/emulparams/armelf_haiku.sh b/ld/emulparams/armelf_haiku.sh
new file mode 100644
index 0000000..c42060f
--- /dev/null
+++ b/ld/emulparams/armelf_haiku.sh
@@ -0,0 +1,33 @@
+ARCH=arm
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-littlearm"
+BIG_OUTPUT_FORMAT="elf32-bigarm"
+LITTLE_OUTPUT_FORMAT="elf32-littlearm"
+MAXPAGESIZE=0x8000
+COMMONPAGESIZE=0x1000
+TEMPLATE_NAME=elf
+EXTRA_EM_FILE=armelf
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
+
+DATA_START_SYMBOLS='__data_start = . ;';
+OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
+OTHER_BSS_SYMBOLS='__bss_start__ = .;'
+OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
+OTHER_END_SYMBOLS='__end__ = . ;'
+OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
+
+# Use the ARM ABI-compliant exception-handling sections.
+OTHER_READONLY_SECTIONS="
+ .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) }
+ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_start = .); }
+ .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) }
+ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); }"
+
+TEXT_START_ADDR=0x00008000
+TARGET2_TYPE=got-rel
+
+# ARM does not support .s* sections.
+NO_SMALL_DATA=yes
+
+. ${srcdir}/emulparams/elf_haiku.sh
diff --git a/ld/emulparams/elf32ppchaiku.sh b/ld/emulparams/elf32ppchaiku.sh
new file mode 100644
index 0000000..547e5c8
--- /dev/null
+++ b/ld/emulparams/elf32ppchaiku.sh
@@ -0,0 +1,7 @@
+. ${srcdir}/emulparams/elf32ppc.sh
+. ${srcdir}/emulparams/elf_haiku.sh
+TEXT_START_ADDR=0x200000
+MAXPAGESIZE=0x1000
+GENERATE_SHLIB_SCRIPT=yes
+BSS_PLT=
+LIBPATH_SUFFIX=
diff --git a/ld/emulparams/elf_haiku.sh b/ld/emulparams/elf_haiku.sh
new file mode 100644
index 0000000..401eedc
--- /dev/null
+++ b/ld/emulparams/elf_haiku.sh
@@ -0,0 +1 @@
+ELF_INTERPRETER_NAME=\"/system/runtime_loader\"
diff --git a/ld/emulparams/elf_i386_haiku.sh b/ld/emulparams/elf_i386_haiku.sh
new file mode 100644
index 0000000..6c4001e
--- /dev/null
+++ b/ld/emulparams/elf_i386_haiku.sh
@@ -0,0 +1,7 @@
+source_sh ${srcdir}/emulparams/elf_i386.sh
+source_sh ${srcdir}/emulparams/elf_haiku.sh
+TEXT_START_ADDR=0x200000
+NONPAGED_TEXT_START_ADDR=0x200000
+MAXPAGESIZE=0x1000
+NOP=0x90909090
+OUTPUT_FORMAT="elf32-i386"
diff --git a/ld/emulparams/elf_mipsel_haiku.sh b/ld/emulparams/elf_mipsel_haiku.sh
new file mode 100644
index 0000000..ab38e23
--- /dev/null
+++ b/ld/emulparams/elf_mipsel_haiku.sh
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/elf32lmip.sh
+. ${srcdir}/emulparams/elf_haiku.sh
+
diff --git a/ld/emulparams/elf_x86_64_haiku.sh b/ld/emulparams/elf_x86_64_haiku.sh
new file mode 100644
index 0000000..f049559
--- /dev/null
+++ b/ld/emulparams/elf_x86_64_haiku.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/elf_x86_64.sh
+. ${srcdir}/emulparams/elf_haiku.sh