diff --git a/cpu/cc2538/Makefile.cc2538 b/cpu/cc2538/Makefile.cc2538 index c92d67d22..85a5de204 100644 --- a/cpu/cc2538/Makefile.cc2538 +++ b/cpu/cc2538/Makefile.cc2538 @@ -21,7 +21,7 @@ OBJCOPY_FLAGS += -O binary --gap-fill 0xff ### Are we building with code size optimisations? ifeq ($(SMALL),1) CFLAGS += -ffunction-sections -fdata-sections - LDFLAGS += -Wl,--gc-sections + LDFLAGS += -Wl,--gc-sections,--sort-section=alignment endif ### If the user-specified a Node ID, pass a define diff --git a/cpu/cc2538/cc2538.lds b/cpu/cc2538/cc2538.lds index 635ec454b..71115fbe3 100644 --- a/cpu/cc2538/cc2538.lds +++ b/cpu/cc2538/cc2538.lds @@ -64,10 +64,14 @@ SECTIONS _etext = .; } > FLASH= 0 + .socdata (NOLOAD) : + { + *(.udma_channel_control_table) + } > SRAM + .data : { _data = .; - *(vtable) *(.data*) _edata = .; } > SRAM AT > FLASH @@ -86,7 +90,7 @@ SECTIONS } > SRAM #if (LPM_CONF_MAX_PM==2) && (LPM_CONF_ENABLE != 0) - .nrdata : + .nrdata (NOLOAD) : { _nrdata = .; *(.nrdata*) diff --git a/cpu/cc2538/dev/udma.c b/cpu/cc2538/dev/udma.c index af30b1436..c285d1b11 100644 --- a/cpu/cc2538/dev/udma.c +++ b/cpu/cc2538/dev/udma.c @@ -51,7 +51,7 @@ struct channel_ctrl { }; static volatile struct channel_ctrl channel_config[UDMA_CONF_MAX_CHANNEL + 1] - __attribute__ ((aligned(1024))); + __attribute__ ((section(".udma_channel_control_table"))); /*---------------------------------------------------------------------------*/ void udma_init()