Specify elf section flag in linker script.
Posted: Fri Jul 01, 2011 3:27 am
Hi,
Anyone knows how to specify section flags(Allocate/Writable/eXecutable) in linker script? I found out GNU ld does set some flags to the "magic" sections, for example, it will set flags "AX" for .text & .init section. But GNU ld won't set any flags for sections with customized names, for example .mykernel section.
My elf loader relies on the "A" flag to work. If the "A" flag isn't set, it won't copy data to memory. I really don't want to parse the section name, it's much more complicated.
Thanks
torshie
Anyone knows how to specify section flags(Allocate/Writable/eXecutable) in linker script? I found out GNU ld does set some flags to the "magic" sections, for example, it will set flags "AX" for .text & .init section. But GNU ld won't set any flags for sections with customized names, for example .mykernel section.
My elf loader relies on the "A" flag to work. If the "A" flag isn't set, it won't copy data to memory. I really don't want to parse the section name, it's much more complicated.
Thanks
torshie