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

fPIC with alignment

Note: This was originally posted on 18th July 2012 at http://forums.arm.com

Hi

I am trying to create a PIC elf image with --apcs=/fpic compiler option and --fpic linker option. It creates a PIC image alright with different load regions for code and data, but I would like to have them 4K aligned so that I can map those with appropriate RX and RW permissions. Any idea how can force the alignment?

Thanks in advance.
Parents
  • Note: This was originally posted on 19th July 2012 at http://forums.arm.com

    [color=#222222][size=2]
    The problem is that --fpicis ignored when --scatter is used
    [/size][/color]
    [color=#222222][size=2]
    [/size][/color]
    [size=2]For RVCT you just need to mark the section as position independent in the scatter file (add the "PI" attribute to the section). I'd be surprised if there was not a similar option for the GNU linker script.[/size]
    [color=#222222][size=2]
    [/size][/color]
    [color=#222222][size=2]Iso[/size][/color]
    [color=#222222][size=2]
    [/size][/color]
Reply
  • Note: This was originally posted on 19th July 2012 at http://forums.arm.com

    [color=#222222][size=2]
    The problem is that --fpicis ignored when --scatter is used
    [/size][/color]
    [color=#222222][size=2]
    [/size][/color]
    [size=2]For RVCT you just need to mark the section as position independent in the scatter file (add the "PI" attribute to the section). I'd be surprised if there was not a similar option for the GNU linker script.[/size]
    [color=#222222][size=2]
    [/size][/color]
    [color=#222222][size=2]Iso[/size][/color]
    [color=#222222][size=2]
    [/size][/color]
Children
No data