OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/trunk/gnu-src/gcc-4.2.2/gcc/config
    from Rev 154 to Rev 177
    Reverse comparison

Rev 154 → Rev 177

/or32/t-default
32,3 → 32,19
 
#LIBGCC =
#INSTALL_LIBGCC =
 
# .init/.fini section routines
 
$(T)crtinit.o: $(srcdir)/config/or32/initfini.c $(GCC_PASSES) $(CONFIG_H)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \
$(MULTILIB_CFLAGS) -DCRT_INIT -finhibit-size-directive -fno-inline-functions \
-g0 -c $(srcdir)/config/or32/initfini.c -o $(T)crtinit.o
 
$(T)crtfini.o: $(srcdir)/config/or32/initfini.c $(GCC_PASSES) $(CONFIG_H)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \
-DCRT_FINI $(MULTILIB_CFLAGS) -finhibit-size-directive -fno-inline-functions \
-g0 -c $(srcdir)/config/or32/initfini.c -o $(T)crtfini.o
 
#MULTILIB_OPTIONS =
MULTILIB_DIRNAMES = be
EXTRA_MULTILIB_PARTS = crtinit.o crtfini.o
/or32/or32.opt
55,3 → 55,7
mor32-newlib
Target RejectNegative
Link with the OR32 newlib library
 
mor32-newlib-uart
Target RejectNegative
Link with the OR32 newlib UART library
/or32/t-or32
32,3 → 32,19
 
#LIBGCC =
#INSTALL_LIBGCC =
 
# .init/.fini section routines
 
$(T)crtinit.o: $(srcdir)/config/or32/initfini.c $(GCC_PASSES) $(CONFIG_H)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \
$(MULTILIB_CFLAGS) -DCRT_INIT -finhibit-size-directive -fno-inline-functions \
-g0 -c $(srcdir)/config/or32/initfini.c -o $(T)crtinit.o
 
$(T)crtfini.o: $(srcdir)/config/or32/initfini.c $(GCC_PASSES) $(CONFIG_H)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \
-DCRT_FINI $(MULTILIB_CFLAGS) -finhibit-size-directive -fno-inline-functions \
-g0 -c $(srcdir)/config/or32/initfini.c -o $(T)crtfini.o
 
#MULTILIB_OPTIONS =
#MULTILIB_DIRNAMES = be
#EXTRA_MULTILIB_PARTS = crtinit.o crtfini.o
/or32/initfini.c
0,0 → 1,166
/* .init/.fini section handling + C++ global constructor/destructor handling.
This file is based on crtstuff.c, sol2-crti.asm, sol2-crtn.asm.
 
Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
 
This file is part of GCC.
 
GCC 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.)
 
GCC 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 GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
 
/* Declare a pointer to void function type. */
typedef void (*func_ptr) (void);
 
#ifdef CRT_INIT
 
/* NOTE: In order to be able to support SVR4 shared libraries, we arrange
to have one set of symbols { __CTOR_LIST__, __DTOR_LIST__, __CTOR_END__,
__DTOR_END__ } per root executable and also one set of these symbols
per shared library. So in any given whole process image, we may have
multiple definitions of each of these symbols. In order to prevent
these definitions from conflicting with one another, and in order to
ensure that the proper lists are used for the initialization/finalization
of each individual shared library (respectively), we give these symbols
only internal (i.e. `static') linkage, and we also make it a point to
refer to only the __CTOR_END__ symbol in crtfini.o and the __DTOR_LIST__
symbol in crtinit.o, where they are defined. */
 
static func_ptr __CTOR_LIST__[1] __attribute__ ((section (".ctors")))
__attribute__ ((used))
= { (func_ptr) (-1) };
 
static func_ptr __DTOR_LIST__[1] __attribute__ ((section (".dtors")))
= { (func_ptr) (-1) };
 
/* Run all the global destructors on exit from the program. */
/* Some systems place the number of pointers in the first word of the
table. On SVR4 however, that word is -1. In all cases, the table is
null-terminated. On SVR4, we start from the beginning of the list and
invoke each per-compilation-unit destructor routine in order
until we find that null.
 
Note that this function MUST be static. There will be one of these
functions in each root executable and one in each shared library, but
although they all have the same code, each one is unique in that it
refers to one particular associated `__DTOR_LIST__' which belongs to the
same particular root executable or shared library file. */
 
static void _do_global_dtors (void)
asm ("__do_global_dtors") __attribute__ ((section (".text")))
__attribute ((used));
 
