Skip to main content
Mr.Embedded
Associate
May 4, 2023
Solved

Do .bin files use relative or absolute addresses?

  • May 4, 2023
  • 1 reply
  • 1690 views

I am trying to set up a dual boot system using a bootloader in stm32F7 without using the dual bank operation. I have the bootloader, which can flash the bin files directly to the flash .My concern is whether .bin files contain any address information, if so are they relative? Also, will the jmp instructions work as intended ?

The idea is to use the same linker file to generate the bin files for both memory sections and flash them to different sections using the bootloader. Right now I used different linker scripts for different sections of the memory.

This topic has been closed for replies.
Best answer by Tesla DeLorean

Most of the branches and calls are self-relative, so within the same section can be moved.

The linker builds assuming a fixed/known working address.

The vector table contains absolute addresses, but could be fixed up if moved to RAM.

To be sure the linker and compiler are building relative code/data, link at two different addresses, and delta the binaries. Should be pretty apparent, pretty quickly..

1 reply

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
May 4, 2023

Most of the branches and calls are self-relative, so within the same section can be moved.

The linker builds assuming a fixed/known working address.

The vector table contains absolute addresses, but could be fixed up if moved to RAM.

To be sure the linker and compiler are building relative code/data, link at two different addresses, and delta the binaries. Should be pretty apparent, pretty quickly..

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..