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]
Other format: [Raw text]

stack allocation for sh64-elf


I've found that a lot of c++ tests fail due to a lack of memory.
Half a megabyte is find for fine for a lot of C programs, but
anything linked against libstdc++-v3 with all its constructors
and destructors that pull in automatically large parts of the
library is just to bulky.  Therefore, I want to make the stack
allocation configurable, like for sh-elf, with the attached patch.
I'm not sure if this will require a change for netbsd as well.

-- 
--------------------------
SuperH (UK) Ltd.
2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX
T:+44 1454 465658
Index: emulparams/shelf32.sh
===================================================================
RCS file: /cvs/src/src/ld/emulparams/shelf32.sh,v
retrieving revision 1.2
diff -p -r1.2 shelf32.sh
*** emulparams/shelf32.sh	17 Apr 2002 19:31:49 -0000	1.2
--- emulparams/shelf32.sh	30 Jun 2003 14:58:54 -0000
***************
*** 3,9 ****
  SCRIPT_NAME=elf
  OUTPUT_FORMAT=${OUTPUT_FORMAT-"elf32-sh64"}
  TEXT_START_ADDR=0x1000
- STACK_ADDR='ALIGN (0x40000) + 0x40000'
  MAXPAGESIZE=128
  ARCH=sh
  MACHINE=sh5
--- 3,8 ----
*************** DTOR_END='___dtors_end = .;'
*** 34,42 ****
  # Do not use the varname=${varname-'string'} construct here; there are
  # problems with that on some shells (e.g. on Solaris) where there is a bug
  # that trigs when $varname contains a "}".
! OTHER_SECTIONS='
   .cranges 0 : { *(.cranges) }
! '
  
  # We need to adjust sizes in the .cranges section after relaxation, so
  # we need an after_allocation function, and it goes in this file.
--- 33,53 ----
  # Do not use the varname=${varname-'string'} construct here; there are
  # problems with that on some shells (e.g. on Solaris) where there is a bug
  # that trigs when $varname contains a "}".
! # The effect of the .stack definition is like setting STACK_ADDR to 0x80000,
! # except that the setting can be overridden, e.g. --defsym _stack=0x0f00,
! # and that we put an extra sentinal value at the bottom.
! # N.B. We can't use PROVIDE to set the default value in a symbol because
! # the address is needed to place the .stack section, which in turn is needed
! # to hold the sentinel value(s).
! OTHER_SECTIONS="
!  .stack ${RELOCATING-0}${RELOCATING+(DEFINED(_stack) ? _stack : ALIGN (0x40000) + 0x40000)} :
!   {
!     ${RELOCATING+_stack = .;}
!     *(.stack)
!     LONG(0xdeaddead)
!   }
   .cranges 0 : { *(.cranges) }
! "
  
  # We need to adjust sizes in the .cranges section after relaxation, so
  # we need an after_allocation function, and it goes in this file.
Index: emulparams/shelf64.sh
===================================================================
RCS file: /cvs/src/src/ld/emulparams/shelf64.sh,v
retrieving revision 1.1
diff -p -r1.1 shelf64.sh
*** emulparams/shelf64.sh	8 Feb 2002 06:38:59 -0000	1.1
--- emulparams/shelf64.sh	30 Jun 2003 14:58:54 -0000
*************** EXTRA_EM_FILE=
*** 6,9 ****
  . ${srcdir}/emulparams/shelf32.sh
  
  # We do not need .cranges
! OTHER_SECTIONS=''
--- 6,16 ----
  . ${srcdir}/emulparams/shelf32.sh
  
  # We do not need .cranges
! OTHER_SECTIONS="
!  .stack ${RELOCATING-0}${RELOCATING+(DEFINED(_stack) ? _stack : ALIGN (0x40000) + 0x40000)} :
!   {
!     ${RELOCATING+_stack = .;}
!     *(.stack)
!     LONG(0xdeaddead)
!   }
! "

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