Does your linker script have something like this in it?:
/*
* Statements in a SECTIONS command describe the placement of each named
* output section and specify which input sections go into them. You are
* only allowed one SECTIONS statement per command file, but it can have
* as many statements in it as necessary.
*
* Including =fill in a section definition specifies the initial fill
* value for that section. Any unallocated holes in the current
* output section when written to the output file will be filled with
* the two least significant bytes of the value, repeated as
* necessary. The fill value can also be changed with a FILL
* statement in the contents of a section definition.
*/
SECTIONS
{
/* The startup code goes first into INTERNAL_FLASH: */
.isr_vector :
{
__vector_table = .; /* Address of the ISR Vector Table */
. = ALIGN(4);
/*
* When link-time garbage collection is in use (-gc-sections), it is
* often useful to mark sections that should not be eliminated. This is
* accomplished by surrounding an input section's wild-card entry with
* KEEP(), as in KEEP(*(.init)) or KEEP(SORT(*)(.ctors)).
*/
KEEP(*(.isr_vector))
. = ALIGN(4);
} > VECTORS =0xFF
.bootloader_configuration_area :
{
. = ALIGN(4);
__bca_cfg = .; /* Address of the BCA Config Table */
KEEP(*(.bootloader_configuration_area )) /* Bootloader Configuration Area (BCA) */
. = ALIGN(4);
} > BOOTCFG =0xFF
...
.ctors : /* Constructors .ctors */
{/* This section contains a list of global constructor function pointers */
__CTOR_LIST__ = .;
/*
* gcc uses crtbegin.o to find the start of
* the constructors, so we make sure it is
* first. Because this is a wildcard, it
* doesn't matter if the user does not
* actually link against crtbegin.o; the
* linker won't look for a file to match a
* wildcard. The wildcard also means that it
* doesn't matter which directory crtbegin.o
* is in.
*/
KEEP (*crtbegin.o(.ctors))
/*
* We don't want to include the .ctor section from
* from the crtend.o file until after the sorted ctors.
* The .ctor section from the crtend file contains the
* end of ctors marker and it must be last.
*/
KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
/*
* When the SORT keyword is used, the linker will sort the files or
* sections into ascending order by name before placing them in the
* output file.
*/
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
. = ALIGN(4);
__CTOR_END__ = .;
} > FLASH =0xFF
.dtors : /* Destructors .dtors */
{/* This section contains a list of global destructor function pointers */
__DTOR_LIST__ = .;
KEEP (*crtbegin.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
. = ALIGN(4);
__DTOR_END__ = .;
_etext = .; /* Define a global symbols at end of code [Note single '_'] */
__code_end = .; /* Define a global symbols at end of code */
} > FLASH =0xFF