This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Preventing .text and .rodata being merged


On Nov 30, 2007 3:26 PM, Paul Koning <pkoning@equallogic.com> wrote:

Hi Paul,

>  Will> Hello all, I would like to be able to stop the .text and
>  Will> .rodata sections being merged into the same ELF segment. Is
>  Will> there an easy way to do this?  From looking at
>  Will> map_sections_to_segments it looks like it isn't. More generally
>  Will> I would like to make sure that executable read-only sections
>  Will> and non-executable read-only sections are kept separate in the
>  Will> output.
>
> You should be able to do that with a linker script.

Is there an idiomatic way of doing that? The generic linker script
(elf.sc) seems to just place the sections adjacent to one another and
then the linker puts them in the same segment. Reordering the sections
looks like it could get messy and may not be 100% reliable, is there
another way?

Thanks,

>     paul
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]