From f4926e194af6731b14aadb181cf7aa0d1f331e52 Mon Sep 17 00:00:00 2001 From: "J\"orn Rennecke" Date: Thu, 30 Aug 2001 18:20:33 +0000 Subject: [PATCH] config.gcc (h8300-*-elf*): New case. * config.gcc (h8300-*-elf*): New case. * h8300.h (CPP_SPEC): Add subtarget_cpp_spec. (SUBTARGET_CPP_SPEC): Define. (EXTRA_SPECS): Define. (SUBTARGET_EXTRA_SPECS): Define. * config/h8300/crti.asm, config/h8300/crtn.asm: New files. * config/h8300/elf.h, config/h8300/t-elf: Likewise. From-SVN: r45293 --- gcc/ChangeLog | 10 +++++++++ gcc/config/h8300/crti.asm | 53 +++++++++++++++++++++++++++++++++++++++++++++++ gcc/config/h8300/crtn.asm | 43 ++++++++++++++++++++++++++++++++++++++ gcc/config/h8300/elf.h | 36 ++++++++++++++++++++++++++++++++ gcc/config/h8300/h8300.h | 11 +++++++++- gcc/config/h8300/t-elf | 6 ++++++ 6 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 gcc/config/h8300/crti.asm create mode 100644 gcc/config/h8300/crtn.asm create mode 100644 gcc/config/h8300/elf.h create mode 100644 gcc/config/h8300/t-elf diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a725b4f..23b7a1e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +Thu Aug 30 16:22:41 2001 J"orn Rennecke + + * config.gcc (h8300-*-elf*): New case. + * h8300.h (CPP_SPEC): Add subtarget_cpp_spec. + (SUBTARGET_CPP_SPEC): Define. + (EXTRA_SPECS): Define. + (SUBTARGET_EXTRA_SPECS): Define. + * config/h8300/crti.asm, config/h8300/crtn.asm: New files. + * config/h8300/elf.h, config/h8300/t-elf: Likewise. + Thu Aug 30 18:50:37 2001 J"orn Rennecke * t-h8300 (LIB1ASMFUNCS): Add _fixunssfdi and _fixunssfsi_asm. diff --git a/gcc/config/h8300/crti.asm b/gcc/config/h8300/crti.asm new file mode 100644 index 0000000..2ebd15f --- /dev/null +++ b/gcc/config/h8300/crti.asm @@ -0,0 +1,53 @@ +/* Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC 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, or (at your option) any +later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +GNU CC 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; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* The code in sections .init and .fini is supposed to be a single + regular function. The function in .init is called directly from + start in crt1.asm. The function in .fini is atexit()ed in crt1.asm + too. + + crti.asm contributes the prologue of a function to these sections, + and crtn.asm comes up the epilogue. STARTFILE_SPEC should list + crti.o before any other object files that might add code to .init + or .fini sections, and ENDFILE_SPEC should list crtn.o after any + such object files. */ + +#ifdef __H8300H__ + .h8300h +#endif + +#ifdef __H8300S__ + .h8300s +#endif + + .section .init + .global __init +__init: + .section .fini + .global __fini +__fini: diff --git a/gcc/config/h8300/crtn.asm b/gcc/config/h8300/crtn.asm new file mode 100644 index 0000000..fe29fe6 --- /dev/null +++ b/gcc/config/h8300/crtn.asm @@ -0,0 +1,43 @@ +/* Copyright (C) 2001 Free Software Foundation, Inc. + This file was adapted from glibc sources. + +This file is part of GNU CC. + +GNU CC 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, or (at your option) any +later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +GNU CC 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; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* See an explanation about .init and .fini in crti.asm. */ + +#ifdef __H8300H__ + .h8300h +#endif + +#ifdef __H8300S__ + .h8300s +#endif + .section .init + rts + + .section .fini + rts diff --git a/gcc/config/h8300/elf.h b/gcc/config/h8300/elf.h new file mode 100644 index 0000000..e23af4a --- /dev/null +++ b/gcc/config/h8300/elf.h @@ -0,0 +1,36 @@ +#undef SUBTARGET_CPP_SPEC +#define SUBTARGET_CPP_SPEC "-D__ELF__" + +/* Undefine some macros defined in h8300 that conflict with elfos.h . */ +#undef SDB_DEBUGGING_INFO +#undef DBX_DEBUGGING_INFO +#undef ASM_OUTPUT_IDENT +#undef IDENT_ASM_OP +#undef CTORS_SECTION_ASM_OP +#undef DTORS_SECTION_ASM_OP +#undef INIT_SECTION_ASM_OP +#undef READONLY_DATA_SECTION +#undef ASM_OUTPUT_CONSTRUCTOR +#undef ASM_OUTPUT_DESTRUCTOR +#undef TARGET_ASM_NAMED_SECTION +#undef TARGET_MEM_FUNCTIONS +#undef PREFERRED_DEBUGGING_TYPE +/* ??? h8300.h defines PCC_BITFIELD_TYPE_MATTERS to 0, but it + doesn't define STRUCTURE_SIZE_BOUNDARY, nor does h8300.md + have a full set of bit field instructions. */ +#undef PCC_BITFIELD_TYPE_MATTERS + +#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG + +#include "elfos.h" + +/* Output at beginning/end of assembler file. */ +#undef ASM_FILE_START +#define ASM_FILE_START(FILE) \ + (output_file_directive ((FILE), main_input_filename), \ + asm_file_start (FILE)) + +#undef USER_LABEL_PREFIX +#define USER_LABEL_PREFIX "_" + +#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic) diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index ea1d3e8..6ec826e 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -50,12 +50,21 @@ extern const char * const *h8_reg_names; %{!mh:%{!ms:-Acpu=h8300 -Amachine=h8300}} \ %{mh:-Acpu=h8300h -Amachine=h8300h} \ %{ms:-Acpu=h8300s -Amachine=h8300s} \ - %{!mint32:-D__INT_MAX__=32767} %{mint32:-D__INT_MAX__=2147483647}" + %{!mint32:-D__INT_MAX__=32767} %{mint32:-D__INT_MAX__=2147483647} \ + %(subtarget_cpp_spec)" + +#define SUBTARGET_CPP_SPEC "" #define LINK_SPEC "%{mh:-m h8300h} %{ms:-m h8300s}" #define LIB_SPEC "%{mrelax:-relax} %{g:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" +#define EXTRA_SPECS \ + { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC }, \ + SUBTARGET_EXTRA_SPECS + +#define SUBTARGET_EXTRA_SPECS + /* Print subsidiary information on the compiler version in use. */ #define TARGET_VERSION fprintf (stderr, " (Hitachi H8/300)"); diff --git a/gcc/config/h8300/t-elf b/gcc/config/h8300/t-elf new file mode 100644 index 0000000..c1f1dac --- /dev/null +++ b/gcc/config/h8300/t-elf @@ -0,0 +1,6 @@ +EXTRA_MULTILIB_PARTS= crti.o crtn.o crtbegin.o crtend.o + +$(T)crti.o: $(srcdir)/config/h8300/crti.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/h8300/crti.asm +$(T)crtn.o: $(srcdir)/config/h8300/crtn.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/h8300/crtn.asm -- 2.7.4