Ticket #2442: 0001-avr-avrtest-Remove-obselete.patch

File 0001-avr-avrtest-Remove-obselete.patch, 37.0 KB (added by Ralph Holmes, on 12/19/15 at 16:12:20)
  • c/src/lib/libbsp/avr/acinclude.m4

    From de3b0149f6861a3098b1b1ff69bf391fd40a3293 Mon Sep 17 00:00:00 2001
    From: Ralph Holmes <ralph@ybden.com>
    Date: Fri, 18 Dec 2015 16:14:35 +0000
    Subject: [PATCH] avr/avrtest: Remove (obselete).
    
    Updates #2442.
    ---
     c/src/lib/libbsp/avr/acinclude.m4                  |   2 -
     c/src/lib/libbsp/avr/avrtest/Makefile.am           |  47 ---
     c/src/lib/libbsp/avr/avrtest/README                |  33 --
     c/src/lib/libbsp/avr/avrtest/bsp_specs             |  15 -
     c/src/lib/libbsp/avr/avrtest/configure.ac          |  20 --
     c/src/lib/libbsp/avr/avrtest/console/console-io.c  |  68 ----
     c/src/lib/libbsp/avr/avrtest/include/bsp.h         |  37 ---
     .../avr/avrtest/make/custom/avrtest-testsuite.tcfg |  12 -
     .../lib/libbsp/avr/avrtest/make/custom/avrtest.cfg |  15 -
     c/src/lib/libbsp/avr/avrtest/preinstall.am         |  71 ----
     c/src/lib/libbsp/avr/avrtest/start/macros.inc      | 364 ---------------------
     c/src/lib/libbsp/avr/avrtest/start/start.S         | 291 ----------------
     c/src/lib/libbsp/avr/avrtest/startup/linkcmds      | 241 --------------
     13 files changed, 1216 deletions(-)
     delete mode 100644 c/src/lib/libbsp/avr/avrtest/Makefile.am
     delete mode 100644 c/src/lib/libbsp/avr/avrtest/README
     delete mode 100644 c/src/lib/libbsp/avr/avrtest/bsp_specs
     delete mode 100644 c/src/lib/libbsp/avr/avrtest/configure.ac
     delete mode 100644 c/src/lib/libbsp/avr/avrtest/console/console-io.c
     delete mode 100644 c/src/lib/libbsp/avr/avrtest/include/bsp.h
     delete mode 100644 c/src/lib/libbsp/avr/avrtest/make/custom/avrtest-testsuite.tcfg
     delete mode 100644 c/src/lib/libbsp/avr/avrtest/make/custom/avrtest.cfg
     delete mode 100644 c/src/lib/libbsp/avr/avrtest/preinstall.am
     delete mode 100644 c/src/lib/libbsp/avr/avrtest/start/macros.inc
     delete mode 100644 c/src/lib/libbsp/avr/avrtest/start/start.S
     delete mode 100644 c/src/lib/libbsp/avr/avrtest/startup/linkcmds
    
    diff --git a/c/src/lib/libbsp/avr/acinclude.m4 b/c/src/lib/libbsp/avr/acinclude.m4
    index fead999..296a6f7 100644
    a b  
    22AC_DEFUN([RTEMS_CHECK_BSPDIR],
    33[
    44  case "$1" in
    5   avrtest )
    6     AC_CONFIG_SUBDIRS([avrtest]);;
    75  *)
    86    AC_MSG_ERROR([Invalid BSP]);;
    97  esac
  • deleted file c/src/lib/libbsp/avr/avrtest/Makefile.am

    diff --git a/c/src/lib/libbsp/avr/avrtest/Makefile.am b/c/src/lib/libbsp/avr/avrtest/Makefile.am
    deleted file mode 100644
    index c164339..0000000
    + -  
    1 ACLOCAL_AMFLAGS = -I ../../../../aclocal
    2 
    3 include $(top_srcdir)/../../../../automake/compile.am
    4 include $(top_srcdir)/../../bsp.am
    5 
    6 include_bspdir = $(includedir)/bsp
    7 
    8 dist_project_lib_DATA = bsp_specs
    9 
    10 include_HEADERS = include/bsp.h
    11 include_HEADERS += ../../shared/include/tm27.h
    12 
    13 nodist_include_HEADERS = include/bspopts.h
    14 nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h
    15 nodist_include_bsp_HEADERS += ../../shared/include/console-polled.h
    16 DISTCLEANFILES = include/bspopts.h
    17 noinst_PROGRAMS =
    18 
    19 nodist_include_HEADERS += ../../shared/include/coverhd.h
    20 
    21 EXTRA_DIST = start/start.S
    22 start.$(OBJEXT): start/start.S
    23         $(CPPASCOMPILE) -o $@ -c $<
    24 project_lib_DATA = start.$(OBJEXT)
    25 
    26 dist_project_lib_DATA += startup/linkcmds
    27 
    28 startup_SOURCES = ../../shared/bspclean.c ../../shared/bsplibc.c \
    29     ../../shared/bsppredriverhook.c \
    30     ../../shared/bspgetworkarea.c ../../shared/bsppost.c \
    31     ../../shared/bspstart.c ../../shared/bootcard.c ../../shared/sbrk.c \
    32     ../../shared/gnatinstallhandler.c
    33 clock_SOURCES = ../../shared/clock_driver_simidle.c
    34 console_SOURCES = ../../shared/console-polled.c console/console-io.c
    35 timer_SOURCES = ../../shared/timerstub.c
    36 
    37 noinst_LIBRARIES = libbsp.a
    38 libbsp_a_SOURCES = $(startup_SOURCES) $(clock_SOURCES) $(console_SOURCES) \
    39     $(timer_SOURCES)
    40 
    41 # Cache
    42 libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
    43 libbsp_a_SOURCES += ../../shared/include/cache_.h
    44 libbsp_a_CPPFLAGS = -I$(srcdir)/../../shared/include
    45 
    46 include $(srcdir)/preinstall.am
    47 include $(top_srcdir)/../../../../automake/local.am
  • deleted file c/src/lib/libbsp/avr/avrtest/README

    diff --git a/c/src/lib/libbsp/avr/avrtest/README b/c/src/lib/libbsp/avr/avrtest/README
    deleted file mode 100644
    index ac097e4..0000000
    + -  
    1 This BSP is designed to operate on the AVR Mega128 variants.
    2 
    3 It has been run on AVRTEST and SIMULAVRXX simulators.
    4 
    5 
    6 AVRTEST:
    7 
    8 Download from sourceforge.net:
    9 
    10 cvs -d:pserver:anonymous@winavr.cvs.sourceforge.net:/cvsroot/winavr login
    11 cvs -z3 -d:pserver:anonymous@winavr.cvs.sourceforge.net:/cvsroot/winavr \
    12    co -P avrtest
    13 
    14 
    15 SIMULAVRXX:
    16 
    17 Download from http://savannah.nongnu.org/projects/simulavr/
    18 
    19 CVS is the only way to get the source at this time. Check project home page for updates.
    20 
    21 cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/simulavr co simulavrxx
    22 
    23 here is an example of using simulavrxx with the hello world test example.
    24 
    25 while in .../samples/hello
    26 
    27 simulavr -d atmega128 -f hello.exe -W0x52,/dev/stderr -Texit
    28 
    29 to get the help page:
    30 
    31 simulavr -h
    32 
    33 
  • deleted file c/src/lib/libbsp/avr/avrtest/bsp_specs

    diff --git a/c/src/lib/libbsp/avr/avrtest/bsp_specs b/c/src/lib/libbsp/avr/avrtest/bsp_specs
    deleted file mode 100644
    index 5457e23..0000000
    + -  
    1 %rename endfile old_endfile
    2 %rename startfile old_startfile
    3 %rename link old_link
    4 
    5 *startfile:
    6 %{!qrtems: %(old_startfile)} \
    7 %{!nostdlib: %{qrtems: start.o%s -e __init}}
    8 
    9 *endfile:
    10 %{!qrtems: %(old_endfile)} \
    11 %{!nostdlib: %{qrtems:}}
    12 
    13 *link:
    14 %(old_link) %{!qrtems: %(old_link)} %{qrtems: -dc -dp -N}
    15 
  • deleted file c/src/lib/libbsp/avr/avrtest/configure.ac

    diff --git a/c/src/lib/libbsp/avr/avrtest/configure.ac b/c/src/lib/libbsp/avr/avrtest/configure.ac
    deleted file mode 100644
    index 7b18258..0000000
    + -  
    1 ## Process this file with autoconf to produce a configure script.
    2 
    3 AC_PREREQ([2.69])
    4 AC_INIT([rtems-c-src-lib-libbsp-h8300-h8sim],[_RTEMS_VERSION],[https://devel.rtems.org/newticket])
    5 AC_CONFIG_SRCDIR([bsp_specs])
    6 RTEMS_TOP(../../../../../..)
    7 
    8 RTEMS_CANONICAL_TARGET_CPU
    9 AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.12.2])
    10 RTEMS_BSP_CONFIGURE
    11 
    12 RTEMS_PROG_CC_FOR_TARGET
    13 RTEMS_CANONICALIZE_TOOLS
    14 RTEMS_PROG_CCAS
    15 
    16 RTEMS_BSP_CLEANUP_OPTIONS(0, 0)
    17 
    18 # Explicitly list all Makefiles here
    19 AC_CONFIG_FILES([Makefile])
    20 AC_OUTPUT
  • deleted file c/src/lib/libbsp/avr/avrtest/console/console-io.c

    diff --git a/c/src/lib/libbsp/avr/avrtest/console/console-io.c b/c/src/lib/libbsp/avr/avrtest/console/console-io.c
    deleted file mode 100644
    index f02ad5d..0000000
    + -  
    1 /*
    2  *  This file contains the hardware specific portions of the TTY driver
    3  *  for the serial ports on the avr.
    4  */
    5 
    6 /*
    7  *  COPYRIGHT (c) 1989-2008.
    8  *  On-Line Applications Research Corporation (OAR).
    9  *
    10  *  The license and distribution terms for this file may be
    11  *  found in the file LICENSE in this distribution or at
    12  *  http://www.rtems.org/license/LICENSE.
    13  */
    14 
    15 #include <bsp.h>
    16 #include <bsp/console-polled.h>
    17 #include <rtems/libio.h>
    18 #include <stdlib.h>
    19 #include <assert.h>
    20 
    21 #define STDIO_PORT      0x52
    22 #define EXIT_PORT       0x4F
    23 #define ABORT_PORT      0x49
    24 
    25 /*
    26  *  console_initialize_hardware
    27  *
    28  *  This routine initializes the console hardware.
    29  *
    30  */
    31 
    32 void console_initialize_hardware(void)
    33 {
    34   return;
    35 }
    36 
    37 /*
    38  *  console_outbyte_polled
    39  *
    40  *  This routine transmits a character using polling.
    41  */
    42 void console_outbyte_polled(
    43   int  port,
    44   char ch
    45 )
    46 {
    47   *((volatile unsigned char *) STDIO_PORT) = ch;
    48 }
    49 
    50 /*
    51  *  console_inbyte_nonblocking
    52  *
    53  *  This routine polls for a character.
    54  */
    55 
    56 int console_inbyte_nonblocking(
    57   int port
    58 )
    59 {
    60   return -1;
    61 }
    62 
    63 #include <rtems/bspIo.h>
    64 
    65 static void AVRsimBSP_output_char(char c) { console_outbyte_polled( 0, c ); }
    66 
    67 BSP_output_char_function_type           BSP_output_char = AVRsimBSP_output_char;
    68 BSP_polling_getchar_function_type       BSP_poll_char = NULL;
  • deleted file c/src/lib/libbsp/avr/avrtest/include/bsp.h

    diff --git a/c/src/lib/libbsp/avr/avrtest/include/bsp.h b/c/src/lib/libbsp/avr/avrtest/include/bsp.h
    deleted file mode 100644
    index 1a16139..0000000
    + -  
    1 /*  bsp.h
    2  *
    3  *  This include file contains some definitions specific to the
    4  *  h8 simulator in gdb.
    5  *
    6  *  COPYRIGHT (c) 1989-1999.
    7  *  On-Line Applications Research Corporation (OAR).
    8  *
    9  *  The license and distribution terms for this file may be
    10  *  found in the file LICENSE in this distribution or at
    11  *  http://www.rtems.org/license/LICENSE.
    12  */
    13 
    14 #ifndef LIBBSP_AVR_AVRTEST_BSP_H
    15 #define LIBBSP_AVR_AVRTEST_BSP_H
    16 
    17 #include <bspopts.h>
    18 #include <bsp/default-initial-extension.h>
    19 
    20 #include <rtems.h>
    21 #include <rtems/iosupp.h>
    22 #include <rtems/console.h>
    23 #include <rtems/clockdrv.h>
    24 
    25 #ifdef __cplusplus
    26 extern "C" {
    27 #endif
    28 
    29 /* support for simulated clock tick */
    30 Thread clock_driver_sim_idle_body(uintptr_t);
    31 #define BSP_IDLE_TASK_BODY clock_driver_sim_idle_body
    32 
    33 #ifdef __cplusplus
    34 }
    35 #endif
    36 
    37 #endif
  • deleted file c/src/lib/libbsp/avr/avrtest/make/custom/avrtest-testsuite.tcfg

    diff --git a/c/src/lib/libbsp/avr/avrtest/make/custom/avrtest-testsuite.tcfg b/c/src/lib/libbsp/avr/avrtest/make/custom/avrtest-testsuite.tcfg
    deleted file mode 100644
    index 91d7c1b..0000000
    + -  
    1 #
    2 # The GDB AVR Simulator does not have a tick interrupt.
    3 #
    4 
    5 include: testdata/require-tick-isr.tcfg
    6 include: testdata/disable-jffs2-tests.tcfg
    7 include: testdata/disable-mrfs-tests.tcfg
    8 
    9 capture01
    10 fsbdpart01
    11 fsdosfsformat01
    12 fsdosfswrite01
  • deleted file c/src/lib/libbsp/avr/avrtest/make/custom/avrtest.cfg

    diff --git a/c/src/lib/libbsp/avr/avrtest/make/custom/avrtest.cfg b/c/src/lib/libbsp/avr/avrtest/make/custom/avrtest.cfg
    deleted file mode 100644
    index e4857cd..0000000
    + -  
    1 #
    2 #  Config file for the AVR ATmega128 on avrtest Simulator
    3 #
    4 
    5 include $(RTEMS_ROOT)/make/custom/default.cfg
    6 
    7 RTEMS_CPU=avr
    8 RTEMS_CPU_MODEL=mega128
    9 
    10 #  This contains the compiler options necessary to select the CPU model
    11 #  and (hopefully) optimize for it.
    12 CPU_CFLAGS = -mmcu=atmega128
    13 
    14 # optimize flag: typically -O2
    15 CFLAGS_OPTIMIZE_V = -Os -g
  • deleted file c/src/lib/libbsp/avr/avrtest/preinstall.am

    diff --git a/c/src/lib/libbsp/avr/avrtest/preinstall.am b/c/src/lib/libbsp/avr/avrtest/preinstall.am
    deleted file mode 100644
    index f3d7d23..0000000
    + -  
    1 ## Automatically generated by ampolish3 - Do not edit
    2 
    3 if AMPOLISH3
    4 $(srcdir)/preinstall.am: Makefile.am
    5         $(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/preinstall.am
    6 endif
    7 
    8 PREINSTALL_DIRS =
    9 DISTCLEANFILES += $(PREINSTALL_DIRS)
    10 
    11 all-am: $(PREINSTALL_FILES)
    12 
    13 PREINSTALL_FILES =
    14 CLEANFILES = $(PREINSTALL_FILES)
    15 
    16 all-local: $(TMPINSTALL_FILES)
    17 
    18 TMPINSTALL_FILES =
    19 CLEANFILES += $(TMPINSTALL_FILES)
    20 
    21 $(PROJECT_LIB)/$(dirstamp):
    22         @$(MKDIR_P) $(PROJECT_LIB)
    23         @: > $(PROJECT_LIB)/$(dirstamp)
    24 PREINSTALL_DIRS += $(PROJECT_LIB)/$(dirstamp)
    25 
    26 $(PROJECT_INCLUDE)/$(dirstamp):
    27         @$(MKDIR_P) $(PROJECT_INCLUDE)
    28         @: > $(PROJECT_INCLUDE)/$(dirstamp)
    29 PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp)
    30 
    31 $(PROJECT_INCLUDE)/bsp/$(dirstamp):
    32         @$(MKDIR_P) $(PROJECT_INCLUDE)/bsp
    33         @: > $(PROJECT_INCLUDE)/bsp/$(dirstamp)
    34 PREINSTALL_DIRS += $(PROJECT_INCLUDE)/bsp/$(dirstamp)
    35 
    36 $(PROJECT_LIB)/bsp_specs: bsp_specs $(PROJECT_LIB)/$(dirstamp)
    37         $(INSTALL_DATA) $< $(PROJECT_LIB)/bsp_specs
    38 PREINSTALL_FILES += $(PROJECT_LIB)/bsp_specs
    39 
    40 $(PROJECT_INCLUDE)/bsp.h: include/bsp.h $(PROJECT_INCLUDE)/$(dirstamp)
    41         $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp.h
    42 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp.h
    43 
    44 $(PROJECT_INCLUDE)/tm27.h: ../../shared/include/tm27.h $(PROJECT_INCLUDE)/$(dirstamp)
    45         $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/tm27.h
    46 PREINSTALL_FILES += $(PROJECT_INCLUDE)/tm27.h
    47 
    48 $(PROJECT_INCLUDE)/bspopts.h: include/bspopts.h $(PROJECT_INCLUDE)/$(dirstamp)
    49         $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h
    50 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h
    51 
    52 $(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
    53         $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
    54 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
    55 
    56 $(PROJECT_INCLUDE)/bsp/console-polled.h: ../../shared/include/console-polled.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
    57         $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/console-polled.h
    58 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/console-polled.h
    59 
    60 $(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
    61         $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
    62 PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
    63 
    64 $(PROJECT_LIB)/start.$(OBJEXT): start.$(OBJEXT) $(PROJECT_LIB)/$(dirstamp)
    65         $(INSTALL_DATA) $< $(PROJECT_LIB)/start.$(OBJEXT)
    66 TMPINSTALL_FILES += $(PROJECT_LIB)/start.$(OBJEXT)
    67 
    68 $(PROJECT_LIB)/linkcmds: startup/linkcmds $(PROJECT_LIB)/$(dirstamp)
    69         $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds
    70 PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds
    71 
  • deleted file c/src/lib/libbsp/avr/avrtest/start/macros.inc

    diff --git a/c/src/lib/libbsp/avr/avrtest/start/macros.inc b/c/src/lib/libbsp/avr/avrtest/start/macros.inc
    deleted file mode 100644
    index ddeb85d..0000000
    + -  
    1 /* Copyright (c) 2002, 2005, 2006, 2007 Marek Michalkiewicz
    2    Copyright (c) 2006 Dmitry Xmelkov
    3    All rights reserved.
    4 
    5    Redistribution and use in source and binary forms, with or without
    6    modification, are permitted provided that the following conditions are met:
    7 
    8    * Redistributions of source code must retain the above copyright
    9      notice, this list of conditions and the following disclaimer.
    10 
    11    * Redistributions in binary form must reproduce the above copyright
    12      notice, this list of conditions and the following disclaimer in
    13      the documentation and/or other materials provided with the
    14      distribution.
    15 
    16    * Neither the name of the copyright holders nor the names of
    17      contributors may be used to endorse or promote products derived
    18      from this software without specific prior written permission.
    19 
    20   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    21   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    22   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    23   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
    24   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    25   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    26   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    27   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    28   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    29   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    30   POSSIBILITY OF SUCH DAMAGE. */
    31 
    32 /*
    33    macros.inc - macros for use in assembler sources
    34 
    35    Contributors:
    36      Created by Marek Michalkiewicz <marekm@linux.org.pl>
    37  */
    38 
    39 #include <avr/io.h>
    40 
    41 /* if not defined, assume old version with underscores */
    42 #ifndef __USER_LABEL_PREFIX__
    43 #define __USER_LABEL_PREFIX__ _
    44 #endif
    45 
    46 #ifndef __REGISTER_PREFIX__
    47 #define __REGISTER_PREFIX__
    48 #endif
    49 
    50 /* the assembler line separator (just in case it ever changes) */
    51 #define _L $
    52 
    53 #define CONCAT1(a, b) CONCAT2(a, b)
    54 #define CONCAT2(a, b) a ## b
    55 
    56 #define _U(x) CONCAT1(__USER_LABEL_PREFIX__, x)
    57 
    58 #define _R(x) CONCAT1(__REGISTER_PREFIX__, x)
    59 
    60 /* these should help to fix the "can't have function named r1()" bug
    61    which may require adding '%' in front of register names.  */
    62 
    63 #define r0 _R(r0)
    64 #define r1 _R(r1)
    65 #define r2 _R(r2)
    66 #define r3 _R(r3)
    67 #define r4 _R(r4)
    68 #define r5 _R(r5)
    69 #define r6 _R(r6)
    70 #define r7 _R(r7)
    71 #define r8 _R(r8)
    72 #define r9 _R(r9)
    73 #define r10 _R(r10)
    74 #define r11 _R(r11)
    75 #define r12 _R(r12)
    76 #define r13 _R(r13)
    77 #define r14 _R(r14)
    78 #define r15 _R(r15)
    79 #define r16 _R(r16)
    80 #define r17 _R(r17)
    81 #define r18 _R(r18)
    82 #define r19 _R(r19)
    83 #define r20 _R(r20)
    84 #define r21 _R(r21)
    85 #define r22 _R(r22)
    86 #define r23 _R(r23)
    87 #define r24 _R(r24)
    88 #define r25 _R(r25)
    89 #define r26 _R(r26)
    90 #define r27 _R(r27)
    91 #define r28 _R(r28)
    92 #define r29 _R(r29)
    93 #define r30 _R(r30)
    94 #define r31 _R(r31)
    95 
    96 #ifndef __tmp_reg__
    97 #define __tmp_reg__ r0
    98 #endif
    99 
    100 #ifndef __zero_reg__
    101 #define __zero_reg__ r1
    102 #endif
    103 
    104 #if __AVR_MEGA__
    105   #define XJMP jmp
    106   #define XCALL call
    107 #else
    108   #define XJMP rjmp
    109   #define XCALL rcall
    110 #endif
    111 
    112 /* used only by fplib/strtod.S - libgcc internal function calls */
    113 #define PROLOGUE_SAVES(offset) XJMP (__prologue_saves__ + 2 * (offset))
    114 #define EPILOGUE_RESTORES(offset) XJMP (__epilogue_restores__ + 2 * (offset))
    115 
    116 #if FLASHEND > 0x10000  /* ATmega103 */
    117   #define BIG_CODE 1
    118 #else
    119   #define BIG_CODE 0
    120 #endif
    121 
    122 #ifndef __AVR_HAVE_MOVW__
    123 #  if  defined(__AVR_ENHANCED__) && __AVR_ENHANCED__
    124 #   define __AVR_HAVE_MOVW__ 1
    125 #  endif
    126 #endif
    127 
    128 #ifndef __AVR_HAVE_LPMX__
    129 # if  defined(__AVR_ENHANCED__) && __AVR_ENHANCED__
    130 #  define __AVR_HAVE_LPMX__ 1
    131 # endif
    132 #endif
    133 
    134 #ifndef __AVR_HAVE_MUL__
    135 # if  defined(__AVR_ENHANCED__) && __AVR_ENHANCED__
    136 #  define __AVR_HAVE_MUL__ 1
    137 # endif
    138 #endif
    139 
    140 /*
    141    Smart version of movw:
    142     - uses "movw" if possible (supported by MCU, and both registers even)
    143     - handles overlapping register pairs correctly
    144     - no instruction generated if source and destination are the same
    145    (may expand to 0, 1 or 2 instructions).
    146  */
    147 
    148 .macro  X_movw dst src
    149         .L_movw_dst = -1
    150         .L_movw_src = -1
    151         .L_movw_n = 0
    152         .irp  reg,      r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, \
    153                         r10,r11,r12,r13,r14,r15,r16,r17,r18,r19, \
    154                         r20,r21,r22,r23,r24,r25,r26,r27,r28,r29, \
    155                         r30,r31
    156                 .ifc  \reg,\dst
    157                         .L_movw_dst = .L_movw_n
    158                 .endif
    159                 .ifc  \reg,\src
    160                         .L_movw_src = .L_movw_n
    161                 .endif
    162                 .L_movw_n = .L_movw_n + 1
    163         .endr
    164         .L_movw_n = 0
    165         .irp  reg,      R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, \
    166                         R10,R11,R12,R13,R14,R15,R16,R17,R18,R19, \
    167                         R20,R21,R22,R23,R24,R25,R26,R27,R28,R29, \
    168                         R30,R31
    169                 .ifc  \reg,\dst
    170                         .L_movw_dst = .L_movw_n
    171                 .endif
    172                 .ifc  \reg,\src
    173                         .L_movw_src = .L_movw_n
    174                 .endif
    175                 .L_movw_n = .L_movw_n + 1
    176         .endr
    177         .if   .L_movw_dst < 0
    178                 .L_movw_n = 0
    179                 .rept   32
    180                         .if \dst == .L_movw_n
    181                                 .L_movw_dst = .L_movw_n
    182                         .endif
    183                         .L_movw_n = .L_movw_n + 1
    184                 .endr
    185         .endif
    186         .if   .L_movw_src < 0
    187                 .L_movw_n = 0
    188                 .rept   32
    189                         .if \src == .L_movw_n
    190                                 .L_movw_src = .L_movw_n
    191                         .endif
    192                         .L_movw_n = .L_movw_n + 1
    193                 .endr
    194         .endif
    195         .if   (.L_movw_dst < 0) || (.L_movw_src < 0)
    196                 .err    ; Invalid 'X_movw' arg.
    197         .endif
    198                
    199         .if ((.L_movw_src) - (.L_movw_dst))  /* different registers */
    200                 .if (((.L_movw_src) | (.L_movw_dst)) & 0x01)
    201                         .if (((.L_movw_src)-(.L_movw_dst)) & 0x80) /* src < dest */
    202                                 mov     (.L_movw_dst)+1, (.L_movw_src)+1
    203                                 mov     (.L_movw_dst), (.L_movw_src)
    204                         .else                                      /* src > dest */
    205                                 mov     (.L_movw_dst), (.L_movw_src)
    206                                 mov     (.L_movw_dst)+1, (.L_movw_src)+1
    207                         .endif
    208                 .else  /* both even -> overlap not possible */
    209 #if  defined(__AVR_HAVE_MOVW__) && __AVR_HAVE_MOVW__
    210                         movw    \dst, \src
    211 #else
    212                         mov     (.L_movw_dst), (.L_movw_src)
    213                         mov     (.L_movw_dst)+1, (.L_movw_src)+1
    214 #endif
    215                 .endif
    216         .endif
    217 .endm
    218 
    219 /* Macro 'X_lpm' extends enhanced lpm instruction for classic chips.
    220    Usage:
    221         X_lpm   reg, dst
    222    where
    223         reg     is 0..31, r0..r31 or R0..R31
    224         dst     is z, Z, z+ or Z+
    225    It is possible to omit both arguments.
    226 
    227    Possible results for classic chips:
    228         lpm
    229         lpm / mov Rd,r0
    230         lpm / adiw ZL,1
    231         lpm / mov Rd,r0 / adiw ZL,1
    232        
    233    For enhanced chips it is one instruction always.
    234 
    235    ATTENTION:  unlike enhanced chips SREG (S,V,N,Z,C) flags are
    236    changed in case of 'Z+' dst.  R0 is scratch.
    237  */
    238 .macro  X_lpm   dst=r0, src=Z
    239 
    240   /* dst evaluation     */
    241   .L_lpm_dst = -1
    242 
    243   .L_lpm_n = 0
    244   .irp  reg,  r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, \
    245              r10,r11,r12,r13,r14,r15,r16,r17,r18,r19, \
    246              r20,r21,r22,r23,r24,r25,r26,r27,r28,r29, \
    247              r30,r31
    248     .ifc  \reg,\dst
    249       .L_lpm_dst = .L_lpm_n
    250     .endif
    251     .L_lpm_n = .L_lpm_n + 1
    252   .endr
    253 
    254   .L_lpm_n = 0
    255   .irp  reg,  R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, \
    256              R10,R11,R12,R13,R14,R15,R16,R17,R18,R19, \
    257              R20,R21,R22,R23,R24,R25,R26,R27,R28,R29, \
    258              R30,R31
    259     .ifc  \reg,\dst
    260       .L_lpm_dst = .L_lpm_n
    261     .endif
    262     .L_lpm_n = .L_lpm_n + 1
    263   .endr
    264 
    265   .if  .L_lpm_dst < 0
    266     .L_lpm_n = 0
    267     .rept 32
    268       .if  \dst == .L_lpm_n
    269         .L_lpm_dst = .L_lpm_n
    270       .endif
    271       .L_lpm_n = .L_lpm_n + 1
    272     .endr
    273   .endif
    274 
    275   .if  (.L_lpm_dst < 0)
    276     .err        ; Invalid dst arg of 'X_lpm' macro.
    277   .endif
    278 
    279   /* src evaluation     */   
    280   .L_lpm_src = -1
    281   .L_lpm_n = 0
    282   .irp  reg,  z,Z,z+,Z+
    283     .ifc  \reg,\src
    284       .L_lpm_src = .L_lpm_n
    285     .endif
    286     .L_lpm_n = .L_lpm_n + 1
    287   .endr
    288 
    289   .if  (.L_lpm_src < 0)
    290     .err        ; Invalid src arg of 'X_lpm' macro.
    291   .endif
    292 
    293   /* instruction(s)     */   
    294   .if  .L_lpm_src < 2
    295     .if  .L_lpm_dst == 0
    296         lpm
    297     .else
    298 #if  defined(__AVR_HAVE_LPMX__) && __AVR_HAVE_LPMX__
    299         lpm     .L_lpm_dst, Z
    300 #else
    301         lpm
    302         mov     .L_lpm_dst, r0
    303 #endif
    304     .endif
    305   .else
    306     .if  (.L_lpm_dst >= 30)
    307       .err      ; Registers 30 and 31 are inhibited as 'X_lpm *,Z+' dst.
    308     .endif
    309 #if  defined(__AVR_HAVE_LPMX__) && __AVR_HAVE_LPMX__
    310         lpm     .L_lpm_dst, Z+
    311 #else
    312         lpm
    313     .if  .L_lpm_dst
    314         mov     .L_lpm_dst, r0
    315     .endif
    316         adiw    r30, 1
    317 #endif
    318   .endif
    319 .endm
    320 
    321 /*
    322    LPM_R0_ZPLUS_INIT is used before the loop to initialize RAMPZ
    323    for future devices with RAMPZ:Z auto-increment - [e]lpm r0, Z+.
    324 
    325    LPM_R0_ZPLUS_NEXT is used inside the loop to load a byte from
    326    the program memory at [RAMPZ:]Z to R0, and increment [RAMPZ:]Z.
    327 
    328    The argument in both macros is a register that contains the
    329    high byte (bits 23-16) of the address, bits 15-0 should be in
    330    the Z (r31:r30) register.  It can be any register except for:
    331    r0, r1 (__zero_reg__ - assumed to always contain 0), r30, r31.
    332  */
    333 
    334         .macro  LPM_R0_ZPLUS_INIT hhi
    335 #if __AVR_ENHANCED__
    336   #if BIG_CODE
    337         out     AVR_RAMPZ_ADDR, \hhi
    338   #endif
    339 #endif
    340         .endm
    341 
    342         .macro  LPM_R0_ZPLUS_NEXT hhi
    343 #if __AVR_ENHANCED__
    344   #if BIG_CODE
    345     /* ELPM with RAMPZ:Z post-increment, load RAMPZ only once */
    346         elpm    r0, Z+
    347   #else
    348     /* LPM with Z post-increment, max 64K, no RAMPZ (ATmega83/161/163/32) */
    349         lpm     r0, Z+
    350   #endif
    351 #else
    352   #if BIG_CODE
    353     /* ELPM without post-increment, load RAMPZ each time (ATmega103) */
    354         out     AVR_RAMPZ_ADDR, \hhi
    355         elpm
    356         adiw    r30,1
    357         adc     \hhi, __zero_reg__
    358   #else
    359     /* LPM without post-increment, max 64K, no RAMPZ (AT90S*) */
    360         lpm
    361         adiw    r30,1
    362   #endif
    363 #endif
    364         .endm
  • deleted file c/src/lib/libbsp/avr/avrtest/start/start.S

    diff --git a/c/src/lib/libbsp/avr/avrtest/start/start.S b/c/src/lib/libbsp/avr/avrtest/start/start.S
    deleted file mode 100644
    index 22853a2..0000000
    + -  
    1 /* Copyright (c) 2002, Marek Michalkiewicz <marekm@amelek.gda.pl>
    2    Copyright (c) 2007, Eric B. Weddington
    3    All rights reserved.
    4 
    5    Redistribution and use in source and binary forms, with or without
    6    modification, are permitted provided that the following conditions are met:
    7 
    8    * Redistributions of source code must retain the above copyright
    9      notice, this list of conditions and the following disclaimer.
    10 
    11    * Redistributions in binary form must reproduce the above copyright
    12      notice, this list of conditions and the following disclaimer in
    13      the documentation and/or other materials provided with the
    14      distribution.
    15 
    16    * Neither the name of the copyright holders nor the names of
    17      contributors may be used to endorse or promote products derived
    18      from this software without specific prior written permission.
    19 
    20    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    21    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    22    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    23    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
    24    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    25    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    26    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    27    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    28    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    29    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    30    POSSIBILITY OF SUCH DAMAGE. */
    31 
    32 
    33 #if (__GNUC__ < 3) || (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
    34 #error "GCC version >= 3.3 required"
    35 #endif
    36 
    37 #include "macros.inc"
    38 
    39         .macro  vector name
    40         .if (. - __vectors < _VECTORS_SIZE)
    41         .weak   \name
    42         .set    \name, __bad_interrupt
    43         XJMP    \name
    44         .endif
    45         .endm
    46 
    47         .section .vectors,"ax",@progbits
    48         .global __vectors
    49         .func   __vectors
    50 __vectors:
    51         XJMP    __init
    52         vector  __vector_1
    53         vector  __vector_2
    54         vector  __vector_3
    55         vector  __vector_4
    56         vector  __vector_5
    57         vector  __vector_6
    58         vector  __vector_7
    59         vector  __vector_8
    60         vector  __vector_9
    61         vector  __vector_10
    62         vector  __vector_11
    63         vector  __vector_12
    64         vector  __vector_13
    65         vector  __vector_14
    66         vector  __vector_15
    67         vector  __vector_16
    68         vector  __vector_17
    69         vector  __vector_18
    70         vector  __vector_19
    71         vector  __vector_20
    72         vector  __vector_21
    73         vector  __vector_22
    74         vector  __vector_23
    75         vector  __vector_24
    76         vector  __vector_25
    77         vector  __vector_26
    78         vector  __vector_27
    79         vector  __vector_28
    80         vector  __vector_29
    81         vector  __vector_30
    82         vector  __vector_31
    83         vector  __vector_32
    84         vector  __vector_33
    85         vector  __vector_34
    86         vector  __vector_35
    87         vector  __vector_36
    88         vector  __vector_37
    89         vector  __vector_38
    90         vector  __vector_39
    91         vector  __vector_40
    92         vector  __vector_41
    93         vector  __vector_42
    94         vector  __vector_43
    95         vector  __vector_44
    96         vector  __vector_45
    97         vector  __vector_46
    98         vector  __vector_47
    99         vector  __vector_48
    100         vector  __vector_49
    101         vector  __vector_50
    102         vector  __vector_51
    103         vector  __vector_52
    104         vector  __vector_53
    105         vector  __vector_54
    106         vector  __vector_55
    107         vector  __vector_56
    108         vector  __vector_57
    109         vector  __vector_58
    110         vector  __vector_59
    111         vector  __vector_60
    112         vector  __vector_61
    113         vector  __vector_62
    114         vector  __vector_63
    115         vector  __vector_64
    116         vector  __vector_65
    117         vector  __vector_66
    118         vector  __vector_67
    119         vector  __vector_68
    120         vector  __vector_69
    121         vector  __vector_70
    122         vector  __vector_71
    123         vector  __vector_72
    124         vector  __vector_73
    125         vector  __vector_74
    126         vector  __vector_75
    127         vector  __vector_76
    128         vector  __vector_77
    129         vector  __vector_78
    130         vector  __vector_79
    131         vector  __vector_80
    132         vector  __vector_81
    133         vector  __vector_82
    134         vector  __vector_83
    135         vector  __vector_84
    136         vector  __vector_85
    137         vector  __vector_86
    138         vector  __vector_87
    139         vector  __vector_88
    140         vector  __vector_89
    141         vector  __vector_90
    142         vector  __vector_91
    143         vector  __vector_92
    144         vector  __vector_93
    145         vector  __vector_94
    146         vector  __vector_95
    147         vector  __vector_96
    148         vector  __vector_97
    149         vector  __vector_98
    150         vector  __vector_99
    151         vector  __vector_100
    152         vector  __vector_101
    153         vector  __vector_102
    154         vector  __vector_103
    155         vector  __vector_104
    156         vector  __vector_105
    157         vector  __vector_106
    158         vector  __vector_107
    159         vector  __vector_108
    160         vector  __vector_109
    161         vector  __vector_110
    162         vector  __vector_111
    163         vector  __vector_112
    164         vector  __vector_113
    165         vector  __vector_114
    166         vector  __vector_115
    167         vector  __vector_116
    168         vector  __vector_117
    169         vector  __vector_118
    170         vector  __vector_119
    171         vector  __vector_120
    172         vector  __vector_121
    173         vector  __vector_122
    174         vector  __vector_123
    175         vector  __vector_124
    176         vector  __vector_125
    177         .endfunc
    178 
    179         /* Handle unexpected interrupts (enabled and no handler), which
    180            usually indicate a bug.  Jump to the __vector_default function
    181            if defined by the user, otherwise jump to the reset address.
    182 
    183            This must be in a different section, otherwise the assembler
    184            will resolve "rjmp" offsets and there will be no relocs.  */
    185 
    186         .text
    187         .global __bad_interrupt
    188         .func   __bad_interrupt
    189 __bad_interrupt:
    190         .weak   __vector_default
    191         .set    __vector_default, __vectors
    192         XJMP    __vector_default
    193         .endfunc
    194 
    195         .section .init0,"ax",@progbits
    196         .weak   __init
    197 ;       .func   __init
    198 __init:
    199 
    200 #ifndef __AVR_ASM_ONLY__
    201         .weak   __stack
    202 
    203         /* By default, malloc() uses the current value of the stack pointer
    204            minus __malloc_margin as the highest available address.
    205 
    206            In some applications with external SRAM, the stack can be below
    207            the data section (in the internal SRAM - faster), and __heap_end
    208            should be set to the highest address available for malloc().  */
    209         .weak   __heap_end
    210         .set    __heap_end, 0
    211 
    212         .section .init2,"ax",@progbits
    213         clr     __zero_reg__
    214         out     AVR_STATUS_ADDR, __zero_reg__
    215         ldi     r28,lo8(__stack)
    216 #ifdef _HAVE_AVR_STACK_POINTER_HI
    217         ldi     r29,hi8(__stack)
    218         out     AVR_STACK_POINTER_HI_ADDR, r29
    219 #endif  /* _HAVE_AVR_STACK_POINTER_HI */
    220         out     AVR_STACK_POINTER_LO_ADDR, r28
    221 
    222 #ifdef __AVR_3_BYTE_PC__
    223         ldi     r16, hh8(pm(__vectors))
    224         out     _SFR_IO_ADDR(EIND), r16
    225 #endif  /* __AVR_3_BYTE_PC__ */
    226 
    227 #ifdef __AVR_HAVE_RAMPD__
    228         out     AVR_RAMPD_ADDR, __zero_reg__
    229         out     AVR_RAMPX_ADDR, __zero_reg__
    230         out     AVR_RAMPY_ADDR, __zero_reg__
    231         out     AVR_RAMPZ_ADDR, __zero_reg__
    232 #endif
    233 
    234 #if BIG_CODE
    235         /* Only for >64K devices with RAMPZ, replaces the default code
    236            provided by libgcc.S which is only linked in if necessary.  */
    237 
    238         .section .init4,"ax",@progbits
    239         .global __do_copy_data
    240 __do_copy_data:
    241         ldi     r17, hi8(__data_end)
    242         ldi     r26, lo8(__data_start)
    243         ldi     r27, hi8(__data_start)
    244         ldi     r30, lo8(__data_load_start)
    245         ldi     r31, hi8(__data_load_start)
    246 
    247         /* On the enhanced core, "elpm" with post-increment updates RAMPZ
    248            automatically.  Otherwise we have to handle it ourselves.  */
    249 
    250 #ifdef __AVR_ENHANCED__
    251         ldi     r16, hh8(__data_load_start)
    252 #else
    253         ldi     r16, hh8(__data_load_start - 0x10000)
    254 .L__do_copy_data_carry:
    255         inc     r16
    256 #endif
    257         out     AVR_RAMPZ_ADDR, r16
    258         rjmp    .L__do_copy_data_start
    259 .L__do_copy_data_loop:
    260 #ifdef __AVR_ENHANCED__
    261         elpm    r0, Z+
    262 #else
    263         elpm
    264 #endif
    265         st      X+, r0
    266 #ifndef __AVR_ENHANCED__
    267         adiw    r30, 1
    268         brcs    .L__do_copy_data_carry
    269 #endif
    270 .L__do_copy_data_start:
    271         cpi     r26, lo8(__data_end)
    272         cpc     r27, r17
    273         brne    .L__do_copy_data_loop
    274 #ifdef __AVR_HAVE_RAMPD__
    275         out     AVR_RAMPZ_ADDR, __zero_reg__
    276 #endif /* __AVR_HAVE_RAMPD__*/
    277 
    278 #endif /* BIG_CODE */
    279 
    280         .set    __stack, RAMEND
    281 #endif /* !__AVR_ASM_ONLY__ */
    282 
    283         .section .init9,"ax",@progbits
    284 #ifdef __AVR_ASM_ONLY__
    285         XJMP    boot_card
    286 #else   /* !__AVR_ASM_ONLY__ */
    287         XCALL   boot_card
    288         XJMP    exit
    289 #endif  /* __AVR_ASM_ONLY__ */
    290 ;       .endfunc
    291 
  • deleted file c/src/lib/libbsp/avr/avrtest/startup/linkcmds

    diff --git a/c/src/lib/libbsp/avr/avrtest/startup/linkcmds b/c/src/lib/libbsp/avr/avrtest/startup/linkcmds
    deleted file mode 100644
    index 46548bf..0000000
    + -  
    1 /*
    2  * Declare some sizes.
    3  */
    4 RamBase = DEFINED(RamBase) ? RamBase : 0x08000000;
    5 RamSize = DEFINED(RamSize) ? RamSize : 64K;
    6 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
    7 StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
    8 
    9 /* Default linker script, for normal executables */
    10 OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr")
    11 OUTPUT_ARCH(avr:5)
    12 MEMORY
    13 {
    14   text   (rx)   : ORIGIN = 0, LENGTH = 256K
    15   data   (rw!x) : ORIGIN = 0x800060, LENGTH = 0xffa0
    16   eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 64K
    17 }
    18 SECTIONS
    19 {
    20   /* Read-only sections, merged into text segment: */
    21   .hash          : { *(.hash)           }
    22   .dynsym        : { *(.dynsym)         }
    23   .dynstr        : { *(.dynstr)         }
    24   .gnu.version   : { *(.gnu.version)    }
    25   .gnu.version_d   : { *(.gnu.version_d)        }
    26   .gnu.version_r   : { *(.gnu.version_r)        }
    27   .rel.init      : { *(.rel.init)               }
    28   .rela.init     : { *(.rela.init)      }
    29   .rel.text      :
    30     {
    31       *(.rel.text)
    32       *(.rel.text.*)
    33       *(.rel.gnu.linkonce.t*)
    34     }
    35   .rela.text     :
    36     {
    37       *(.rela.text)
    38       *(.rela.text.*)
    39       *(.rela.gnu.linkonce.t*)
    40     }
    41   .rel.fini      : { *(.rel.fini)               }
    42   .rela.fini     : { *(.rela.fini)      }
    43   .rel.rodata    :
    44     {
    45       *(.rel.rodata)
    46       *(.rel.rodata.*)
    47       *(.rel.gnu.linkonce.r*)
    48     }
    49   .rela.rodata   :
    50     {
    51       *(.rela.rodata)
    52       *(.rela.rodata.*)
    53       *(.rela.gnu.linkonce.r*)
    54     }
    55   .rel.data      :
    56     {
    57       *(.rel.data)
    58       *(.rel.data.*)
    59       *(.rel.gnu.linkonce.d*)
    60     }
    61   .rela.data     :
    62     {
    63       *(.rela.data)
    64       *(.rela.data.*)
    65       *(.rela.gnu.linkonce.d*)
    66     }
    67   .rel.ctors     : { *(.rel.ctors)      }
    68   .rela.ctors    : { *(.rela.ctors)     }
    69   .rel.dtors     : { *(.rel.dtors)      }
    70   .rela.dtors    : { *(.rela.dtors)     }
    71   .rel.got       : { *(.rel.got)                }
    72   .rela.got      : { *(.rela.got)               }
    73   .rel.bss       : { *(.rel.bss)                }
    74   .rela.bss      : { *(.rela.bss)               }
    75   .rel.plt       : { *(.rel.plt)                }
    76   .rela.plt      : { *(.rela.plt)               }
    77   /* Internal text space or external memory */
    78   .text :
    79   {
    80     *(.vectors)
    81     KEEP(*(.vectors))
    82     /* For data that needs to reside in the lower 64k of progmem.  */
    83     *(.progmem.gcc*)
    84     *(.progmem*)
    85     . = ALIGN(2);
    86      __trampolines_start = . ;
    87     /* The jump trampolines for the 16-bit limited relocs will reside here.  */
    88     *(.trampolines)
    89     *(.trampolines*)
    90      __trampolines_end = . ;
    91     /* For future tablejump instruction arrays for 3 byte pc devices.
    92        We don't relax jump/call instructions within these sections.  */
    93     *(.jumptables)
    94     *(.jumptables*)
    95     /* For code that needs to reside in the lower 128k progmem.  */
    96     *(.lowtext)
    97     *(.lowtext*)
    98      __ctors_start = . ;
    99      *(.ctors)
    100      __ctors_end = . ;
    101      __dtors_start = . ;
    102      *(.dtors)
    103      __dtors_end = . ;
    104     KEEP(SORT(*)(.ctors))
    105     KEEP(SORT(*)(.dtors))
    106     /* From this point on, we don't bother about wether the insns are
    107        below or above the 16 bits boundary.  */
    108     *(.init0)  /* Start here after reset.  */
    109     KEEP (*(.init0))
    110     *(.init1)
    111     KEEP (*(.init1))
    112     *(.init2)  /* Clear __zero_reg__, set up stack pointer.  */
    113     KEEP (*(.init2))
    114     *(.init3)
    115     KEEP (*(.init3))
    116     *(.init4)  /* Initialize data and BSS.  */
    117     KEEP (*(.init4))
    118     *(.init5)
    119     KEEP (*(.init5))
    120     *(.init6)  /* C++ constructors.  */
    121     KEEP (*(.init6))
    122     *(.init7)
    123     KEEP (*(.init7))
    124     *(.init8)
    125     KEEP (*(.init8))
    126     *(.init9)  /* Call main().  */
    127     KEEP (*(.init9))
    128     *(.text)
    129     . = ALIGN(2);
    130     *(.text.*)
    131     . = ALIGN(2);
    132     *(.fini9)  /* _exit() starts here.  */
    133     KEEP (*(.fini9))
    134     *(.fini8)
    135     KEEP (*(.fini8))
    136     *(.fini7)
    137     KEEP (*(.fini7))
    138     *(.fini6)  /* C++ destructors.  */
    139     KEEP (*(.fini6))
    140     *(.fini5)
    141     KEEP (*(.fini5))
    142     *(.fini4)
    143     KEEP (*(.fini4))
    144     *(.fini3)
    145     KEEP (*(.fini3))
    146     *(.fini2)
    147     KEEP (*(.fini2))
    148     *(.fini1)
    149     KEEP (*(.fini1))
    150     *(.fini0)  /* Infinite loop after program termination.  */
    151     KEEP (*(.fini0))
    152      _etext = . ;
    153   }  > text
    154   .tdata : AT (ADDR (.text) + SIZEOF (.text)) {
    155      PROVIDE (__data_start = .) ;
    156     _TLS_Data_begin = .;
    157     *(.tdata .tdata.* .gnu.linkonce.td.*)
    158     _TLS_Data_end = .;
    159   }  > data
    160   .tbss : {
    161     _TLS_BSS_begin = .;
    162     *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
    163     _TLS_BSS_end = .;
    164   }  > data
    165   _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
    166   _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
    167   _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
    168   _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
    169   _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
    170   _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
    171   .data   :
    172   {
    173     *(.data)
    174     *(.data*)
    175     KEEP (*(SORT(.rtemsrwset.*)))
    176     *(.rodata)  /* We need to include .rodata here if gcc is used */
    177     *(.rodata*) /* with -fdata-sections.  */
    178     KEEP (*(SORT(.rtemsroset.*)))
    179     *(.gnu.linkonce.d*)
    180     . = ALIGN(2);
    181      _edata = . ;
    182      PROVIDE (__data_end = .) ;
    183   }  > data
    184   .bss  SIZEOF(.data) + ADDR(.data) :
    185   {
    186      PROVIDE (__bss_start = .) ;
    187     *(.bss)
    188     *(.bss*)
    189     *(COMMON)
    190      PROVIDE (__bss_end = .) ;
    191   . = ALIGN(16);
    192 
    193   . += StackSize;
    194   PROVIDE (__stack = .);
    195   PROVIDE (WorkAreaBase = .);
    196   }  > data
    197    __data_load_start = LOADADDR(.data);
    198    __data_load_end = __data_load_start + SIZEOF(.data);
    199   /* Global data not cleared after reset.  */
    200   .noinit  SIZEOF(.bss) + ADDR(.bss) :
    201   {
    202      PROVIDE (__noinit_start = .) ;
    203     *(.noinit*)
    204      PROVIDE (__noinit_end = .) ;
    205      _end = . ;
    206      PROVIDE (__heap_start = .) ;
    207   }  > data
    208   .eeprom  :
    209   {
    210     *(.eeprom*)
    211      __eeprom_end = . ;
    212   }  > eeprom
    213   /* Stabs debugging sections.  */
    214   .stab 0 : { *(.stab) }
    215   .stabstr 0 : { *(.stabstr) }
    216   .stab.excl 0 : { *(.stab.excl) }
    217   .stab.exclstr 0 : { *(.stab.exclstr) }
    218   .stab.index 0 : { *(.stab.index) }
    219   .stab.indexstr 0 : { *(.stab.indexstr) }
    220   .comment 0 : { *(.comment) }
    221   /* DWARF debug sections.
    222      Symbols in the DWARF debugging sections are relative to the beginning
    223      of the section so we begin them at 0.  */
    224   /* DWARF 1 */
    225   .debug          0 : { *(.debug) }
    226   .line           0 : { *(.line) }
    227   /* GNU DWARF 1 extensions */
    228   .debug_srcinfo  0 : { *(.debug_srcinfo) }
    229   .debug_sfnames  0 : { *(.debug_sfnames) }
    230   /* DWARF 1.1 and DWARF 2 */
    231   .debug_aranges  0 : { *(.debug_aranges) }
    232   .debug_pubnames 0 : { *(.debug_pubnames) }
    233   /* DWARF 2 */
    234   .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
    235   .debug_abbrev   0 : { *(.debug_abbrev) }
    236   .debug_line     0 : { *(.debug_line) }
    237   .debug_frame    0 : { *(.debug_frame) }
    238   .debug_str      0 : { *(.debug_str) }
    239   .debug_loc      0 : { *(.debug_loc) }
    240   .debug_macinfo  0 : { *(.debug_macinfo) }
    241 }