static void
_do_global_dtors (void)
{
func_ptr *p;
for (p = __DTOR_LIST__ + 1; *p; p++)
(*p) ();
}
 
/* .init section start.
This must appear at the start of the .init section. */
 
asm ("\n\
.section .init\n\
.global init\n\
.word 0\n\
init:\n\
l.addi r1,r1,-16\n\
l.sw 12(r1),r2\n\
l.addi r2,r1,16\n\
l.sw 8(r1),r9\n\
");
 
/* .fini section start.
This must appear at the start of the .init section. */
 
asm ("\n\
.section .fini\n\
.global fini\n\
.word 0\n\
fini:\n\
l.addi r1,r1,-16\n\
l.sw 12(r1),r2\n\
l.addi r2,r1,16\n\
l.sw 8(r1),r9\n\
l.j __do_global_dtors\n\
");
 
#endif /* CRT_INIT */
 
#ifdef CRT_FINI
 
/* Put a word containing zero at the end of each of our two lists of function
addresses. Note that the words defined here go into the .ctors and .dtors
sections of the crtend.o file, and since that file is always linked in
last, these words naturally end up at the very ends of the two lists
contained in these two sections. */
 
static func_ptr __CTOR_END__[1] __attribute__ ((section (".ctors")))
= { (func_ptr) 0 };
 
static func_ptr __DTOR_END__[1] __attribute__ ((section (".dtors")))
__attribute__ ((used))
= { (func_ptr) 0 };
 
/* Run all global constructors for the program.
Note that they are run in reverse order. */
 
static void _do_global_ctors (void)
asm ("__do_global_ctors") __attribute__ ((section (".text")))
__attribute ((used));
 
static void
_do_global_ctors (void)
{
func_ptr *p;
for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--)
(*p) ();
}
 
/* .init section end.
This must live at the end of the .init section. */
 
asm ("\n\
.section .init\n\
l.j __do_global_ctors\n\
l.lwz r9,8(r1)\n\
l.lwz r2,12(r1)\n\
l.jr r9\n\
l.addi r1,r1,16\n\
");
 
/* .fini section end.
This must live at the end of the .fini section. */
 
asm ("\n\
.section .fini\n\
l.lwz r9,8(r1)\n\
l.lwz r2,12(r1)\n\
l.jr r9\n\
l.addi r1,r1,16\n\
");
 
#endif /* CRT_FINI */
or32/initfini.c Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: or32/or32.h =================================================================== --- or32/or32.h (revision 154) +++ or32/or32.h (revision 177) @@ -35,27 +35,32 @@ } \ while (0) -/* If we are using newlib, then use this version of the library */ -#define LINK_SPEC "%{mor32-newlib:-T ldscripts/or32.ld%s}" -/* Finally specify the newlib lirary */ -#define ENDFILE_SPEC "%{mor32-newlib:libor32.a%s -lc -lgcc}" +/* Make sure we pick up the crtinit.o and crtfini.o files. */ +#define STARTFILE_SPEC "%{!shared:crt0.o%s} crtinit.o%s" -#if 0 +#define ENDFILE_SPEC "crtfini.o%s" +/* Override previous definitions (linux.h). We don't use libg.a */ + +#undef LIB_SPEC +#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \ + %{mor32-newlib:-lor32 \ + %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}} \ + %{mor32-newlib-uart:-lor32uart \ + %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}" + +/* Old definition of LIB_SPEC, not longer used. */ /* Which library to get. The only difference from the default is to get libsc.a if -sim is given to the driver. Repeat -lc -lsysX {X=sim,linux}, because libsysX needs (at least) errno from libc, and then we want to resolve new unknowns in libc against libsysX, not libnosys. */ -/* Override previous definitions (linux.h). */ -#undef LIB_SPEC -#define LIB_SPEC \ - "%{sim*:-lc -lsyssim -lc -lsyssim}\ - %{!sim*:%{g*:-lg}\ - %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} -lbsp}\ - -lnosys" -#endif +/* #define LIB_SPEC \ */ +/* "%{sim*:-lc -lsyssim -lc -lsyssim}\ */ +/* %{!sim*:%{g*:-lg}\ */ +/* %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} -lbsp}\ */ +/* -lnosys" */ #define TARGET_VERSION fprintf (stderr, " (OpenRISC 1000)"); @@ -1179,8 +1184,4 @@ extern GTY(()) rtx or32_compare_op0; extern GTY(()) rtx or32_compare_op1; -/* We don't use libg.a */ -#undef LIB_SPEC -#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" - #endif /* _OR32_H_ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.