In computing a linker is a program that takes object files generated by a compiler and performs relocation and other operations to form a final executable. Questions here should only relate to embedded platforms and not general PC programming.
Questions tagged [linker]
41 questions
10
votes
4 answers
Bare-metal start-up code for Cortex M3 .bss region initialization
I have developed inspired from here a bare metal start-up code for arm cortex M3. However, I encounter the following problem: suppose I declare an uninitialized global variable, say of type unsigned char in main.c
#include ...
unsigned char var;…

C Marius
- 229
- 1
- 6
8
votes
1 answer
Integrating another binary
I am building a binary for ARM using GCC and Crossworks. I have a secondary binary image that needs to be loaded to another IC during start up.
I like to integrate this binary to my tool-chain, in other words, I make this binary part of my image…

Ktc
- 2,226
- 3
- 26
- 48
7
votes
4 answers
Creating programmable look up table on STM32
I am trying to define a look up table that is not a constant on an STM32F103. Basically I want to have a page of flash that acts like a constant lookup table in normal operation, but every once in a while (think days apart) I want to be able to…

Brett K Smith
- 305
- 2
- 6
6
votes
2 answers
STM32F103 flash memory start address
I'm trying to write a linker script for my first firmware for STM32F103C8T6 microcontroller. I have an example script that works. What I'm trying to understand is why it works.
The linker script I have defines two memory locations:
MEMORY
{
…

Andrey Lebedev
- 183
- 1
- 1
- 5
4
votes
2 answers
Automating linker file change
I am working on a firmware project in which i have to do a crc16 check for flash integrity.
Controller: MSP430
IDE: IAR EW 5.40 (Linker Xlink)
The crc is calculated using IAR Xlink linker and kept at the end of the flash. Again crc is calculated at…

OnkarK
- 41
- 4
4
votes
3 answers
What are the details about link files and startup code one needs to know to write an Operating System for a uC?
I know some people will say I don't need to write an OS because there are lots of options out there. But I'm not interested in using an OS to solve an specific problem. I want to write one by myself to learn how to do it.
I know a lot of things…
user49894
4
votes
1 answer
How does gnu linker obtain Cortex-M stack pointer value?
GNU's linker obtains the ARM Cortex's stack pointer value from the linker script, and places that value in the first location of the interrupt vector table.
I note that most of my scripts use the symbol _estack to define the "end of stack" (memory…

CMiller
- 51
- 4
4
votes
2 answers
Force xc32-ld to place all application code in kseg0_boot_mem
I have written a PIC32MX bootloader application. I would like to tell the linker to put it completely in the boot memory, so that all program space is kept for the final application.
Currently, the what I think are the relevant parts of my .ld file…
user17592
3
votes
3 answers
Short String overflows.text area on ATtiny85, Arduino IDE
I'm using the Arduino IDE with arduino-tiny (https://code.google.com/p/arduino-tiny/) on an ATTIny85. My code is maxing out the RAM, or so it seems:
Adding a single String to my code, even just carrying one character, throws a compiler…

Christian
- 621
- 12
- 22
3
votes
0 answers
How can I setup a shared library between a bootloader and an application?
I am in the process of implementing over-the-air updates on a CC2652 microcontroller using the OpenThread stack. As far as I know a bootloader has to be able to operate independently from the application and be as small as possible. But for the…

Vincent Kenbeek
- 193
- 9
3
votes
1 answer
gcc __attribute__ section not working?
I'm working on a Zynq Ultrascale+ MPSoC and trying to play around with the on and off chip memories. In the following program, I'm trying to place only variable 'x' into OCM (on-chip-memory) where everything else is loaded into external…

pr871
- 1,167
- 10
- 23
3
votes
2 answers
How does avr-gcc linker know to put the `.data`section at `0x800100` rather than `0x800060`?
Looking at the linker script for my part (ATMEGA168PD), the data region has an origin defined as starting at 0x800060...
MEMORY
{
text (rx) : ORIGIN = 0, LENGTH = __TEXT_REGION_LENGTH__
data (rw!x) : ORIGIN = 0x800060, LENGTH =…

bigjosh
- 9,888
- 29
- 48
3
votes
2 answers
IAR ARM Place const symbols in flash
I have the following flash section defined in my linker file:
keep { section .SomeConst };
place at address mem: 0x0003F800 { readonly section .SomeConst };
In my code I have the following symbols defined:
#pragma location = ".SomeConst"
__root…

BAO
- 78
- 1
- 5
2
votes
2 answers
Arduino linking assembler funtions
I would like to use (link) a function written in assembler in an Arduino project.
What I want to do is:
write the function in assembler using avr-gcc calling conventions
declare the function as extern in the .ino file
provide the instructions and…

Stefan Nilsson
- 41
- 3
2
votes
1 answer
ELF section flags not picking up flags from linker script
In my linker script for binaries on an MSP430, I have a memory section marked "rx":
MEMORY {
ROM (rx) : ORIGIN = 0x4400, LENGTH = 0xb000 /* END=0xF3FF, size 45056 */
}
Despite this, readelf gives me:
[ 2] .rodata PROGBITS …

jhnphm
- 31
- 3