This is the mail archive of the binutils@sourceware.cygnus.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]

AVR linker script minor changes


These AVR linker script changes make it possible to change start address
of the data section from the default 0x60 (currently hardcoded in gcrt1.S
but will be changed to __data_start), and define the stack at link time
instead of main() compile time ("avr-gcc -minit-stack=__stack" can then
be made the default).

Thanks,
Marek


2000-05-23  Marek Michalkiewicz  <marekm@linux.org.pl>

	* emulparams/avr1200.sh (STACK): Define as 0.
	* emulparams/avr23xx.sh (STACK): Define as last internal SRAM address.
	* emulparams/avr4433.sh (STACK): Likewise.
	* emulparams/avr44x4.sh (STACK): Likewise.
	* emulparams/avr85xx.sh (STACK): Likewise.
	* emulparams/avrmega103.sh (STACK): Likewise.
	* emulparams/avrmega161.sh (STACK): Likewise.
	* emulparams/avrmega603.sh (STACK): Likewise.
	* scripttempl/elf32avr.sc (__data_start): Define for gcrt1.
	(__stack): Define from ${STACK} for main().

Index: ld/emulparams/avr1200.sh
===================================================================
RCS file: /cvs/src/src/ld/emulparams/avr1200.sh,v
retrieving revision 1.1
diff -c -3 -p -r1.1 avr1200.sh
*** avr1200.sh	2000/03/27 08:39:14	1.1
--- avr1200.sh	2000/05/23 09:39:47
*************** TEMPLATE_NAME=generic
*** 9,11 ****
--- 9,12 ----
  TEXT_LENGTH=1K
  DATA_LENGTH=0
  EEPROM_LENGTH=64
+ STACK=0
Index: ld/emulparams/avr23xx.sh
===================================================================
RCS file: /cvs/src/src/ld/emulparams/avr23xx.sh,v
retrieving revision 1.1
diff -c -3 -p -r1.1 avr23xx.sh
*** avr23xx.sh	2000/03/27 08:39:14	1.1
--- avr23xx.sh	2000/05/23 09:39:47
*************** TEMPLATE_NAME=generic
*** 9,12 ****
--- 9,13 ----
  TEXT_LENGTH=2K
  DATA_LENGTH=128
  EEPROM_LENGTH=128
+ STACK=0x0DF
  
Index: ld/emulparams/avr4433.sh
===================================================================
RCS file: /cvs/src/src/ld/emulparams/avr4433.sh,v
retrieving revision 1.1
diff -c -3 -p -r1.1 avr4433.sh
*** avr4433.sh	2000/03/27 08:39:14	1.1
--- avr4433.sh	2000/05/23 09:39:47
*************** TEMPLATE_NAME=generic
*** 9,12 ****
--- 9,13 ----
  TEXT_LENGTH=4K
  DATA_LENGTH=128
  EEPROM_LENGTH=256
+ STACK=0x0DF
  
Index: ld/emulparams/avr44x4.sh
===================================================================
RCS file: /cvs/src/src/ld/emulparams/avr44x4.sh,v
retrieving revision 1.1
diff -c -3 -p -r1.1 avr44x4.sh
*** avr44x4.sh	2000/03/27 08:39:14	1.1
--- avr44x4.sh	2000/05/23 09:39:47
*************** TEMPLATE_NAME=generic
*** 9,12 ****
--- 9,13 ----
  TEXT_LENGTH=4K
  DATA_LENGTH=256
  EEPROM_LENGTH=256
+ STACK=0x15F
  
Index: ld/emulparams/avr85xx.sh
===================================================================
RCS file: /cvs/src/src/ld/emulparams/avr85xx.sh,v
retrieving revision 1.1
diff -c -3 -p -r1.1 avr85xx.sh
*** avr85xx.sh	2000/03/27 08:39:14	1.1
--- avr85xx.sh	2000/05/23 09:39:47
*************** TEMPLATE_NAME=generic
*** 9,12 ****
--- 9,13 ----
  TEXT_LENGTH=8K
  DATA_LENGTH=512
  EEPROM_LENGTH=512
+ STACK=0x25F
  
Index: ld/emulparams/avrmega103.sh
===================================================================
RCS file: /cvs/src/src/ld/emulparams/avrmega103.sh,v
retrieving revision 1.1
diff -c -3 -p -r1.1 avrmega103.sh
*** avrmega103.sh	2000/03/27 08:39:14	1.1
--- avrmega103.sh	2000/05/23 09:39:47
*************** TEMPLATE_NAME=generic
*** 9,12 ****
--- 9,13 ----
  TEXT_LENGTH=128K
  DATA_LENGTH=4K
  EEPROM_LENGTH=4K
+ STACK=0x0FFF
  
Index: ld/emulparams/avrmega161.sh
===================================================================
RCS file: /cvs/src/src/ld/emulparams/avrmega161.sh,v
retrieving revision 1.1
diff -c -3 -p -r1.1 avrmega161.sh
*** avrmega161.sh	2000/03/27 08:39:14	1.1
--- avrmega161.sh	2000/05/23 09:39:47
*************** TEMPLATE_NAME=generic
*** 9,12 ****
--- 9,13 ----
  TEXT_LENGTH=16K
  DATA_LENGTH=1K
  EEPROM_LENGTH=512
+ STACK=0x45F
  
Index: ld/emulparams/avrmega603.sh
===================================================================
RCS file: /cvs/src/src/ld/emulparams/avrmega603.sh,v
retrieving revision 1.1
diff -c -3 -p -r1.1 avrmega603.sh
*** avrmega603.sh	2000/03/27 08:39:14	1.1
--- avrmega603.sh	2000/05/23 09:39:48
*************** TEMPLATE_NAME=generic
*** 9,12 ****
--- 9,13 ----
  TEXT_LENGTH=64K
  DATA_LENGTH=4K
  EEPROM_LENGTH=2K
+ STACK=0x0FFF
  
Index: ld/scripttempl/elf32avr.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/elf32avr.sc,v
retrieving revision 1.1
diff -c -3 -p -r1.1 elf32avr.sc
*** elf32avr.sc	2000/03/27 08:39:14	1.1
--- elf32avr.sc	2000/05/23 09:39:48
*************** SECTIONS
*** 88,93 ****
--- 88,94 ----
  
    .data	${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
    {
+     ${RELOCATING+ PROVIDE (__data_start = .) ; }
      *(.data)
      *(.gnu.linkonce.d*)
      ${RELOCATING+. = ALIGN(2);}
*************** SECTIONS
*** 144,149 ****
--- 145,151 ----
    .debug_loc      0 : { *(.debug_loc) }
    .debug_macinfo  0 : { *(.debug_macinfo) }
  
+   PROVIDE (__stack = ${STACK}) ;
  }
  EOF
  


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