This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[patch] tic4x arch tagging fix
- From: "Svein E. Seldal" <Svein dot Seldal at solidas dot com>
- To: binutils at sources dot redhat dot com
- Date: Mon, 20 Jan 2003 23:37:33 +0100
- Subject: [patch] tic4x arch tagging fix
Hello,
I've committed an arch tagging patch to the repository. It enables
binutils tools to be able to differentiate c3x and c4x code.
Svein
ChangeLogs:
* bfd/coffcode.h (coff_set_flags): Added get/set arch hooks.
* include/coff/tic4x.h (TICOFF_TARGET_MACHINE_GET): Fixed define bug
* include/coff/ti.h (TICOFF_TARGET_MACHINE_GET): Added macros
* ld/Makefile.am: Added etic3xcoff.o and etic4xcoff_onchip.o
* ld/Makefile.in: Regenerate
* ld/configure.tgt: Added extra target emulations
* ld/emulparams/tic3xcoff.sh: Remove old settings
* ld/emulparams/tic4xcoff.sh: Ditto
* ld/emulparams/tic3xcoff-onchip.sh: Added new
* ld/scripttempl/tic4xcoff.sc: Revise and combine both c3x and c4x
* ld/scripttempl/tic3xcoff.sc: Remove
? build.tic4x
? gas/doc/all.texi.new
? gas/doc/as.texinfo.new
? gas/doc/c-tic4x.texi
? gas/doc/Makefile.am.new
? gas/doc/Makefile.in.new
? ld/ldlang.c.new
Index: bfd/ChangeLog
===================================================================
RCS file: /cvs/src/src/bfd/ChangeLog,v
retrieving revision 1.1887
diff -c -3 -p -r1.1887 ChangeLog
*** bfd/ChangeLog 20 Jan 2003 18:06:21 -0000 1.1887
--- bfd/ChangeLog 20 Jan 2003 22:30:51 -0000
***************
*** 1,3 ****
--- 1,7 ----
+ 2003-01-20 Svein E. Seldal <Svein.Seldal@solidas.com>
+
+ * coffcode.h (coff_set_flags): Added get/set arch hooks.
+
2003-01-20 Fabio Alemagna <falemagn@aros.org>
* elf32-sh.c: Treat elfNN_bed like other macros defined in
Index: bfd/coffcode.h
===================================================================
RCS file: /cvs/src/src/bfd/coffcode.h,v
retrieving revision 1.85
diff -c -3 -p -r1.85 coffcode.h
*** bfd/coffcode.h 20 Dec 2002 22:41:13 -0000 1.85
--- bfd/coffcode.h 20 Jan 2003 22:30:55 -0000
*************** coff_set_arch_mach_hook (abfd, filehdr)
*** 2128,2133 ****
--- 2128,2134 ----
/* this TI COFF section should be used by all new TI COFF v0 targets */
case TICOFF0MAGIC:
arch = TICOFF_TARGET_ARCH;
+ machine = TICOFF_TARGET_MACHINE_GET (internal_f->f_flags);
break;
#endif
#endif
*************** coff_set_arch_mach_hook (abfd, filehdr)
*** 2142,2147 ****
--- 2143,2149 ----
#ifdef TI_TARGET_ID
case TI_TARGET_ID:
arch = TICOFF_TARGET_ARCH;
+ machine = TICOFF_TARGET_MACHINE_GET (internal_f->f_flags);
break;
#endif
default:
*************** coff_set_flags (abfd, magicp, flagsp)
*** 2612,2617 ****
--- 2614,2620 ----
return FALSE;
}
}
+ TICOFF_TARGET_MACHINE_SET (flagsp, bfd_get_mach (abfd));
return TRUE;
#endif
Index: include/ChangeLog
===================================================================
RCS file: /cvs/src/src/include/ChangeLog,v
retrieving revision 1.194
diff -c -3 -p -r1.194 ChangeLog
*** include/ChangeLog 10 Jan 2003 03:27:25 -0000 1.194
--- include/ChangeLog 20 Jan 2003 22:30:56 -0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2003-01-20 Svein E. Seldal <Svein.Seldal@solidas.com>
+
+ * coff/tic4x.h (TICOFF_TARGET_MACHINE_GET): Fixed define bug
+ * coff/ti.h (TICOFF_TARGET_MACHINE_GET): Added macros
+
2002-07-17 Geoffrey Keating <geoffk@redhat.com>
* splay-tree.h (GTY): Define if undefined.
Index: include/coff/ti.h
===================================================================
RCS file: /cvs/src/src/include/coff/ti.h,v
retrieving revision 1.13
diff -c -3 -p -r1.13 ti.h
*** include/coff/ti.h 28 Aug 2002 10:38:48 -0000 1.13
--- include/coff/ti.h 20 Jan 2003 22:30:56 -0000
*************** struct external_filehdr
*** 57,62 ****
--- 57,70 ----
#error "TICOFF_TARGET_ARCH needs to be defined for your CPU"
#endif
+ #ifndef TICOFF_TARGET_MACHINE_GET
+ #define TICOFF_TARGET_MACHINE_GET(FLAGS) 0
+ #endif
+
+ #ifndef TICOFF_TARGET_MACHINE_SET
+ #define TICOFF_TARGET_MACHINE_SET(FLAGSP, MACHINE)
+ #endif
+
/* Default to COFF2 for file output */
#ifndef TICOFF_DEFAULT_MAGIC
#define TICOFF_DEFAULT_MAGIC TICOFF2MAGIC
Index: include/coff/tic4x.h
===================================================================
RCS file: /cvs/src/src/include/coff/tic4x.h,v
retrieving revision 1.1
diff -c -3 -p -r1.1 tic4x.h
*** include/coff/tic4x.h 28 Aug 2002 10:38:48 -0000 1.1
--- include/coff/tic4x.h 20 Jan 2003 22:30:56 -0000
***************
*** 30,43 ****
/* We use COFF2. */
#define TICOFF_DEFAULT_MAGIC TICOFF2MAGIC
! #define TICOFF_TARGET_MACHINE_GET (FLAGS) \
(((FLAGS) & F_VERS) ? bfd_mach_c4x : bfd_mach_c3x)
! #define TICOFF_TARGET_MACHINE_SET (FLAGSP, MACHINE) \
do \
{ \
if ((MACHINE) == bfd_mach_c4x) \
! *(FLAGSP) = F_VERS; \
} \
while (0)
--- 30,43 ----
/* We use COFF2. */
#define TICOFF_DEFAULT_MAGIC TICOFF2MAGIC
! #define TICOFF_TARGET_MACHINE_GET(FLAGS) \
(((FLAGS) & F_VERS) ? bfd_mach_c4x : bfd_mach_c3x)
! #define TICOFF_TARGET_MACHINE_SET(FLAGSP, MACHINE) \
do \
{ \
if ((MACHINE) == bfd_mach_c4x) \
! *(FLAGSP) |= F_VERS; \
} \
while (0)
Index: ld/ChangeLog
===================================================================
RCS file: /cvs/src/src/ld/ChangeLog,v
retrieving revision 1.839
diff -c -3 -p -r1.839 ChangeLog
*** ld/ChangeLog 17 Jan 2003 10:36:49 -0000 1.839
--- ld/ChangeLog 20 Jan 2003 22:30:56 -0000
***************
*** 1,3 ****
--- 1,14 ----
+ 2003-01-19 Svein E. Seldal <Svein.Seldal@solidas.com>
+
+ * Makefile.am: Added etic3xcoff.o and etic4xcoff_onchip.o
+ * Makefile.in: Regenerate
+ * configure.tgt: Added extra target emulations
+ * emulparams/tic3xcoff.sh: Remove old settings
+ * emulparams/tic4xcoff.sh: Ditto
+ * emulparams/tic3xcoff-onchip.sh: Added new
+ * scripttempl/tic4xcoff.sc: Revise and combine both c3x and c4x
+ * scripttempl/tic3xcoff.sc: Remove
+
2003-01-17 Andreas Jaeger <aj@suse.de>
* emultempl/elf32.em (gld${EMULATION_NAME}_add_sysroot): Do not
Index: ld/Makefile.am
===================================================================
RCS file: /cvs/src/src/ld/Makefile.am,v
retrieving revision 1.120
diff -c -3 -p -r1.120 Makefile.am
*** ld/Makefile.am 6 Jan 2003 16:13:56 -0000 1.120
--- ld/Makefile.am 20 Jan 2003 22:30:57 -0000
*************** ALL_EMULATIONS = \
*** 324,329 ****
--- 324,331 ----
esun4.o \
etic30aout.o \
etic30coff.o \
+ etic3xcoff.o \
+ etic3xcoff_onchip.o \
etic4xcoff.o \
etic54xcoff.o \
etic80coff.o \
*************** etic30aout.c: $(srcdir)/emulparams/tic30
*** 1299,1304 ****
--- 1301,1312 ----
etic30coff.c: $(srcdir)/emulparams/tic30coff.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic30coff.sc ${GEN_DEPENDS}
${GENSCRIPTS} tic30coff "$(tdir_tic30coff)"
+ etic3xcoff.c: $(srcdir)/emulparams/tic3xcoff.sh \
+ $(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic4xcoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} tic3xcoff "$(tdir_tic4xcoff)"
+ etic3xcoff_onchip.c: $(srcdir)/emulparams/tic3xcoff_onchip.sh \
+ $(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic4xcoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} tic3xcoff "$(tdir_tic4xcoff)"
etic4xcoff.c: $(srcdir)/emulparams/tic4xcoff.sh \
$(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic4xcoff.sc ${GEN_DEPENDS}
${GENSCRIPTS} tic4xcoff "$(tdir_tic4xcoff)"
Index: ld/Makefile.in
===================================================================
RCS file: /cvs/src/src/ld/Makefile.in,v
retrieving revision 1.131
diff -c -3 -p -r1.131 Makefile.in
*** ld/Makefile.in 16 Jan 2003 04:11:53 -0000 1.131
--- ld/Makefile.in 20 Jan 2003 22:30:58 -0000
***************
*** 1,6 ****
! # Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
! # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
--- 1,6 ----
! # Makefile.in generated automatically by automake 1.4 from Makefile.am
! # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
*************** ALL_EMULATIONS = \
*** 438,443 ****
--- 438,445 ----
esun4.o \
etic30aout.o \
etic30coff.o \
+ etic3xcoff.o \
+ etic3xcoff_onchip.o \
etic4xcoff.o \
etic54xcoff.o \
etic80coff.o \
*************** uninstall-info:
*** 769,775 ****
else ii=; fi; \
list='$(INFO_DEPS)'; \
for file in $$list; do \
! test -z "$$ii" \
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
done
@$(NORMAL_UNINSTALL)
--- 771,777 ----
else ii=; fi; \
list='$(INFO_DEPS)'; \
for file in $$list; do \
! test -z "$ii" \
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
done
@$(NORMAL_UNINSTALL)
*************** maintainer-clean-recursive:
*** 882,888 ****
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
! test "$$subdir" != "." || dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
--- 884,890 ----
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
! test "$$subdir" = "." && dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
*************** distclean-generic:
*** 1063,1069 ****
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
! -test -z "ldlex.cdeffilep.hdeffilep.cldgram.hldgram.c$(MAINTAINERCLEANFILES)" || rm -f ldlex.c deffilep.h deffilep.c ldgram.h ldgram.c $(MAINTAINERCLEANFILES)
mostlyclean-am: mostlyclean-hdr mostlyclean-noinstPROGRAMS \
mostlyclean-compile mostlyclean-libtool \
mostlyclean-aminfo mostlyclean-tags mostlyclean-generic \
--- 1065,1071 ----
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
! -test -z "ldlexldeffilephdeffilepcldgramhldgramc$(MAINTAINERCLEANFILES)" || rm -f ldlexl deffileph deffilepc ldgramh ldgramc $(MAINTAINERCLEANFILES)
mostlyclean-am: mostlyclean-hdr mostlyclean-noinstPROGRAMS \
mostlyclean-compile mostlyclean-libtool \
mostlyclean-aminfo mostlyclean-tags mostlyclean-generic \
*************** etic30aout.c: $(srcdir)/emulparams/tic30
*** 2025,2030 ****
--- 2027,2038 ----
etic30coff.c: $(srcdir)/emulparams/tic30coff.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic30coff.sc ${GEN_DEPENDS}
${GENSCRIPTS} tic30coff "$(tdir_tic30coff)"
+ etic3xcoff.c: $(srcdir)/emulparams/tic3xcoff.sh \
+ $(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic4xcoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} tic3xcoff "$(tdir_tic4xcoff)"
+ etic3xcoff_onchip.c: $(srcdir)/emulparams/tic3xcoff_onchip.sh \
+ $(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic4xcoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} tic3xcoff "$(tdir_tic4xcoff)"
etic4xcoff.c: $(srcdir)/emulparams/tic4xcoff.sh \
$(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic4xcoff.sc ${GEN_DEPENDS}
${GENSCRIPTS} tic4xcoff "$(tdir_tic4xcoff)"
Index: ld/configure.tgt
===================================================================
RCS file: /cvs/src/src/ld/configure.tgt,v
retrieving revision 1.116
diff -c -3 -p -r1.116 configure.tgt
*** ld/configure.tgt 6 Jan 2003 16:13:57 -0000 1.116
--- ld/configure.tgt 20 Jan 2003 22:30:58 -0000
*************** powerpc-*-windiss*) targ_emul=elf32ppcwi
*** 509,515 ****
rs6000-*-aix5*) targ_emul=aix5rs6 ;;
rs6000-*-aix*) targ_emul=aixrs6 ;;
tic30-*-*aout*) targ_emul=tic30aout ;;
! tic30-*-*coff*) targ_emul=tic30coff ;;
tic4x-*-* | c4x-*-*) targ_emul=tic4xcoff ;;
tic54x-*-* | c54x*-*-*) targ_emul=tic54xcoff ;;
tic80-*-*) targ_emul=tic80coff ;;
--- 509,515 ----
rs6000-*-aix5*) targ_emul=aix5rs6 ;;
rs6000-*-aix*) targ_emul=aixrs6 ;;
tic30-*-*aout*) targ_emul=tic30aout ;;
! tic30-*-*coff*) targ_emul=tic30coff ; targ_extra_emuls="tic3xcoff tic3xcoff_onchip" ;;
tic4x-*-* | c4x-*-*) targ_emul=tic4xcoff ;;
tic54x-*-* | c54x*-*-*) targ_emul=tic54xcoff ;;
tic80-*-*) targ_emul=tic80coff ;;
Index: ld/emulparams/tic3xcoff.sh
===================================================================
RCS file: /cvs/src/src/ld/emulparams/tic3xcoff.sh,v
retrieving revision 1.1
diff -c -3 -p -r1.1 tic3xcoff.sh
*** ld/emulparams/tic3xcoff.sh 28 Aug 2002 10:38:50 -0000 1.1
--- ld/emulparams/tic3xcoff.sh 20 Jan 2003 22:30:58 -0000
*************** SCRIPT_NAME=tic4xcoff
*** 2,9 ****
OUTPUT_FORMAT="coff2-c4x"
OUTPUT_ARCH="c3x"
ARCH=c3x
- #ENTRY=_c_int00
- TEXT_START_ADDR=0x0080
- TARGET_PAGE_SIZE=0x1000
TEMPLATE_NAME=ticoff
OUTPUT_FORMAT_TEMPLATE=tic4x
--- 2,6 ----
Index: ld/emulparams/tic4xcoff.sh
===================================================================
RCS file: /cvs/src/src/ld/emulparams/tic4xcoff.sh,v
retrieving revision 1.1
diff -c -3 -p -r1.1 tic4xcoff.sh
*** ld/emulparams/tic4xcoff.sh 28 Aug 2002 10:38:50 -0000 1.1
--- ld/emulparams/tic4xcoff.sh 20 Jan 2003 22:30:58 -0000
*************** SCRIPT_NAME=tic4xcoff
*** 2,9 ****
OUTPUT_FORMAT="coff2-c4x"
OUTPUT_ARCH="c4x"
ARCH=c4x
- #ENTRY=_c_int00
- TEXT_START_ADDR=0x0080
- TARGET_PAGE_SIZE=0x1000
TEMPLATE_NAME=ticoff
OUTPUT_FORMAT_TEMPLATE=tic4x
--- 2,6 ----
Index: ld/scripttempl/tic4xcoff.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/tic4xcoff.sc,v
retrieving revision 1.1
diff -c -3 -p -r1.1 tic4xcoff.sc
*** ld/scripttempl/tic4xcoff.sc 28 Aug 2002 10:38:50 -0000 1.1
--- ld/scripttempl/tic4xcoff.sc 20 Jan 2003 22:30:58 -0000
***************
*** 1,52 ****
! # 32 interrupt vectors + 32 trap vectors each of 4 bytes
! # The .bss and .data sections need to be contiguous for direct addressing
! # The data page pointer gets loaded with the start of .bss
! # TI C compiler uses .cinit to initialise variables in .bss
test -z "$ENTRY" && ENTRY=_start
! # These are substituted in as variables in order to get '}' in a shell
! # conditional expansion.
! INIT='.init : { *(.init) }'
! FINI='.fini : { *(.fini) }'
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH("${OUTPUT_ARCH}")
${LIB_SEARCH_DIRS}
-
ENTRY(${ENTRY})
! ${RELOCATING+ __SYSMEM_SIZE = DEFINED(__SYSMEM_SIZE) ? __SYSMEM_SIZE : 0x4000;}
! ${RELOCATING+ __STACK_SIZE = DEFINED(__STACK_SIZE) ? __STACK_SIZE : 0x1000;}
SECTIONS
{
! .comms ${RELOCATING+ 64} : {
! *(.comms)
! }
! .bss ${RELOCATING+ SIZEOF(.comms) + ADDR(.comms)} : {
! ${RELOCATING+ .bss = .;}
! *(.bss)
! *(COMMON)
! ${RELOCATING+ end = .;}
! ${RELOCATING+ _end = end;}
! }
! .data ${RELOCATING+ SIZEOF(.bss) + ADDR(.bss)} :
! {
! ${RELOCATING+ .data = .;}
! *(.data)
! ${RELOCATING+ edata = .;}
! }
! .const ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
! {
*(.const)
! }
! .cinit ${RELOCATING+ SIZEOF(.const) + ADDR(.const)} :
! {
! ${RELOCATING+ cinit = .;}
! *(.cinit)
! LONG(0);
! }
! .text ${RELOCATING+ SIZEOF(.cinit) + ADDR(.cinit)} : {
! ${RELOCATING+ .text = .;}
${RELOCATING+ *(.init)}
*(.text)
${CONSTRUCTING+ ___CTOR_LIST__ = .;}
--- 1,102 ----
! # In microcomputer (MC) mode, the vectors are mapped into the on-chip ROM,
! # otherwise in microprocessor (MP) mode the vectors are mapped to address 0
! # on the external bus. In MC mode, the on-chip ROM contains a bootloader program
! # that loads the internal RAM from the serial port or external ROM.
! #
! # Common configurations:
! # 1. MC mode, no external memory (serial boot).
! # 2. MC mode, external RAM (serial boot).
! # 3. MC mode, external ROM.
! # 4. MC mode, external ROM, external RAM.
! # 5. MP mode, external ROM.
! # 6. MP mode, external ROM, external RAM.
! # 7. MP mode, external RAM (dual-port with hosting CPU or external debugger).
! #
! # Config TEXT DATA/BSS
! # 1. INT_RAM INT_RAM (mcmode,onchip)
! # 2. EXT_RAM EXT_RAM (mcmode,extram)
! # 3. INT_RAM INT_RAM (mcmode,onchip)
! # 4. EXT_RAM EXT_RAM (mcmode,extram)
! # 5. EXT_ROM INT_RAM (mpmode,onchip,extrom)
! # 6. EXT_ROM EXT_RAM (mpmode,extram,extrom)
! # 7. EXT_RAM EXT_RAM (mpmode,extram)
! #
! # In MC mode, TEXT and DATA are copied into RAM by the bootloader.
! #
! # In MP mode with external ROM, DATA needs to be copied into RAM at boot time.
! #
! # If there is external RAM it is better to use that and reserve the internal RAM
! # for data buffers. However, the address of the external RAM needs to be specified.
! #
! # This emulation assumes config 7.
!
! case $OUTPUT_ARCH in
! c3x) OUTPUT_ARCHNAME="TMS320C3x" ;;
! c4x) OUTPUT_ARCHNAME="TMS320C4x" ;;
! esac
!
! case $ONCHIP in
! yes) RAM=RAM;
! STACK_SIZE_DEFAULT=128;
! HEAP_SIZE_DEFAULT=0;
! ;;
! *) RAM=EXT0;
! STACK_SIZE_DEFAULT=0x1000;
! HEAP_SIZE_DEFAULT=0x4000;
! ;;
! esac
!
! TEXT_MEMORY=$RAM;
! DATA_MEMORY=$RAM;
!
!
! MEMORY_DEF="
! /* C30 memory space. */
! MEMORY
! {
! EXT0 : org = 0x0000000, len = 0x800000 /* External address bus. */
! XBUS : org = 0x0800000, len = 0x002000 /* Expansion bus. */
! IOBUS : org = 0x0804000, len = 0x002000 /* I/O BUS. */
! RAM0 : org = 0x0809800, len = 0x000400 /* Internal RAM block 0. */
! RAM1 : org = 0x0809a00, len = 0x000400 /* Internal RAM block 1. */
! RAM : org = 0x0809800, len = 0x000800 /* Internal RAM. */
! EXT1 : org = 0x080a000, len = 0x7f6000 /* External address bus. */
! }
! "
test -z "$ENTRY" && ENTRY=_start
!
cat <<EOF
+ ${RELOCATING+/* Linker script for $OUTPUT_ARCHNAME executable. */}
+ ${RELOCATING-/* Linker script for $OUTPUT_ARCHNAME object file (ld -r). */}
+
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH("${OUTPUT_ARCH}")
${LIB_SEARCH_DIRS}
ENTRY(${ENTRY})
!
! ${RELOCATING+ __HEAP_SIZE = DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : ${HEAP_SIZE_DEFAULT};}
! ${RELOCATING+ __STACK_SIZE = DEFINED(__STACK_SIZE) ? __STACK_SIZE : ${STACK_SIZE_DEFAULT};}
!
! ${RELOCATING+${MEMORY_DEF}}
!
! /* In the small memory model the .data and .bss sections must be contiguous
! when loaded and fit within the same page. The DP register is loaded
! with the page address. */
SECTIONS
{
! /* Reset, interrupt, and trap vectors. */
! .vectors ${RELOCATING+ 0} : {
! *(.vectors)
! } ${RELOCATING+ > ${TEXT_MEMORY}}
! /* Constants. */
! .const : {
*(.const)
! } ${RELOCATING+ > ${TEXT_MEMORY}}
! /* Program code. */
! .text : {
! ${RELOCATING+ __text = .;}
${RELOCATING+ *(.init)}
*(.text)
${CONSTRUCTING+ ___CTOR_LIST__ = .;}
*************** SECTIONS
*** 60,92 ****
${CONSTRUCTING+ LONG(0)}
${CONSTRUCTING+ ___DTOR_END__ = .;}
${RELOCATING+ *(.fini)}
! ${RELOCATING+ etext = .;}
! ${RELOCATING+ _etext = etext;}
! }
! .stack ${RELOCATING+ SIZEOF(.text) + ADDR(.text)} :
{
*(.stack)
${RELOCATING+ . = . + __STACK_SIZE};
! }
! .sysmem ${RELOCATING+ SIZEOF(.stack) + ADDR(.stack)} :
! {
! *(.sysmem)
! }
! .heap ${RELOCATING+ SIZEOF(.sysmem) + ADDR(.sysmem)} :
! {
! ${RELOCATING+ . += __SYSMEM_SIZE - SIZEOF(.sysmem)};
! }
! ${RELOCATING- ${INIT}}
! ${RELOCATING- ${FINI}}
! .stab 0 ${RELOCATING+(NOLOAD)} :
{
[ .stab ]
}
! .stabstr 0 ${RELOCATING+(NOLOAD)} :
{
[ .stabstr ]
}
- /* The TI tools sets cinit to -1 if the ram model is used. */
- ${RELOCATING+ cinit = SIZEOF(.cinit) == 1 ? cinit : -1;}
}
EOF
--- 110,151 ----
${CONSTRUCTING+ LONG(0)}
${CONSTRUCTING+ ___DTOR_END__ = .;}
${RELOCATING+ *(.fini)}
! ${RELOCATING+ __etext = .;}
! } ${RELOCATING+ > ${TEXT_MEMORY}}
! /* Global initialised variables. */
! .data :
! {
! ${RELOCATING+ __data = .;}
! *(.data)
! ${RELOCATING+ __edata = .;}
! } ${RELOCATING+ > ${DATA_MEMORY}}
! /* Global uninitialised variables. */
! .bss : {
! ${RELOCATING+ __bss = .;}
! *(.bss)
! *(COMMON)
! ${RELOCATING+ __end = .;}
! } ${RELOCATING+ > ${DATA_MEMORY}}
! /* Heap. */
! .heap :
{
+ ${RELOCATING+ __heap = .;}
+ ${RELOCATING+ . += __HEAP_SIZE};
+ } ${RELOCATING+ > ${DATA_MEMORY}}
+ /* Stack (grows upward). */
+ .stack :
+ {
+ ${RELOCATING+ __stack = .;}
*(.stack)
${RELOCATING+ . = . + __STACK_SIZE};
! } ${RELOCATING+ > ${DATA_MEMORY}}
! .stab 0 ${RELOCATING+(NOLOAD)} :
{
[ .stab ]
}
! .stabstr 0 ${RELOCATING+(NOLOAD)} :
{
[ .stabstr ]
}
}
EOF