solution to the object 8k boundary

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

EDITED: installed the newest MSYS, mingw, cygwin64, arm compiler and added paths.  WORKS!

 

Guys, I think I have found a solution.  

 

Object file has too many sections | ExceptionsHub

 

Answers:

The solution is to add the option-Wa,-mbig-obj

if your version of GCC supports that option. You probably only need it during the compilation step, not the linker step.

 

where here do I add it.  Thanks.  Hope this works.

VERSION = 2.15
DEFAULT_AVAILABLE_TARGETS = sama5d4-generic sama5d4-xplained sama5d4-ek \
		   sama5d2-generic sama5d2-xplained \
		   sama5d2-vb-bga196 sama5d2-vb-bga289 \
		   sama5d27-som1-ek sama5d2-ptc-ek \
		   sama5d3-generic sama5d3-xplained sama5d3-ek \
		   sam9g15-generic sam9g25-generic sam9g35-generic \
		   sam9x25-generic sam9x35-generic \
		   sam9g15-ek sam9g25-ek sam9g35-ek \
		   sam9x25-ek sam9x35-ek \
		   sam9x60-generic \
		   sam9x60-ek \
		   samv71-generic same70-xplained samv71-xplained
AVAILABLE_TARGETS ?= $(DEFAULT_AVAILABLE_TARGETS)
AVAILABLE_VARIANTS ?= sram ddram qspi0 qspi1 flash
VARIANT ?= ddram

eq = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1)))

ifndef TARGET
$(error "No TARGET specified.")
endif

ifndef $(or RELEASE,DEBUG)
DEBUG = 5
endif

### Expand '*' available targets from example makefiles
TARGETS := $(subst *,%,$(filter %*,$(AVAILABLE_TARGETS)))
AVAILABLE_TARGETS := $(filter-out %*,$(AVAILABLE_TARGETS))
TARGETS := $(foreach target,$(TARGETS),$(filter $(TARGETS),$(DEFAULT_AVAILABLE_TARGETS)))
AVAILABLE_TARGETS += $(TARGETS)
AVAILABLE_TARGETS := $(sort $(AVAILABLE_TARGETS))
SELECTED_TARGET = $(strip $(foreach target,$(AVAILABLE_TARGETS),$(if $(call eq,$(TARGET),$(target)),$(target))))
###

ifeq ($(SELECTED_TARGET),)
$(info The selected target "$(TARGET)" is not supported or not available)
$(error Please set TARGET to one value from the list above: $(AVAILABLE_TARGETS))
endif

ifeq ($(V),1)
Q :=
ECHO := @true
else
Q := @
ECHO := @echo
endif

#-------------------------------------------------------------------------------
#		Create version string using git if possible
#-------------------------------------------------------------------------------
GIT_VERSION = $(shell if git rev-parse --show-toplevel >/dev/null 2>&1 ; \
	then git describe --tags --dirty; fi)
ifneq ($(GIT_VERSION),)
SOFTPACK_VERSION := $(VERSION) ($(GIT_VERSION))
else
SOFTPACK_VERSION := $(VERSION)
endif

#-------------------------------------------------------------------------------
#		Setup cross-compilation tools
#-------------------------------------------------------------------------------
# Tool suffix when cross-compiling
CROSS_COMPILE ?= arm-none-eabi-

# Compilation tools
CC = $(CROSS_COMPILE)gcc
CPP = $(CROSS_COMPILE)g++
LD = $(CROSS_COMPILE)ld
SIZE = $(CROSS_COMPILE)size
STRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy
GDB = $(CROSS_COMPILE)gdb
NM = $(CROSS_COMPILE)nm
AR = $(CROSS_COMPILE)ar

#-------------------------------------------------------------------------------
#		Setup compilation params
#-------------------------------------------------------------------------------

CFLAGS_OPT ?= -O2

# compiler flags
CFLAGS = -Wall -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int
CFLAGS += -Werror-implicit-function-declaration -Wmain -Wparentheses
CFLAGS += -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs
CFLAGS += -Wuninitialized -Wunknown-pragmas -Wundef
CFLAGS += -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings
CFLAGS += -Waggregate-return -Wstrict-prototypes
CFLAGS += -Wmissing-prototypes -Wmissing-declarations
CFLAGS += -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations
CFLAGS += -Wredundant-decls -Wnested-externs
CFLAGS += -Wunreachable-code -Wno-aggregate-return -Dprintf=iprintf
CFLAGS += -ffunction-sections -fdata-sections
CFLAGS += -std=gnu99
CFLAGS += $(CFLAGS_OPT)

CPPFLAGS += -Wall -std=gnu++11 -mthumb -fno-builtin -mcpu=cortex-a5 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -Wall -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize -lc -lrdimon -fexceptions
CPPFLAGS += $(CFLAGS_OPT)

CFLAGS_ASM = -Wall -D__ASSEMBLY__

CFLAGS_DEFS += -DSOFTPACK_VERSION="\"$(SOFTPACK_VERSION)\""

# Trace level used for compilation
# (can be overriden by adding TRACE_LEVEL=#number to the command-line)
# TRACE_LEVEL_DEBUG      5
# TRACE_LEVEL_INFO       4
# TRACE_LEVEL_WARNING    3
# TRACE_LEVEL_ERROR      2
# TRACE_LEVEL_FATAL      1
# TRACE_LEVEL_NO_TRACE   0
ifdef DEBUG
TRACE_LEVEL ?= 2
CFLAGS_DEFS += -DTRACE_LEVEL=$(TRACE_LEVEL)
CFLAGS += -g3
CFLAGS_ASM += -g3
else
TRACE_LEVEL ?= 2
CFLAGS_DEFS += -DNDEBUG -DTRACE_LEVEL=$(TRACE_LEVEL)
endif

# append variant define
CFLAGS_DEFS += -DVARIANT_$(shell echo $(VARIANT) | tr '[:lower:]' '[:upper:]')

# linker flags
LDFLAGS = -Wall -Wl,-lstdc++ -fexceptions -specs=nosys.specs -Wl,--cref -Wl,--check-sections -Wl,--gc-sections
LDFLAGS += -Wl,--unresolved-symbols=report-all -Wl,--warn-common
LDFLAGS += -Wl,--sort-section=alignment

# include target-specific config
include $(TOP)/scripts/Makefile.vars.sam9xx5
include $(TOP)/scripts/Makefile.vars.sam9x60
include $(TOP)/scripts/Makefile.vars.sama5d2
include $(TOP)/scripts/Makefile.vars.sama5d3
include $(TOP)/scripts/Makefile.vars.sama5d4
include $(TOP)/scripts/Makefile.vars.samv71

# check if variant is compatible with example (AVAILABLE_VARIANTS) and SoC (COMPATIBLE_VARIANTS)
ALL_VARIANTS := $(filter $(AVAILABLE_VARIANTS), $(COMPATIBLE_VARIANTS))
SELECTED_VARIANT := $(strip $(foreach variant,$(ALL_VARIANTS),$(if $(call eq,$(VARIANT),$(variant)),$(variant))))
ifeq ($(SELECTED_VARIANT),)
$(info The selected variant "$(VARIANT)" is not supported or not available)
$(error Please set VARIANT to one value from the list above: $(ALL_VARIANTS))
endif

 

Last Edited: Fri. Apr 29, 2022 - 07:23 PM