Working with linker scripts

Discussion around product based on ARM Cortex M4 core.

Moderators: nferre, ncollot

Posts: 2
Joined: Sat Oct 12, 2013 7:57 pm

Working with linker scripts

Mon Oct 06, 2014 8:01 am


I'm not sure there's the place to ask about my problem, so it's not, please tell me where I can ask.

I'm trying to set the entry address on some functions and enclose their code in
a dedicated section, for the purpose of do not update this code between firmware updates.
My problem is I'm not able to define a section in linker script that comply my goals (this is
the first time I work with linker scripts).

For the moment I'd try to define something like this but the linker exits with an error "cannot find utils.o":

.text :
addr1 = .;
. = 0x00480000;
utils.o(.text .text.*)
. = addr1;

. = ALIGN(4);
_sfixed = .;
KEEP(*(.vectors .vectors.*))
. = ALIGN(0x100);
KEEP(*(.vversion)) /*section for vendor info */
KEEP(*(.mversion)) /*section for model info */
KEEP(*(.fversion)) /*section for version info */
*(.text .text.* .gnu.linkonce.t.*)
*(.glue_7t) *(.glue_7)
*(.rodata .rodata* .gnu.linkonce.r.*)
*(.ARM.extab* .gnu.linkonce.armextab.*)

/* Support C constructors, and C destructors in both user code
and the C library. This also provides support for C++ code. */
. = ALIGN(4);
. = ALIGN(4);
__preinit_array_start = .;
KEEP (*(.preinit_array))
__preinit_array_end = .;

. = ALIGN(4);
__init_array_start = .;
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
__init_array_end = .;

. = ALIGN(0x4);
KEEP (*crtbegin.o(.ctors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*crtend.o(.ctors))

. = ALIGN(4);

. = ALIGN(4);
__fini_array_start = .;
KEEP (*(.fini_array))
KEEP (*(SORT(.fini_array.*)))
__fini_array_end = .;

KEEP (*crtbegin.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*crtend.o(.dtors))

. = ALIGN(4);
_efixed = .; /* End of text section */
} > rom

Please, can you say me what i'm doing wrong? Why linker is unable to find the utils.o file?

P.S. I'm working with AS6.1.

Return to “SAM4 Cortex-M4 MCU”

Who is online

Users browsing this forum: No registered users and 1 guest