From 8248066f63eb3c75ed623d5f6266994cba567db4 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 21 Mar 2008 21:56:45 +0000 Subject: [PATCH] Applied Haiku related changes from non-legacy binutils. Still untested. git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@24510 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- legacy/binutils/bfd/config.bfd | 11 +++++++++++ legacy/binutils/bfd/elf32-ppc.c | 2 +- legacy/binutils/gas/configure.tgt | 3 +++ legacy/binutils/ld/Makefile.am | 8 ++++++++ legacy/binutils/ld/configure.tgt | 4 ++++ legacy/binutils/gas/config/tc-i386.c | 3 ++- legacy/binutils/gas/config/te-haiku.h | 10 ++++++++++ 7 files changed, 39 insertions(+), 2 deletions(-) diff --git a/legacy/binutils/bfd/config.bfd b/legacy/binutils/bfd/config.bfd index 188c3ab..844f0aa 100644 --- a/legacy/binutils/bfd/config.bfd +++ b/legacy/binutils/bfd/config.bfd @@ -595,6 +595,9 @@ targ_selvecs="i386pe_vec i386pei_vec" targ_cflags=-DDT_RELCOUNT_IS_UNKNOWN_ON_TARGET ;; + i[3-7]86-*-haiku*) + targ_defvec=bfd_elf32_i386_vec + ;; i[3-7]86-*-interix*) targ_defvec=i386pei_vec targ_selvecs="i386pe_vec" @@ -792,6 +795,10 @@ targ_defvec=bfd_elf32_m68k_vec targ_selvecs=ieee_vec targ_underscore=yes + ;; + m68*-*-haiku*) + targ_defvec=bfd_elf32_m68k_vec + targ_selvecs="m68kcoff_vec ieee_vec" ;; m88*-harris-cxux* | m88*-*-dgux* | m88*-*-sysv4*) @@ -1054,6 +1061,10 @@ targ_defvec=mach_o_be_vec targ_selvecs="mach_o_be_vec mach_o_le_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec" targ_archs="bfd_powerpc_arch bfd_rs6000_arch bfd_i386_arch" + ;; + powerpc-*-haiku*) + targ_defvec=bfd_elf32_powerpc_vec + targ_cflags=-D__HAIKU_TARGET__ ;; powerpc-*-macos*) targ_defvec=pmac_xcoff_vec diff --git a/legacy/binutils/bfd/elf32-ppc.c b/legacy/binutils/bfd/elf32-ppc.c index 53d1046..0118f0b 100644 --- a/legacy/binutils/bfd/elf32-ppc.c +++ b/legacy/binutils/bfd/elf32-ppc.c @@ -7430,7 +7430,7 @@ #define TARGET_BIG_NAME "elf32-powerpc" #define ELF_ARCH bfd_arch_powerpc #define ELF_MACHINE_CODE EM_PPC -#ifdef __QNXTARGET__ +#if defined(__QNXTARGET__) || defined(__HAIKU_TARGET__) #define ELF_MAXPAGESIZE 0x1000 #else #define ELF_MAXPAGESIZE 0x10000 diff --git a/legacy/binutils/gas/configure.tgt b/legacy/binutils/gas/configure.tgt index 18026af..1fc0ee8 100644 --- a/legacy/binutils/gas/configure.tgt +++ b/legacy/binutils/gas/configure.tgt @@ -166,6 +166,7 @@ i386-*-beos*) fmt=elf em=beos ;; i386-*-coff) fmt=coff ;; i386-*-elf) fmt=elf ;; + i386-*-haiku*) fmt=elf em=haiku ;; i386-*-kaos*) fmt=elf ;; i386-*-bsd*) fmt=aout em=386bsd ;; i386-*-netbsd0.8) fmt=aout em=386bsd ;; @@ -247,6 +248,7 @@ m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;; m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;; m68k-*-psos*) fmt=elf em=psos;; + m68k-*-haiku*) fmt=elf em=haiku ;; maxq-*-coff) fmt=coff bfd_gas=yes ;; @@ -303,6 +305,7 @@ ppc-*-beos*) fmt=coff ;; ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;; ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;; + ppc-*-haiku*) fmt=elf em=haiku ;; ppc-*-linux-*) fmt=elf em=linux ;; ppc-*-solaris*) fmt=elf ;; ppc-*-rtems*) fmt=elf ;; diff --git a/legacy/binutils/ld/Makefile.am b/legacy/binutils/ld/Makefile.am index 3f5d1a6..4e651b6 100644 --- a/legacy/binutils/ld/Makefile.am +++ b/legacy/binutils/ld/Makefile.am @@ -198,6 +198,8 @@ eelf_i386_fbsd.o \ eelf_i386_ldso.o \ eelf_i386_vxworks.o \ + eelf_i386_haiku.o \ + eelf_ppc_haiku.o \ eelf_s390.o \ egld960.o \ egld960coff.o \ @@ -932,6 +934,12 @@ eelf_s390.c: $(srcdir)/emulparams/elf_s390.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)" +eelf_i386_haiku.c: $(srcdir)/emulparams/elf_i386_haiku.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf_i386_haiku "$(tdir_elf_i386_haiku)" +eelf_ppc_haiku.c: $(srcdir)/emulparams/elf_ppc_haiku.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf_ppc_haiku "$(tdir_elf_ppc_haiku)" egld960.c: $(srcdir)/emulparams/gld960.sh \ $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS} ${GENSCRIPTS} gld960 "$(tdir_gld960)" diff --git a/legacy/binutils/ld/configure.tgt b/legacy/binutils/ld/configure.tgt index d324e4e..1ac6e1d 100644 --- a/legacy/binutils/ld/configure.tgt +++ b/legacy/binutils/ld/configure.tgt @@ -221,6 +221,7 @@ targ_extra_ofiles="deffilep.o pe-dll.o" ;; 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 ;; @@ -289,6 +290,8 @@ m68*-*-rtemscoff*) targ_emul=m68kcoff ;; m68*-*-rtems*) targ_emul=m68kelf ;; +m68*-*-haiku*) targ_emul=m68kelf + targ_extra_emuls=m68kcoff ;; m8*-*-*) targ_emul=m88kbcs ;; maxq-*-coff) targ_emul=maxqcoff @@ -425,6 +428,7 @@ powerpc-*-aix5*) targ_emul=aix5ppc ;; powerpc-*-aix*) targ_emul=aixppc ;; powerpc-*-beos*) targ_emul=aixppc ;; +powerpc-*-haiku*) targ_emul=elf_ppc_haiku ;; powerpc-*-windiss*) targ_emul=elf32ppcwindiss ;; powerpc-*-lynxos*) targ_emul=ppclynx ;; rs6000-*-aix5*) targ_emul=aix5rs6 ;; diff --git a/legacy/binutils/gas/config/tc-i386.c b/legacy/binutils/gas/config/tc-i386.c index bb1f36c..0919fdd 100644 --- a/legacy/binutils/gas/config/tc-i386.c +++ b/legacy/binutils/gas/config/tc-i386.c @@ -203,7 +203,8 @@ && !defined (TE_NETWARE) \ && !defined (TE_FreeBSD) \ && !defined (TE_NetBSD) \ - && !defined (TE_BeOS))) + && !defined (TE_BeOS) \ + && !defined (TE_HAIKU))) /* This array holds the chars that always start a comment. If the pre-processor is disabled, these aren't very useful. The option --divide will remove '/' from this list. */ diff --git a/legacy/binutils/gas/config/te-haiku.h b/legacy/binutils/gas/config/te-haiku.h new file mode 100644 index 0000000..a51c9f4 100644 --- /dev/null +++ b/legacy/binutils/gas/config/te-haiku.h @@ -1,0 +1,10 @@ +/* Target environment for Haiku. It is the same as the generic + target, except that it arranges via the TE_HAIKU define to + suppress the use of "/" as a comment character. Some code in the + haiku kernel uses "/" to mean division. (What a concept!) */ +#define TE_HAIKU 1 + +#define LOCAL_LABELS_DOLLAR 1 +#define LOCAL_LABELS_FB 1 + +#include "obj-format.h" -- gitore 0.2.2