cancel
Showing results for 
Search instead for 
Did you mean: 

Do .bin files use relative or absolute addresses?

Mr.Embedded
Associate

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

1 REPLY 1

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
Up vote any posts that you find helpful, it shows what's working..