From 10c93586dc9b2c53806747a520d22dfc875caa1c Mon Sep 17 00:00:00 2001 From: aoliva Date: Thu, 10 Jul 2003 04:44:36 +0000 Subject: [PATCH] 2001-09-12 Alexandre Oliva * elf32-am33lin.c (ELF_MACHINE_CODE): Redefine to EM_MN10300. (ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10300. 2001-06-02 Nick Clifton * elf32-am33lin.c: Rename global functions. 2001-05-09 Alexandre Oliva * config.bfd (am33_2.0, am33_2.0-*-linux*): Added. * configure.in (bfd_elf32_am33lin_vec): Added. * Makefile.am (BFD32_BACKENDS): Added elf32-am33lin.lo. (elf32-am33lin.lo): List dependencies. * aclocal.m4, configure, Makefile.in: Rebuilt. * elf-m10300.c (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, ELF_ARCH, ELF_MACHINE_CODE, ELF_MAXPAGESIZE): Define only if ELF_ARCH was not defined before. (elf_symbol_leading_char): Define if not defined. * elf32-am33lin.c: Override the definitions above. * targets.c (bfd_elf32_am33lin_vec): New. --- bfd/ChangeLog | 20 ++++++++++++++++++++ bfd/Makefile.am | 5 +++++ bfd/Makefile.in | 5 +++++ bfd/config.bfd | 5 +++++ bfd/configure | 1 + bfd/configure.in | 1 + bfd/elf-m10300.c | 4 ++++ bfd/elf32-am33lin.c | 35 +++++++++++++++++++++++++++++++++++ bfd/targets.c | 2 ++ 9 files changed, 78 insertions(+) create mode 100644 bfd/elf32-am33lin.c diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1d42a4493b..cfe5d3c68a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,23 @@ +2003-07-10 Alexandre Oliva + + 2001-09-12 Alexandre Oliva + * elf32-am33lin.c (ELF_MACHINE_CODE): Redefine to EM_MN10300. + (ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10300. + 2001-06-02 Nick Clifton + * elf32-am33lin.c: Rename global functions. + 2001-05-09 Alexandre Oliva + * config.bfd (am33_2.0, am33_2.0-*-linux*): Added. + * configure.in (bfd_elf32_am33lin_vec): Added. + * Makefile.am (BFD32_BACKENDS): Added elf32-am33lin.lo. + (elf32-am33lin.lo): List dependencies. + * aclocal.m4, configure, Makefile.in: Rebuilt. + * elf-m10300.c (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, + ELF_ARCH, ELF_MACHINE_CODE, ELF_MAXPAGESIZE): Define only if + ELF_ARCH was not defined before. + (elf_symbol_leading_char): Define if not defined. + * elf32-am33lin.c: Override the definitions above. + * targets.c (bfd_elf32_am33lin_vec): New. + 2003-07-09 Alexandre Oliva 2002-12-12 Alexandre Oliva diff --git a/bfd/Makefile.am b/bfd/Makefile.am index 6240f35c25..0c14796e09 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -372,6 +372,7 @@ BFD32_BACKENDS_CFILES = \ ecofflink.c \ efi-app-ia32.c \ elf.c \ + elf32-am33lin.lo \ elf32-arc.c \ elfarm-oabi.c \ elfarm-nabi.c \ @@ -1123,6 +1124,10 @@ efi-app-ia32.lo: efi-app-ia32.c $(INCDIR)/filenames.h \ elf.lo: elf.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/libiberty.h +elf32-am33lin.lo: elf32-am33lin.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf-m10300.c elf32-arc.lo: elf32-arc.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h \ diff --git a/bfd/Makefile.in b/bfd/Makefile.in index bfa525a878..8021b61476 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -500,6 +500,7 @@ BFD32_BACKENDS_CFILES = \ ecofflink.c \ efi-app-ia32.c \ elf.c \ + elf32-am33lin.lo \ elf32-arc.c \ elfarm-oabi.c \ elfarm-nabi.c \ @@ -1656,6 +1657,10 @@ efi-app-ia32.lo: efi-app-ia32.c $(INCDIR)/filenames.h \ elf.lo: elf.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/libiberty.h +elf32-am33lin.lo: elf32-am33lin.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf-m10300.c elf32-arc.lo: elf32-arc.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h \ diff --git a/bfd/config.bfd b/bfd/config.bfd index e1aa6b74cb..f0ae64211d 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -60,6 +60,7 @@ x86_64) targ_archs=bfd_i386_arch ;; xscale*) targ_archs=bfd_arm_arch ;; xtensa*) targ_archs=bfd_xtensa_arch ;; z8k*) targ_archs=bfd_z8k_arch ;; +am33_2.0) targ_archs=bfd_mn10300_arch ;; *) targ_archs=bfd_${targ_cpu}_arch ;; esac @@ -134,6 +135,9 @@ case "${targ}" in ;; #endif /* BFD64 */ + am33_2.0-*-linux*) + targ_defvec=bfd_elf32_am33lin_vec + ;; arc-*-elf*) targ_defvec=bfd_elf32_littlearc_vec targ_selvecs=bfd_elf32_bigarc_vec @@ -830,6 +834,7 @@ case "${targ}" in mn10300-*-*) targ_defvec=bfd_elf32_mn10300_vec + targ_underscore=yes ;; msp430-*-*) diff --git a/bfd/configure b/bfd/configure index 3b37998b4c..635879e3b5 100755 --- a/bfd/configure +++ b/bfd/configure @@ -6106,6 +6106,7 @@ do b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;; bfd_efi_app_ia32_vec) tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;; bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;; + bfd_elf32_am33lin_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;; bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; diff --git a/bfd/configure.in b/bfd/configure.in index 379b3ac557..ebb9896d5e 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -568,6 +568,7 @@ do b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;; bfd_efi_app_ia32_vec) tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;; bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;; + bfd_elf32_am33lin_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;; bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index 7591833589..1c243dac23 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -4842,12 +4842,14 @@ _bfd_mn10300_elf_finish_dynamic_sections (output_bfd, info) return TRUE; } +#ifndef ELF_ARCH #define TARGET_LITTLE_SYM bfd_elf32_mn10300_vec #define TARGET_LITTLE_NAME "elf32-mn10300" #define ELF_ARCH bfd_arch_mn10300 #define ELF_MACHINE_CODE EM_MN10300 #define ELF_MACHINE_ALT1 EM_CYGNUS_MN10300 #define ELF_MAXPAGESIZE 0x1000 +#endif #define elf_info_to_howto mn10300_info_to_howto #define elf_info_to_howto_rel 0 @@ -4864,7 +4866,9 @@ _bfd_mn10300_elf_finish_dynamic_sections (output_bfd, info) #define bfd_elf32_bfd_link_hash_table_free \ elf32_mn10300_link_hash_table_free +#ifndef elf_symbol_leading_char #define elf_symbol_leading_char '_' +#endif /* So we can set bits in e_flags. */ #define elf_backend_final_write_processing \ diff --git a/bfd/elf32-am33lin.c b/bfd/elf32-am33lin.c new file mode 100644 index 0000000000..4cc2230f3f --- /dev/null +++ b/bfd/elf32-am33lin.c @@ -0,0 +1,35 @@ +/* Matsushita AM33/2.0 support for 32-bit GNU/Linux ELF + Copyright 2001 + 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 elf_symbol_leading_char 0 + +#define TARGET_LITTLE_SYM bfd_elf32_am33lin_vec +#define TARGET_LITTLE_NAME "elf32-am33lin" +#define ELF_ARCH bfd_arch_mn10300 +#define ELF_MACHINE_CODE EM_MN10300 +#define ELF_MACHINE_ALT1 EM_CYGNUS_MN10300 +#define ELF_MAXPAGESIZE 0x1000 + +/* Rename global functions. */ +#define _bfd_mn10300_elf_merge_private_bfd_data _bfd_am33_elf_merge_private_bfd_data +#define _bfd_mn10300_elf_object_p _bfd_am33_elf_object_p +#define _bfd_mn10300_elf_final_write_processing _bfd_am33_elf_final_write_processing + +#include "elf-m10300.c" diff --git a/bfd/targets.c b/bfd/targets.c index f903cc327b..731619d77a 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -743,6 +743,7 @@ extern const bfd_target ptrace_core_vec; extern const bfd_target sco5_core_vec; extern const bfd_target trad_core_vec; +extern const bfd_target bfd_elf32_am33lin_vec; static const bfd_target * const _bfd_target_vector[] = { #ifdef SELECT_VECS @@ -1061,6 +1062,7 @@ static const bfd_target * const _bfd_target_vector[] = { &w65_vec, &we32kcoff_vec, &z8kcoff_vec, + &bfd_elf32_am33lin_vec, #endif /* not SELECT_VECS */ /* Always support S-records, for convenience. */ -- 2.11.0