[mc1322x] Building mc1322x contiki
Ian Martin
martini at alum.mit.edu
Tue Oct 6 13:12:10 EDT 2009
Many of the contiki examples (e.g. example-shell) aren't appropriate
for the mc13 because they make use of gigantic standard library
functions like sprintf. The following command will list all the
linked symbols, each with its address and size. The last several
lines should give you a clue about what is consuming that 500K.
nm --print-size --size-sort yourexample.mc1322x
Try compiling a very simple example like examples/hello-world and work
your way up from there.
Good luck,
Ian
On Tue, Oct 6, 2009 at 12:58 PM, Jon Smirl <jonsmirl at gmail.com> wrote:
> I'm trying to build the mc1322x contiki examples using
> gcc-4.3.2-glibc-2.8-binutils-2.18 from the Phytec cross tools.
>
> My binary is ending up 550K. It is sucking in 500K of run-time
> library. Are my cross tools built wrong? Should they be built with
> exception handling turned off?
>
> I had to add the exidx section...
>
> diff --git a/cpu/mc1322x/Makefile.mc1322x b/cpu/mc1322x/Makefile.mc1322x
> index 1014ca2..189cd6b 100644
> --- a/cpu/mc1322x/Makefile.mc1322x
> +++ b/cpu/mc1322x/Makefile.mc1322x
> @@ -18,7 +18,7 @@ CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
>
> THREADS =
>
> -CROSS=arm-linux-
> +CROSS=arm-v4t-linux-gnueabi-
>
> ### Compiler definitions
> CC = $(CROSS)gcc
> @@ -50,7 +50,7 @@ CFLAGSNO = -I. -I$(CONTIKI)/core -I$(CONTIKI_CPU)
> -I$(CONTIKI_CPU)/loader \
> -Werror $(ARCH_FLAGS) -g
>
> CFLAGS += $(CFLAGSNO) -Os -DRUN_AS_SYSTEM -DROM_RUN
> -fno-strict-aliasing -fno-common -ffixed-r8 -msoft-float -DTE
> -LDFLAGS += -T $(LINKERSCRIPT) -nostartfiles -static
> +LDFLAGS += -T $(LINKERSCRIPT) -nostartfiles -static
> -Wl,-Map=contiki-$(TARGET).map,-export-dynamic
> AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS) -gstabs
>
> CDEPFLAGS = $(CFLAGS) -D __MAKING_DEPS__
> diff --git a/cpu/mc1322x/mc1322x.lds b/cpu/mc1322x/mc1322x.lds
> index 061604a..e19ef15 100644
> --- a/cpu/mc1322x/mc1322x.lds
> +++ b/cpu/mc1322x/mc1322x.lds
> @@ -259,4 +259,11 @@ HEAP_SIZE = 1024;
> .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
> .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
> /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
> +
> + ROM 0 (NOLOAD) :
> + {
> + __exidx_start = .;
> + *(.ARM.exidx* .gnu.linkonce.armexidx.*)
> + __exidx_end = .;
> + }
> }
>
>
> --
> Jon Smirl
> jonsmirl at gmail.com
>
> _______________________________________________
> mc1322x mailing list
> mc1322x at devl.org
> http://devl.org/cgi-bin/mailman/listinfo/mc1322x
>
More information about the mc1322x
mailing list