From b129bfef3a7734709c529628c3f8b4fd7dc60a2e Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Thu, 7 Sep 2000 04:23:43 +0000 Subject: [PATCH] * config.bfd (sh-*-linux*): Added. * configure.in (bfd_elf32_shlin_vec, bfd_elf32_shblin_vec): New. * targets.c: Declare them. * elf32-sh-lin.c: New file. * Makefile.am: Compile it. * elf32-sh.c: Don't override defines from elf32-sh-lin.c. * configure, Makefile.in: Rebuilt. --- bfd/ChangeLog | 10 ++++++++++ bfd/Makefile.am | 7 +++++++ bfd/Makefile.in | 7 +++++++ bfd/config.bfd | 5 +++++ bfd/configure | 26 ++++++++++++++------------ bfd/configure.in | 2 ++ bfd/elf32-sh-lin.c | 29 +++++++++++++++++++++++++++++ bfd/elf32-sh.c | 2 ++ bfd/targets.c | 2 ++ 9 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 bfd/elf32-sh-lin.c diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 3da3416169..800aeb3a68 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,13 @@ +2000-09-07 Alexandre Oliva + + * config.bfd (sh-*-linux*): Added. + * configure.in (bfd_elf32_shlin_vec, bfd_elf32_shblin_vec): New. + * targets.c: Declare them. + * elf32-sh-lin.c: New file. + * Makefile.am: Compile it. + * elf32-sh.c: Don't override defines from elf32-sh-lin.c. + * configure, Makefile.in: Rebuilt. + 2000-09-06 Geoffrey Keating * xcofflink.c (xcoff_link_input_bfd): Include the .tocbss diff --git a/bfd/Makefile.am b/bfd/Makefile.am index ed94f29a32..a16f78db4c 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -198,6 +198,7 @@ BFD32_BACKENDS = \ elf32-pj.lo \ elf32-ppc.lo \ elf32-sh.lo \ + elf32-sh-lin.lo \ elf32-sparc.lo \ elf32-v850.lo \ elf32.lo \ @@ -335,6 +336,7 @@ BFD32_BACKENDS_CFILES = \ elf32-pj.c \ elf32-ppc.c \ elf32-sh.c \ + elf32-sh-lin.c \ elf32-sparc.c \ elf32-v850.c \ elf32.c \ @@ -1009,6 +1011,11 @@ elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.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 +# Keep this one in sync with the one above +elf32-sh-lin.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.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-sh-lin.c 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 \ diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 4ee242434f..2c089bd914 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -319,6 +319,7 @@ BFD32_BACKENDS = \ elf32-pj.lo \ elf32-ppc.lo \ elf32-sh.lo \ + elf32-sh-lin.lo \ elf32-sparc.lo \ elf32-v850.lo \ elf32.lo \ @@ -457,6 +458,7 @@ BFD32_BACKENDS_CFILES = \ elf32-pj.c \ elf32-ppc.c \ elf32-sh.c \ + elf32-sh-lin.c \ elf32-sparc.c \ elf32-v850.c \ elf32.c \ @@ -1547,6 +1549,11 @@ elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.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 +# Keep this one in sync with the one above +elf32-sh-lin.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.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-sh-lin.c 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 \ diff --git a/bfd/config.bfd b/bfd/config.bfd index 4c839d2190..ec8f8d6855 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -683,6 +683,11 @@ case "${targ}" in targ_defvec=rs6000coff_vec ;; + sh-*-linux*) + targ_defvec=bfd_elf32_shblin_vec + targ_selvecs=bfd_elf32_shlin_vec + ;; + sh-*-elf* | sh-*-rtemself*) targ_defvec=bfd_elf32_sh_vec targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" diff --git a/bfd/configure b/bfd/configure index 71a30cf7d9..413f7d0dea 100755 --- a/bfd/configure +++ b/bfd/configure @@ -5869,6 +5869,8 @@ do bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;; bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; 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_shblin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;; bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; @@ -6062,17 +6064,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6066: checking for $ac_hdr" >&5 +echo "configure:6068: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6076: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6078: \"$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* @@ -6101,12 +6103,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6105: checking for $ac_func" >&5 +echo "configure:6107: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6135: \"$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 @@ -6154,7 +6156,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:6158: checking for working mmap" >&5 +echo "configure:6160: 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 @@ -6162,7 +6164,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6308: \"$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 @@ -6327,12 +6329,12 @@ fi for ac_func in madvise mprotect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6331: checking for $ac_func" >&5 +echo "configure:6333: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6361: \"$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 diff --git a/bfd/configure.in b/bfd/configure.in index 37cb13b426..c7d6480751 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -522,6 +522,8 @@ do bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;; bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; 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_shblin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;; bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; diff --git a/bfd/elf32-sh-lin.c b/bfd/elf32-sh-lin.c new file mode 100644 index 0000000000..1ee0a87cab --- /dev/null +++ b/bfd/elf32-sh-lin.c @@ -0,0 +1,29 @@ +/* Hitachi SH specific support for 32-bit Linux + Copyright 2000 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 TARGET_BIG_SYM bfd_elf32_shblin_vec +#define TARGET_BIG_NAME "elf32-shbig-linux" +#define TARGET_LITTLE_SYM bfd_elf32_shlin_vec +#define TARGET_LITTLE_NAME "elf32-sh-linux" +#define ELF_ARCH bfd_arch_sh +#define ELF_MACHINE_CODE EM_SH +#define ELF_MAXPAGESIZE 0x10000 +#define elf_symbol_leading_char 0 + +#include "elf32-sh.c" diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index acbf66147b..2cca369c0a 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -4154,6 +4154,7 @@ sh_elf_finish_dynamic_sections (output_bfd, info) return true; } +#ifndef ELF_ARCH #define TARGET_BIG_SYM bfd_elf32_sh_vec #define TARGET_BIG_NAME "elf32-sh" #define TARGET_LITTLE_SYM bfd_elf32_shl_vec @@ -4163,6 +4164,7 @@ sh_elf_finish_dynamic_sections (output_bfd, info) #define ELF_MAXPAGESIZE 0x1 #define elf_symbol_leading_char '_' +#endif /* ELF_ARCH */ #define bfd_elf32_bfd_reloc_type_lookup sh_elf_reloc_type_lookup #define elf_info_to_howto sh_elf_info_to_howto diff --git a/bfd/targets.c b/bfd/targets.c index 195572035f..986d88bb87 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -547,6 +547,8 @@ extern const bfd_target bfd_elf32_powerpc_vec; extern const bfd_target bfd_elf32_powerpcle_vec; extern const bfd_target bfd_elf32_sh_vec; extern const bfd_target bfd_elf32_shl_vec; +extern const bfd_target bfd_elf32_shlin_vec; +extern const bfd_target bfd_elf32_shblin_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; -- 2.34.1