This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Failure of cross-assembling for ARC cpu target


On Fri, May 11, 2001 at 07:23:56PM +0930, amodra@one.net.au wrote:
> On Fri, May 11, 2001 at 09:45:56AM +0100, Peter.Targett@arccores.com wrote:
...
> > submit a patch to put such things as '.cpu' back into the source base, but
...
> I've reviewed the patch and it's OK except that copyright dates should
> now all be 4 digit numbers.  So go ahead and commit it.

I could't wait to the next binutils' snapshot and downloaded the sources from the cvs repository, with the above mentioned patch already logged.
No more problems with the .cpu pseupdo-op when compiling gcc-2.95.3 for the ARC target: libgcc1.S compiles smoothly now.
GREAT WORK!!  ;))

... but, there's another problem now:
I get the following error message with the file "src/gcc-2.95.3/gcc/config/arc/initfini.c" which is attached for reference:

/home/angel/arc-elf/build-gcc/gcc/xgcc -B/home/angel/arc-elf/build-gcc/gcc/ -B/usr/local/arc-elf/arc-elf/bin/ -I/usr/local/arc-elf/arc-elf/include -DCROSS_COMPILE -DIN_GCC     -g -O2 -I./include   -I. -I../../src/gcc-2.95.3/gcc -I../../src/gcc-2.95.3/gcc/config -I../../src/gcc-2.95.3/gcc/../include  \
  -DCRT_FINI -finhibit-size-directive -fno-inline-functions \
  -g0 -c ../../src/gcc-2.95.3/gcc/config/arc/initfini.c -o ./crtfini.o
/tmp/cc4ga3g6.s: Assembler messages:
/tmp/cc4ga3g6.s:1: Warning: ".option" directive overrides command-line (default) value
/tmp/cc4ga3g6.s:46: Error: junk at end of line: `ld blink,[fp,4]'
make[2]: *** [x-crtfini.o] Error 1
make[2]: Leaving directory `/home/angel/arc-elf/build-gcc/gcc'
make[1]: *** [stmp-multilib-arc] Error 1
make[1]: Leaving directory `/home/angel/arc-elf/build-gcc/gcc'
make: *** [all-gcc] Error 2

No idea of what this message means, so more help needed :(

Thanks & regards

Angel Manchado
/* .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 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.

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 GNU CC; see the file COPYING.  If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.  */

/* As a special exception, if you link this file with files
   compiled with GCC to produce an executable, this does not cause
   the resulting executable to be covered by the GNU General Public License.
   This exception does not however invalidate any other reasons why
   the executable file might be covered by the GNU General Public License.  */

/*  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")))
     = { (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 ()
asm ("__do_global_dtors") __attribute__ ((section (".text")));

static void
__do_global_dtors ()
{
  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\
	st blink,[sp,4]\n\
	st fp,[sp]\n\
	mov fp,sp\n\
	sub sp,sp,16\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\
	st blink,[sp,4]\n\
	st fp,[sp]\n\
	mov fp,sp\n\
	sub sp,sp,16\n\
	bl.nd __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")))
     = { (func_ptr) 0 };

/* Run all global constructors for the program.
   Note that they are run in reverse order.  */

static void __do_global_ctors ()
asm ("__do_global_ctors") __attribute__ ((section (".text")));

static void
__do_global_ctors ()
{
  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\
	bl.nd __do_global_ctors\
	ld blink,[fp,4]\n\
	j.d blink\n\
	ld.a fp,[sp,16]\n\
");

/* .fini section end.
   This must live at the end of the .fini section.  */

asm ("\n\
	.section .fini\n\
	ld blink,[fp,4]\n\
	j.d blink\n\
	ld.a fp,[sp,16]\n\
");

#endif /* CRT_FINI */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]