This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to make section position independent?

Hello,
i work with uVision 3 V3.72, linker V3.1.0.942. i check in linker options make ro section postion independent and also use memory layout from the Target dialog.And duing linking shows warnign L6914W: option ropi ignored when using --scatter. My question is why? Why this warning has appeared?
Is there any other why to make section position independent?
thanks in advance

Parents
  • Position-independant code requires the memory addresses to be relative.

    A scatter file allows multiple memory areas to be specified.

    Position-independant code would not manage that you move one memory area but keeps the other fixed since that would change the relative distance.

    In the end, you will really have to think twice about your memory layout and use of global variables or pointers with hard-coded destination when working with position-independant code.

    Moving the code to a 4kB higher address may not mean that you want all variable references to also move to a 4kB higher address...

Reply
  • Position-independant code requires the memory addresses to be relative.

    A scatter file allows multiple memory areas to be specified.

    Position-independant code would not manage that you move one memory area but keeps the other fixed since that would change the relative distance.

    In the end, you will really have to think twice about your memory layout and use of global variables or pointers with hard-coded destination when working with position-independant code.

    Moving the code to a 4kB higher address may not mean that you want all variable references to also move to a 4kB higher address...

Children