Add sh-nto support

This commit is contained in:
Nick Clifton 2002-08-22 17:27:20 +00:00
parent dfe0d3fe28
commit ed71e1110d
20 changed files with 147 additions and 25 deletions

View 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.

View 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 \

View 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 \

View 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"

30
bfd/configure vendored
View file

@ -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

View 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" ;;

View file

@ -22,11 +22,11 @@
(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

View 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

31
bfd/elf32-shqnx.c Normal file
View file

@ -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"

View 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;

View file

@ -1,3 +1,8 @@
2002-08-12 Graeme Peterson <gp@qnx.com>
* configure.in: Add support for sh-**-nto* target.
* configure: Regenerate.
2002-08-21 Nitin Gupta <niting@noida.hcltech.com>
* config/tc-h8300.h (TC_LINKRELAX_FIXUP): Define.

View file

@ -2228,7 +2228,7 @@ add_to_lit_pool ()
{
if (entry >= MAX_LITERAL_POOL_SIZE)
{
inst.error = _("Literal Pool Overflow");
inst.error = _("literal pool overflow");
return FAIL;
}
@ -10265,7 +10265,7 @@ tc_gen_reloc (section, fixp)
/* If this is called then the a literal has
been referenced across a section boundary. */
as_bad_where (fixp->fx_file, fixp->fx_line,
_("Literal referenced across section boundary"));
_("literal referenced across section boundary"));
return NULL;
#ifdef OBJ_ELF
@ -10512,7 +10512,6 @@ md_assemble (str)
-k Generate PIC code
-mthumb Start in Thumb mode
-mthumb-interwork Code supports ARM/Thumb interworking
-mimplicit-litpool-dump Dump literal pool on section change
For now we will also provide support for:

4
gas/configure vendored
View file

@ -2581,8 +2581,8 @@ EOF
sh*-*-netbsdelf*) fmt=elf em=nbsd ;;
sh-*-elf*) fmt=elf ;;
sh-*-coff*) fmt=coff ;;
sh-*-pe*) fmt=coff em=pe bfd_gas=yes
endian=little ;;
sh-*-nto*) fmt=elf ;;
sh-*-pe*) fmt=coff em=pe bfd_gas=yes endian=little ;;
sh-*-rtemself*) fmt=elf ;;
sh-*-rtems*) fmt=coff ;;
sh64-*-elf*) fmt=elf ;;

View file

@ -425,8 +425,8 @@ changequote([,])dnl
sh*-*-netbsdelf*) fmt=elf em=nbsd ;;
sh-*-elf*) fmt=elf ;;
sh-*-coff*) fmt=coff ;;
sh-*-pe*) fmt=coff em=pe bfd_gas=yes
endian=little ;;
sh-*-nto*) fmt=elf ;;
sh-*-pe*) fmt=coff em=pe bfd_gas=yes endian=little ;;
sh-*-rtemself*) fmt=elf ;;
sh-*-rtems*) fmt=coff ;;
sh64-*-elf*) fmt=elf ;;

View file

@ -1,3 +1,11 @@
2002-08-22 Graeme Peterson <gp@qnx.com>
* Makefile.am: Add esh{l}elf_nto.o files.
* Makefile.in: Regenerate.
* configure.tgt: Add support for sh-**-nto* targets.
* emulparams/shelf_nto.sh: New file.
* emulparams/shlelf_nto.sh: New file.
2002-08-21 John David Anglin <dave@hiauly1.hia.nrc.ca>
* ldlang.c (offsetof): Define if not defined.

View file

@ -267,6 +267,8 @@ ALL_EMULATIONS = \
eshlelf_linux.o \
eshelf_nbsd.o \
eshlelf_nbsd.o \
eshelf_nto.o \
eshlelf_nto.o \
eshl.o \
eshlelf.o \
eshpe.o \
@ -1006,11 +1008,17 @@ eshelf_nbsd.c: $(srcdir)/emulparams/shelf_nbsd.sh \
$(srcdir)/emulparams/shelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shelf_nbsd "$(tdir_shelf_nbsd)"
eshelf_nto.c: $(srcdir)/emulparams/shelf_nto.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shelf_nto "$(tdir_shelf_nto)"
eshlelf_nbsd.c: $(srcdir)/emulparams/shlelf_nbsd.sh \
$(srcdir)/emulparams/shelf_nbsd.sh \
$(srcdir)/emulparams/shelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shlelf_nbsd "$(tdir_shlelf_nbsd)"
eshlelf_nto.c: $(srcdir)/emulparams/shlelf_nto.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shlelf_nto "$(tdir_shlelf_nto)"
eshlelf.c: $(srcdir)/emulparams/shlelf.sh \
$(srcdir)/emulparams/shelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}

View file

@ -378,6 +378,8 @@ ALL_EMULATIONS = \
eshlelf_linux.o \
eshelf_nbsd.o \
eshlelf_nbsd.o \
eshelf_nto.o \
eshlelf_nto.o \
eshl.o \
eshlelf.o \
eshpe.o \
@ -1729,11 +1731,17 @@ eshelf_nbsd.c: $(srcdir)/emulparams/shelf_nbsd.sh \
$(srcdir)/emulparams/shelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shelf_nbsd "$(tdir_shelf_nbsd)"
eshelf_nto.c: $(srcdir)/emulparams/shelf_nto.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shelf_nto "$(tdir_shelf_nto)"
eshlelf_nbsd.c: $(srcdir)/emulparams/shlelf_nbsd.sh \
$(srcdir)/emulparams/shelf_nbsd.sh \
$(srcdir)/emulparams/shelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shlelf_nbsd "$(tdir_shlelf_nbsd)"
eshlelf_nto.c: $(srcdir)/emulparams/shlelf_nto.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shlelf_nto "$(tdir_shlelf_nto)"
eshlelf.c: $(srcdir)/emulparams/shlelf.sh \
$(srcdir)/emulparams/shelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}

View file

@ -232,7 +232,7 @@ arm-*-netbsdelf*) targ_emul=armelf_nbsd;
targ_extra_emuls="armelfb_nbsd armelf armnbsd" ;;
arm-*-netbsd*) targ_emul=armnbsd;
targ_extra_emuls="armelf armelf_nbsd armelfb_nbsd" ;;
arm-**-nto*) targ_emul=armnto ;;
arm-*-nto*) targ_emul=armnto ;;
arm-*-openbsd*) targ_emul=armnbsd ;;
arm-*-rtems*) targ_emul=armelf ;;
arm-*-elf) targ_emul=armelf ;;
@ -307,6 +307,9 @@ sh-*-elf* | sh[1234]*-*-elf | sh-*-rtemself*)
targ_emul=shelf
targ_extra_emuls="shlelf sh shl"
;;
sh-*-nto*) targ_emul=shelf_nto
targ_extra_emuls=shlelf_nto
;;
sh-*-pe) targ_emul=shpe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
sh-*-*|sh-*-rtems*) targ_emul=sh; targ_extra_emuls=shl ;;

View file

@ -0,0 +1,10 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-sh"
TEXT_START_ADDR=0x08040000
MAXPAGESIZE=0x1000
ARCH=sh
MACHINE=
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
TEXT_START_SYMBOLS='_btext = .;'
ENTRY=_start

View file

@ -0,0 +1,10 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-shl"
TEXT_START_ADDR=0x08040000
MAXPAGESIZE=0x1000
ARCH=sh
MACHINE=
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
TEXT_START_SYMBOLS='_btext = .;'
ENTRY=_start