git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@403 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
0284f0998d
commit
01afd268a5
|
@ -26,6 +26,9 @@ BIN = $(CP) -O binary
|
|||
|
||||
MCU = arm7tdmi
|
||||
|
||||
# Enable this if you want the linker to remove unused code and data
|
||||
LINK_GC = yes
|
||||
|
||||
# List all default C defines here, like -D_DEBUG=1
|
||||
DDEFS =
|
||||
|
||||
|
@ -108,6 +111,10 @@ OPT = -O2 -ggdb -fomit-frame-pointer -mabi=apcs-gnu
|
|||
#OPT += -ffixed-r7
|
||||
OPT += -falign-functions=16
|
||||
|
||||
ifeq ($(LINK_GC),yes)
|
||||
OPT += -ffunction-sections -fdata-sections
|
||||
endif
|
||||
|
||||
# Define warning options here
|
||||
WARN = -Wall -Wstrict-prototypes
|
||||
|
||||
|
@ -126,10 +133,14 @@ ASMOBJS = $(ASMSRC:.s=.o)
|
|||
LIBS = $(DLIBS) $(ULIBS)
|
||||
MCFLAGS = -mcpu=$(MCU)
|
||||
|
||||
ODFLAGS = -x --syms
|
||||
ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(<:.s=.lst) $(ADEFS)
|
||||
CPFLAGS = $(MCFLAGS) $(OPT) $(WARN) -Wa,-alms=$(<:.c=.lst) $(DEFS)
|
||||
ifeq ($(LINK_GC),yes)
|
||||
LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections $(LIBDIR)
|
||||
else
|
||||
LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch $(LIBDIR)
|
||||
ODFLAGS = -x --syms
|
||||
endif
|
||||
|
||||
# Thumb interwork enabled only if needed because it kills performance.
|
||||
ifneq ($(TSRC),)
|
||||
|
|
|
@ -26,6 +26,9 @@ BIN = $(CP) -O binary
|
|||
|
||||
MCU = arm7tdmi
|
||||
|
||||
# Enable this if you want the linker to remove unused code and data
|
||||
LINK_GC = yes
|
||||
|
||||
# List all default C defines here, like -D_DEBUG=1
|
||||
DDEFS =
|
||||
|
||||
|
@ -108,6 +111,10 @@ OPT = -Os -ggdb -fomit-frame-pointer -mabi=apcs-gnu
|
|||
#OPT += -ffixed-r7
|
||||
OPT += -falign-functions=16
|
||||
|
||||
ifeq ($(LINK_GC),yes)
|
||||
OPT += -ffunction-sections -fdata-sections
|
||||
endif
|
||||
|
||||
# Define warning options here
|
||||
WARN = -Wall -Wstrict-prototypes
|
||||
|
||||
|
@ -126,10 +133,14 @@ ASMOBJS = $(ASMSRC:.s=.o)
|
|||
LIBS = $(DLIBS) $(ULIBS)
|
||||
MCFLAGS = -mcpu=$(MCU)
|
||||
|
||||
ODFLAGS = -x --syms
|
||||
ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(<:.s=.lst) $(ADEFS)
|
||||
CPFLAGS = $(MCFLAGS) $(OPT) $(WARN) -Wa,-alms=$(<:.c=.lst) $(DEFS)
|
||||
ifeq ($(LINK_GC),yes)
|
||||
LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections $(LIBDIR)
|
||||
else
|
||||
LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch $(LIBDIR)
|
||||
ODFLAGS = -x --syms
|
||||
endif
|
||||
|
||||
# Thumb interwork enabled only if needed because it kills performance.
|
||||
ifneq ($(TSRC),)
|
||||
|
|
|
@ -48,11 +48,16 @@ SECTIONS
|
|||
.text :
|
||||
{
|
||||
_text = .;
|
||||
*(.text);
|
||||
KEEP(*(.startup))
|
||||
*(.text)
|
||||
*(.text.*);
|
||||
*(.rodata);
|
||||
*(.rodata*);
|
||||
*(.rodata.*);
|
||||
*(.glue_7t);
|
||||
*(.glue_7);
|
||||
*(.gcc*);
|
||||
*(.ctors);
|
||||
*(.dtors);
|
||||
. = ALIGN(4);
|
||||
_etext = .;
|
||||
} > flash
|
||||
|
@ -64,6 +69,8 @@ SECTIONS
|
|||
_data = .;
|
||||
*(.data)
|
||||
. = ALIGN(4);
|
||||
*(.data.*)
|
||||
. = ALIGN(4);
|
||||
*(.ramtext)
|
||||
. = ALIGN(4);
|
||||
_edata = .;
|
||||
|
@ -74,6 +81,8 @@ SECTIONS
|
|||
_bss_start = .;
|
||||
*(.bss)
|
||||
. = ALIGN(4);
|
||||
*(.bss.*)
|
||||
. = ALIGN(4);
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
_bss_end = .;
|
||||
|
|
Loading…
Reference in New Issue