OSDN Git Service

Add sh-nto support
authorNick Clifton <nickc@redhat.com>
Thu, 22 Aug 2002 17:27:19 +0000 (17:27 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 22 Aug 2002 17:27:19 +0000 (17:27 +0000)
bfd/ChangeLog
bfd/Makefile.am
bfd/Makefile.in
bfd/config.bfd
bfd/configure
bfd/configure.in
bfd/elf32-qnx.h
bfd/elf32-sh.c
bfd/elf32-shqnx.c [new file with mode: 0644]
bfd/targets.c

index 2cd2064..0e7b270 100644 (file)
@@ -1,3 +1,16 @@
+2002-08-22  Graeme Peterson  <gp@qnx.com>
+
+       * Makefile.am: Add entries for elf32-shqnx.c
+       * Makefile.in: Regenerate.
+       * config.bfd: Add support sh-*-nto* target.
+       * configure.in: Add support for bfd_elf32_sh{l}qnx_vec.
+       * configure: Regenerate.
+       * elf32-qnx.h: Changed typo "elf_i386qnx_*" to "elf_qnx_*" .
+       * elf32-sh.c: Do not include elf32-target.h if
+       ELF32_SH_C_INCLUDED is defined.
+       * elf32-shqnx.c: New file: Support for QNX.
+       * targets.c: Add bfd_elf32_sh{l}qnx_vec.
+
 2002-08-22  Nick Clifton  <nickc@redhat.com>
 
        * po/tr.po: Updated Turkish translation.
index 4913b73..d945dc3 100644 (file)
@@ -240,6 +240,7 @@ BFD32_BACKENDS = \
        elf32-sh64-com.lo \
        elf32-sh-nbsd.lo \
        elf32-sh64-nbsd.lo \
+       elf32-shqnx.lo \
        elf32-sparc.lo \
        elf32-v850.lo \
        elf32-vax.lo \
@@ -399,6 +400,7 @@ BFD32_BACKENDS_CFILES = \
        elf32-sh-lin.c \
        elf32-sh-nbsd.c \
        elf32-sh64-nbsd.c \
+       elf32-shqnx.c \
        elf32-sparc.c \
        elf32-v850.c \
        elf32-vax.c \
@@ -1260,6 +1262,10 @@ elf32-sh64-nbsd.lo: elf32-sh64-nbsd.c elf32-sh64.c \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
   $(srcdir)/../opcodes/sh64-opc.h elf32-sh.c $(INCDIR)/elf/sh.h \
   $(INCDIR)/elf/reloc-macros.h elf32-target.h
+elf32-shqnx.lo: elf32-shqnx.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
+  elf-bfd.h elf32-qnx.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
+  $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
+  elf32-target.h
 elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \
   $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
index 6d80048..6a137cd 100644 (file)
@@ -368,6 +368,7 @@ BFD32_BACKENDS = \
        elf32-sh64-com.lo \
        elf32-sh-nbsd.lo \
        elf32-sh64-nbsd.lo \
+       elf32-shqnx.lo \
        elf32-sparc.lo \
        elf32-v850.lo \
        elf32-vax.lo \
@@ -528,6 +529,7 @@ BFD32_BACKENDS_CFILES = \
        elf32-sh-lin.c \
        elf32-sh-nbsd.c \
        elf32-sh64-nbsd.c \
+       elf32-shqnx.c \
        elf32-sparc.c \
        elf32-v850.c \
        elf32-vax.c \
@@ -1790,6 +1792,10 @@ elf32-sh64-nbsd.lo: elf32-sh64-nbsd.c elf32-sh64.c \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
   $(srcdir)/../opcodes/sh64-opc.h elf32-sh.c $(INCDIR)/elf/sh.h \
   $(INCDIR)/elf/reloc-macros.h elf32-target.h
+elf32-shqnx.lo: elf32-shqnx.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
+  elf-bfd.h elf32-qnx.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
+  $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
+  elf32-target.h
 elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \
   $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
index a13d99b..a42ad1f 100644 (file)
@@ -994,6 +994,11 @@ case "${targ}" in
 #endif
     targ_underscore=yes
     ;;
+  sh-*-nto*)
+    targ_defvec=bfd_elf32_shqnx_vec
+    targ_selvecs="bfd_elf32_shlqnx_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
+    targ_underscore=yes
+    ;;
   sh-*-pe)
     targ_defvec=shlpe_vec
     targ_selvecs="shlpe_vec shlpei_vec"
index 34a8f31..cd03dd3 100755 (executable)
@@ -6123,7 +6123,9 @@ do
     bfd_elf32_shl_vec)         tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_shlin_vec)       tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
     bfd_elf32_shlnbsd_vec)     tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+    bfd_elf32_shlqnx_vec)      tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_shnbsd_vec)      tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+    bfd_elf32_shqnx_vec)       tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_sparc_vec)       tb="$tb elf32-sparc.lo elf32.lo $elf" ;;
     bfd_elf32_tradbigmips_vec)  tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
