Questions tagged [linker]

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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
32 views

How to interpret internal_ram data section in NXP

In .lcf (linker configuration file) in my project, in SRAM memory there is an internal_ram section: And in my case this ...
user avatar
  • 175
-1 votes
1 answer
412 views

STM32 How can I run code from ram?

I have this really simple "Hello world" piece of software (project attached), running on a STM32WB55 Nucleo board (basically, it sends "HELLO WORLD\n" via USART1, every 1000 ms). I ...
user avatar
0 votes
0 answers
46 views

"[!provide]" in GCC Linker .map file?

Like the title says, I'm getting a [!provide] output in the GCC .map file when I try to compile firmware for the PAC5532. Here's the linker script. ...
user avatar
  • 955
1 vote
3 answers
282 views

Why are data records in intel hex files often limited to 16 bytes, even for long contiguous blocks?

I'm not sure if this is true in general, but all intel hex files I have seen (from Atmel Studio, STM32CubeIDE and MPLAB) use data records with a length of 16 bytes. Even when the addresses written to ...
user avatar
  • 8,613
1 vote
1 answer
152 views

C++ AVR big code size & excess unused symbols in build file

I'm developing the program for the AVR microcontroller in C++. I have created a class that contains 8 methods(with constructors) but used only 3. Class code: ...
user avatar
0 votes
1 answer
64 views

Where do I place linker sections in my FLASH memory?

I'm trying to write my own bootloader and an entire program to be flashed to my microcontroller from scratch (STM32F303RE based on the ARM Cortex-m4 architecture) I've been watching a tutorial series ...
user avatar
  • 1
1 vote
1 answer
113 views

Why does the AVR Assembler linker think my data table is at the wrong address?

MCU: ATmega1284 Programmer: JTAGICE3 IDE: Atmel Studio 7.0.2397 Language: AVR Assembler I have a constant data table in flash memory. The linker thinks it is located at address 0x0090, so when I ...
user avatar
  • 9,542
1 vote
0 answers
230 views

Linking and the ELF - use of PC-relative addressing, GOT and PLT

So that we're on the same page, I'll try to explain what I think I know about Symbol Relocation and ask questions as they come up. Symbol Relocation: Absolute addresses – replace the reference for ...
user avatar
1 vote
0 answers
110 views

Relocation in MPLAB IDE X

I'm writing a bootloader for ATXMEGA256A3U. At page 14, Table 7.1 of the datasheet I know the bootloader address start at 0x20000. Using AtmelStudio I set in the linker option the following ...
user avatar
  • 875
3 votes
0 answers
165 views

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 ...
user avatar
10 votes
4 answers
2k views

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 ...
user avatar
  • 229
0 votes
1 answer
200 views

Application and bootloader written in different tools can not be compatible?

I have a bootloader to PIC18F4550 that was written using Mikro C for PIC and I have two firmware applications, one was written using Mikro C for PIC and the other using MPLAB X with XC8 compiler. ...
user avatar
  • 835
3 votes
1 answer
2k views

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 ...
user avatar
  • 1,137
3 votes
2 answers
955 views

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... ...
user avatar
  • 9,315
1 vote
1 answer
248 views

bootloaders "reset memory mapping"

im looking into bootloaders and how they work this picture from application note by atmel for their SAM series bootloader "AP-Note_AT04189" so Stack pointer and reset? Stack pointer is an address of ...
user avatar
1 vote
1 answer
209 views

STM32F407 Flash sector auto cleared after programming

I've tried to do flash logger function for my device based on STM32f407 and found some problem with flash: If I uncomment function for clear sector, after load program my dummy data on first page is ...
user avatar
7 votes
4 answers
2k views

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 ...
user avatar
4 votes
3 answers
327 views

What are the details about link files and startup code one needs to know to write an Operating System for a uC? [closed]

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 ...
user avatar
6 votes
2 answers
10k views

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 ...
user avatar
1 vote
2 answers
3k views

How to use a Linker File with Keil uVision5 ARM?

I am trying to follow a tutorial implementing a custom bootloader on a STM32F072 (ARM M0 Core), which requires remapping memory areas when compiling for both the 'bootload' application and the 'main-...
user avatar
  • 396
4 votes
1 answer
1k views

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 ...
user avatar
  • 51
1 vote
1 answer
212 views

ESP8266 and GCC

I think this is more related to GCC rather than ESP8266. I have been trying to put in a constant variable in read only memory section of ESP. The idea is to change the value directly in the binary ...
user avatar
3 votes
2 answers
4k views

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 ...
user avatar
  • 78
0 votes
3 answers
995 views

Linker error using Atmel Studio with C++ project

I have created a simple C++ project using Studio 7.0.1006. Then using "Add Class", I added a simple class called CGPIO. To this class I added a public method called Initialize. The code compiles and ...
user avatar
0 votes
2 answers
409 views

Fill ROM with jump instructions

As I have heard it is a common practice to fill the unused flash memory of a microcontroller with an jump instruction to the reset function. This aids in resetting the MCU in case of the PC is corrupt,...
user avatar
0 votes
1 answer
112 views

Code composer 6 linker file not placing variables

I am developing firmware on MSP430F2619. I need to store configuration information having 5 sections of 200 bytes. In order to read and write them independently I am trying to allocate 5 sections of ...
user avatar
  • 169
-2 votes
1 answer
531 views

What is a startup code how it is related to bootloader or bootloader code?

I am doing a project on building a bootloader for a kinetis E series controller (MKE02Z64VLD2). My mentor told me to have a thorough knowledge about Startup code and linker files before starting the ...
user avatar
4 votes
2 answers
2k views

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 ...
user avatar
0 votes
1 answer
710 views

Error while running linker am using TIVA C TM4C123G and IAR

I am trying to change and read my TM4C123G launchpad clock frequency to 80 MHZ using TIVAWARE libraries so here is my code: ...
user avatar
0 votes
2 answers
1k views

Merging 2 Hex files

My MSP430 program consists of serial bootloader and application hex files. While programming I load bootloader program using JTAG and then load application program using bootloader. I am looking for ...
user avatar
  • 169
1 vote
2 answers
797 views

Starting application program at fix address in MSP430F2619

I am writing firmware for system with boot loader and application using TI MSP430F2619 micro-controller. I want to know How I can make sure my program restart at predefined address in flash let us ...
user avatar
  • 169
2 votes
1 answer
2k views

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": ...
user avatar
  • 31
1 vote
2 answers
2k views

Microchip XC8: How to Overlap Specific Variables without Union?

I have effectively three sets of variables to put in two locations. Sets 1 and 2 are never used together, so they can occupy the same space. Set 3 needs to be unique. I know I can use a union of ...
user avatar
  • 5,261
2 votes
2 answers
1k views

Microchip's XC8 Linker doesn't recognize some custom section names

Slightly related to this one: https://softwareengineering.stackexchange.com/questions/254734/microchip-xc8-how-to-pack-code-against-an-upper-limit I can relocate code just fine, but I'm having some ...
user avatar
  • 5,261
3 votes
3 answers
4k views

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 ...
user avatar
  • 621
2 votes
2 answers
2k views

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 ...
user avatar
4 votes
2 answers
834 views

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 ...
user avatar
  • 41
8 votes
1 answer
232 views

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 ...
user avatar
  • 2,186