diff options
-rw-r--r-- | os/common/startup/ARMCMx/compilers/GCC/ld/rules_code.ld | 4 | ||||
-rw-r--r-- | os/common/startup/ARMCMx/compilers/GCC/mk/rules.mk | 8 | ||||
-rw-r--r-- | os/common/startup/ARMCMx/compilers/LLVM/mk/rules.mk | 8 |
3 files changed, 5 insertions, 15 deletions
diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/rules_code.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/rules_code.ld index 76ac53116..f61a59f17 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/rules_code.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/rules_code.ld @@ -35,13 +35,15 @@ SECTIONS __fini_array_end = .;
} > XTORS_FLASH AT > XTORS_FLASH_LMA
- .text ALIGN(16) : ALIGN(16)
+ .text : ALIGN(16)
{
+ __text_base = .;
*(.text)
*(.text.*)
*(.glue_7t)
*(.glue_7)
*(.gcc*)
+ __text_end = .;
} > TEXT_FLASH AT > TEXT_FLASH_LMA
.rodata : ALIGN(4)
diff --git a/os/common/startup/ARMCMx/compilers/GCC/mk/rules.mk b/os/common/startup/ARMCMx/compilers/GCC/mk/rules.mk index 160731bdf..f7db0f287 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/mk/rules.mk +++ b/os/common/startup/ARMCMx/compilers/GCC/mk/rules.mk @@ -114,7 +114,7 @@ ADEFS := $(DADEFS) $(UADEFS) LIBS := $(DLIBS) $(ULIBS)
# Various settings
-MCFLAGS := -mcpu=$(MCU)
+MCFLAGS := -mcpu=$(MCU) -mthumb
ODFLAGS = -x --syms
ASFLAGS = $(MCFLAGS) $(OPT) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.s=.lst)) $(ADEFS)
ASXFLAGS = $(MCFLAGS) $(OPT) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.S=.lst)) $(ADEFS)
@@ -122,12 +122,6 @@ CFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<: CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.cpp=.lst)) $(DEFS)
LDFLAGS = $(MCFLAGS) $(OPT) -nostartfiles $(LLIBDIR) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--library-path=$(STARTUPLD),--script=$(LDSCRIPT)$(LDOPT)
-# Always thumb mode
-CFLAGS += -mthumb
-CPPFLAGS += -mthumb
-ASFLAGS += -mthumb
-ASXFLAGS += -mthumb
-
# Generate dependency information
ASFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
ASXFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
diff --git a/os/common/startup/ARMCMx/compilers/LLVM/mk/rules.mk b/os/common/startup/ARMCMx/compilers/LLVM/mk/rules.mk index c584c39ff..6c593f0a8 100644 --- a/os/common/startup/ARMCMx/compilers/LLVM/mk/rules.mk +++ b/os/common/startup/ARMCMx/compilers/LLVM/mk/rules.mk @@ -114,7 +114,7 @@ ADEFS := $(DADEFS) $(UADEFS) LIBS := $(DLIBS) $(ULIBS)
# Various settings
-MCFLAGS := -mcpu=$(MCU)
+MCFLAGS := -mcpu=$(MCU) -mthumb
ODFLAGS = -x --syms
ASFLAGS = $(MCFLAGS) $(OPT) $(ADEFS)
ASXFLAGS = $(MCFLAGS) $(OPT) $(ADEFS)
@@ -126,12 +126,6 @@ CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) $(DEFS) #CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.cpp=.lst)) $(DEFS)
LDFLAGS = $(MCFLAGS) $(OPT) -nostartfiles $(LLIBDIR) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--library-path=$(STARTUPLD),--script=$(LDSCRIPT)$(LDOPT)
-# Always thumb mode
-CFLAGS += -mthumb
-CPPFLAGS += -mthumb
-ASFLAGS += -mthumb
-ASXFLAGS += -mthumb
-
# Generate dependency information
ASFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
ASXFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
|