@@ -6330,10 +6332,10 @@ case ${host64}-${target64}-${want64} in
     if test -n "$GCC" ; then
        bad_64bit_gcc=no;
        echo $ac_n "checking for gcc version with buggy 64-bit support""... $ac_c" 1>&6
-echo "configure:6334: checking for gcc version with buggy 64-bit support" >&5
+echo "configure:6336: checking for gcc version with buggy 64-bit support" >&5
        # Add more tests for gcc versions with non-working 64-bit support here.
        cat > conftest.$ac_ext <<EOF
-#line 6337 "configure"
+#line 6339 "configure"
 #include "confdefs.h"
 :__GNUC__:__GNUC_MINOR__:__i386__:
 EOF
@@ -6378,17 +6380,17 @@ for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6382: checking for $ac_hdr" >&5
+echo "configure:6384: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6387 "configure"
+#line 6389 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6392: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6417,12 +6419,12 @@ done
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6421: checking for $ac_func" >&5
+echo "configure:6423: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6426 "configure"
+#line 6428 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6445,7 +6447,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6470,7 +6472,7 @@ fi
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:6474: checking for working mmap" >&5
+echo "configure:6476: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6478,7 +6480,7 @@ else
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 6482 "configure"
+#line 6484 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -6631,7 +6633,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:6635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -6656,12 +6658,12 @@ fi
 for ac_func in madvise mprotect
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6660: checking for $ac_func" >&5
+echo "configure:6662: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6665 "configure"
+#line 6667 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6684,7 +6686,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
index 84cea63..2f59095 100644 (file)
@@ -624,7 +624,9 @@ do
     bfd_elf32_shl_vec)         tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_shlin_vec)       tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
     bfd_elf32_shlnbsd_vec)     tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+    bfd_elf32_shlqnx_vec)      tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_shnbsd_vec)      tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+    bfd_elf32_shqnx_vec)       tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_sparc_vec)       tb="$tb elf32-sparc.lo elf32.lo $elf" ;;
     bfd_elf32_tradbigmips_vec)  tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
index 454c2b4..d4eefb8 100644 (file)
   (start + (segment->p_memsz > segment->p_filesz        \
    ? segment->p_memsz : segment->p_filesz))
 
-static boolean elf_i386qnx_copy_private_bfd_data_p
+static boolean elf_qnx_copy_private_bfd_data_p
   PARAMS ((bfd *, asection *, bfd *, asection *));
-static boolean elf_i386qnx_is_contained_by_filepos
+static boolean elf_qnx_is_contained_by_filepos
   PARAMS ((asection *, Elf_Internal_Phdr *));
-static void elf_i386qnx_set_nonloadable_filepos
+static void elf_qnx_set_nonloadable_filepos
   PARAMS ((bfd *, Elf_Internal_Phdr *));
 
 static boolean
index 147483d..ecde70f 100644 (file)
@@ -5882,4 +5882,8 @@ sh_elf_reloc_type_class (rela)
 #define elf_backend_want_plt_sym       0
 #define elf_backend_got_header_size    12
 #define elf_backend_plt_header_size    PLT_ENTRY_SIZE
+
+#ifndef ELF32_SH_C_INCLUDED
 #include "elf32-target.h"
+#endif
+
diff --git a/bfd/elf32-shqnx.c b/bfd/elf32-shqnx.c
new file mode 100644 (file)
index 0000000..a27c0f2
--- /dev/null
@@ -0,0 +1,31 @@
+/* Hitachi SH QNX specific support for 32-bit ELF
+   Copyright 2002   Free Software Foundation, Inc.
+
+   This file is part of BFD, the Binary File Descriptor library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+#define ELF32_SH_C_INCLUDED
+#include "elf32-sh.c"
+
+#include "elf32-qnx.h"
+
+#undef  TARGET_LITTLE_SYM 
+#define TARGET_LITTLE_SYM       bfd_elf32_shlqnx_vec
+#undef  TARGET_BIG_SYM
+#define TARGET_BIG_SYM          bfd_elf32_shqnx_vec
+
+#include "elf32-target.h"
+
index ee37828..093490c 100644 (file)
@@ -565,7 +565,9 @@ extern const bfd_target bfd_elf32_shblin_vec;
 extern const bfd_target bfd_elf32_shl_vec;
 extern const bfd_target bfd_elf32_shlin_vec;
 extern const bfd_target bfd_elf32_shlnbsd_vec;
+extern const bfd_target bfd_elf32_shlqnx_vec;
 extern const bfd_target bfd_elf32_shnbsd_vec;
+extern const bfd_target bfd_elf32_shqnx_vec;
 extern const bfd_target bfd_elf32_sparc_vec;
 extern const bfd_target bfd_elf32_tradbigmips_vec;
 extern const bfd_target bfd_elf32_tradlittlemips_vec;