From 371dda46181887c375e74055f135d4efa313fb5c Mon Sep 17 00:00:00 2001 From: Jérôme Duval Date: Fri, 06 Jan 2012 21:08:28 +0100 Subject: [PATCH] Fix merge of binutils 2.22. Sorry for the noise. --- binutils/libtool.m4 | 4 ++++ binutils/bfd/elf32-ppc.c | 2 +- binutils/gas/configure.tgt | 9 +++++++-- binutils/include/binary-io.h | 4 ++-- binutils/intl/loadmsgcat.c | 4 ++-- binutils/ld/configure.tgt | 25 +++++++++++++------------ binutils/gas/config/te-beos.h | 10 ++++++++++ binutils/gas/config/te-haiku.h | 10 ++++++++++ binutils/ld/emulparams/armelf_haiku.sh | 24 ++++++++++++++++++++++++ binutils/ld/emulparams/elf_i386_haiku.sh | 11 +++++++++++ binutils/ld/emulparams/elf_mipsel_haiku.sh | 2 ++ binutils/ld/emulparams/elf_ppc_haiku.sh | 20 ++++++++++++++++++++ 12 files changed, 104 insertions(+), 21 deletions(-) diff --git a/binutils/libtool.m4 b/binutils/libtool.m4 index 786975a..71bcee8 100644 --- a/binutils/libtool.m4 +++ b/binutils/libtool.m4 @@ -3038,6 +3038,10 @@ lt_cv_deplibs_check_method=pass_all ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in diff --git a/binutils/bfd/elf32-ppc.c b/binutils/bfd/elf32-ppc.c index 0c25c3e..cfad417 100644 --- a/binutils/bfd/elf32-ppc.c +++ b/binutils/bfd/elf32-ppc.c @@ -9065,7 +9065,7 @@ #define ELF_ARCH bfd_arch_powerpc #define ELF_TARGET_ID PPC32_ELF_DATA #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/binutils/gas/configure.tgt b/binutils/gas/configure.tgt index a171a32..b95abfa 100644 --- a/binutils/gas/configure.tgt +++ b/binutils/gas/configure.tgt @@ -121,6 +121,7 @@ fmt=coff em=wince-pe ;; arm-*-pe) fmt=coff em=pe ;; arm-*-riscix*) fmt=aout em=riscix ;; + arm-*-haiku*) fmt=elf em=haiku ;; avr-*-*) fmt=elf bfd_gas=yes ;; @@ -172,9 +173,10 @@ i386-ibm-aix*) fmt=coff em=i386aix ;; i386-sequent-bsd*) fmt=aout em=dynix ;; i386-*-beospe*) fmt=coff em=pe ;; - i386-*-beos*) fmt=elf ;; + 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 ;; @@ -265,6 +267,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 ;; mep-*-elf) fmt=elf ;; @@ -293,6 +296,7 @@ mips-*-elf* | mips-*-rtems*) fmt=elf ;; mips-*-netbsd*) fmt=elf em=tmips ;; mips-*-openbsd*) fmt=elf em=tmips ;; + mips*-*-haiku*) fmt=elf endian=little em=haiku ;; mmix-*-*) fmt=elf ;; @@ -326,9 +330,10 @@ ppc-*-aix5.[01]) fmt=coff em=aix5 ;; ppc-*-aix[5-9].*) fmt=coff em=aix5 ;; ppc-*-aix*) fmt=coff ;; - ppc-*-beos*) fmt=coff ;; + ppc-*-beos*) fmt=coff em=beos ;; 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 em=solaris ;; ppc-*-rtems*) fmt=elf ;; diff --git a/binutils/include/binary-io.h b/binutils/include/binary-io.h index 2984271..30d716b 100644 --- a/binutils/include/binary-io.h +++ b/binutils/include/binary-io.h @@ -30,8 +30,8 @@ # define O_BINARY _O_BINARY # define O_TEXT _O_TEXT #endif -#ifdef __BEOS__ - /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ +#if defined(__BEOS__) || defined(__HAIKU__) + /* BeOS 5 and Haiku R1 have O_BINARY and O_TEXT, but they have no effect. */ # undef O_BINARY # undef O_TEXT #endif diff --git a/binutils/intl/loadmsgcat.c b/binutils/intl/loadmsgcat.c index 536ee12..8d282ae 100644 --- a/binutils/intl/loadmsgcat.c +++ b/binutils/intl/loadmsgcat.c @@ -480,8 +480,8 @@ # define O_BINARY _O_BINARY # define O_TEXT _O_TEXT #endif -#ifdef __BEOS__ - /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ +#if defined(__BEOS__) || defined(__HAIKU__) + /* BeOS 5 and Haiku R1 have O_BINARY and O_TEXT, but they have no effect. */ # undef O_BINARY # undef O_TEXT #endif diff --git a/binutils/ld/configure.tgt b/binutils/ld/configure.tgt index f96e8d5..7c31e4e 100644 --- a/binutils/ld/configure.tgt +++ b/binutils/ld/configure.tgt @@ -97,19 +97,7 @@ ;; arm-*-vxworks) targ_emul=armelf_vxworks ;; arm*-*-conix*) targ_emul=armelf ;; -thumb-*-linux-* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;; -strongarm-*-coff) targ_emul=armcoff ;; -strongarm-*-elf) targ_emul=armelf ;; -strongarm-*-kaos*) targ_emul=armelf ;; -thumb-*-coff) targ_emul=armcoff ;; -thumb-*-elf) targ_emul=armelf ;; -thumb-epoc-pe) targ_emul=arm_epoc_pe ; - targ_extra_ofiles="deffilep.o pe-dll.o" ;; -thumb-*-pe) targ_emul=armpe ; - targ_extra_ofiles="deffilep.o pe-dll.o" ;; -xscale-*-coff) targ_emul=armcoff ;; -xscale-*-elf) targ_emul=armelf - ;; +arm*-*-haiku*) targ_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" ;; @@ -289,6 +277,9 @@ 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 ;; +x86_64-*-haiku*) targ_emul=elf_x86_64 + targ_extra_emuls=elf_i386_haiku ;; i[3-7]86-*-vxworks*) targ_emul=elf_i386_vxworks ;; i[3-7]86-*-chaos) targ_emul=elf_i386_chaos ;; @@ -360,7 +351,9 @@ targ_extra_emuls="m68kelfnbsd m68k4knbsd" ;; m68*-*-psos*) targ_emul=m68kpsos ;; m68*-*-rtemscoff*) targ_emul=m68kcoff ;; -m68*-*-rtems*) targ_emul=m68kelf +m68*-*-rtems*) targ_emul=m68kelf ;; +m68*-*-haiku*) targ_emul=m68kelf + targ_extra_emuls=m68kcoff ;; m8*-*-*) targ_emul=m88kbcs ;; @@ -385,6 +378,9 @@ mips*-*-ecoff*) targ_emul=mipsidt ;; mips*el-*-netbsd*) targ_emul=elf32ltsmip targ_extra_emuls="elf32btsmip elf64ltsmip elf64btsmip" + ;; +mips*el-*-haiku*) targ_emul=elf_mipsel_haiku + targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" ;; mips*-*-netbsd*) targ_emul=elf32btsmip targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip" @@ -522,6 +518,7 @@ powerpc-*-aix[5-9]*) 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-*-aix[5-9]*) targ_emul=aix5rs6 ;; diff --git a/binutils/gas/config/te-beos.h b/binutils/gas/config/te-beos.h new file mode 100644 index 0000000..af472ad 100644 --- /dev/null +++ b/binutils/gas/config/te-beos.h @@ -1,0 +1,10 @@ +/* Target environment for BeOS/Haiku. It is the same as the generic + target, except that it arranges via the TE_BeOS 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_BeOS 1 + +#define LOCAL_LABELS_DOLLAR 1 +#define LOCAL_LABELS_FB 1 + +#include "obj-format.h" diff --git a/binutils/gas/config/te-haiku.h b/binutils/gas/config/te-haiku.h new file mode 100644 index 0000000..af472ad 100644 --- /dev/null +++ b/binutils/gas/config/te-haiku.h @@ -1,0 +1,10 @@ +/* Target environment for BeOS/Haiku. It is the same as the generic + target, except that it arranges via the TE_BeOS 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_BeOS 1 + +#define LOCAL_LABELS_DOLLAR 1 +#define LOCAL_LABELS_FB 1 + +#include "obj-format.h" diff --git a/binutils/ld/emulparams/armelf_haiku.sh b/binutils/ld/emulparams/armelf_haiku.sh new file mode 100644 index 0000000..39b7f65 100644 --- /dev/null +++ b/binutils/ld/emulparams/armelf_haiku.sh @@ -1,0 +1,24 @@ +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=elf32 +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)) }' + +TEXT_START_ADDR=0x00008000 +TARGET2_TYPE=got-rel + +# ARM does not support .s* sections. +NO_SMALL_DATA=yes diff --git a/binutils/ld/emulparams/elf_i386_haiku.sh b/binutils/ld/emulparams/elf_i386_haiku.sh new file mode 100644 index 0000000..25ca6bc 100644 --- /dev/null +++ b/binutils/ld/emulparams/elf_i386_haiku.sh @@ -1,0 +1,11 @@ +SCRIPT_NAME=elf +OUTPUT_FORMAT="elf32-i386" +TEXT_START_ADDR=0x200000 +NONPAGED_TEXT_START_ADDR=0x200000 +MAXPAGESIZE=0x1000 +ARCH=i386 +MACHINE= +NOP=0x90909090 +TEMPLATE_NAME=elf32 +GENERATE_SHLIB_SCRIPT=yes +NO_SMALL_DATA=yes diff --git a/binutils/ld/emulparams/elf_mipsel_haiku.sh b/binutils/ld/emulparams/elf_mipsel_haiku.sh new file mode 100644 index 0000000..ff9c325 100644 --- /dev/null +++ b/binutils/ld/emulparams/elf_mipsel_haiku.sh @@ -1,0 +1,2 @@ +. ${srcdir}/emulparams/elf32lmip.sh + diff --git a/binutils/ld/emulparams/elf_ppc_haiku.sh b/binutils/ld/emulparams/elf_ppc_haiku.sh new file mode 100644 index 0000000..5a65cd4 100644 --- /dev/null +++ b/binutils/ld/emulparams/elf_ppc_haiku.sh @@ -1,0 +1,20 @@ +SCRIPT_NAME=elf +OUTPUT_FORMAT="elf32-powerpc" +TEXT_START_ADDR=0x200000 +NONPAGED_TEXT_START_ADDR=0x200000 +MAXPAGESIZE=0x1000 +ARCH=powerpc +MACHINE= +NOP=0x60000000 +TEMPLATE_NAME=elf32 +GENERATE_SHLIB_SCRIPT=yes +BSS_PLT= +OTHER_RELRO_SECTIONS=" + .fixup ${RELOCATING-0} : { *(.fixup) } + .got1 ${RELOCATING-0} : { *(.got1) } + .got2 ${RELOCATING-0} : { *(.got2) } +" +OTHER_GOT_RELOC_SECTIONS=" + .rela.got1 ${RELOCATING-0} : { *(.rela.got1) } + .rela.got2 ${RELOCATING-0} : { *(.rela.got2) } +" -- gitore 0.2.2