This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [RFC PATCH] Readonly .eh_frame and .gcc_except_table
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 25 Nov 2002 10:58:00 +1030
- Subject: Re: [RFC PATCH] Readonly .eh_frame and .gcc_except_table
- References: <20021122215828.O14760@sunsite.ms.mff.cuni.cz>
On Fri, Nov 22, 2002 at 09:58:28PM +0100, Jakub Jelinek wrote:
> Hi!
>
> While .eh_frame and .gcc_except_table used to have dynamic relocations
> against it in the GCC 2 days, on most important arches it doesn't any
> longer if DW_EH_PE_{pc,data,func,text}rel encodings are used
> over the whole sections. But even when gcc makes sure to mark all .eh_frame
> resp. all .gcc_except_table sections read-only if no dynamic relocations
> will be against it, .eh_frame / .gcc_except_table stays in the read/write
> segment since that is where linker script puts them.
> If it is in RW segment, it can cause up to two pages wasted per process.
> Either we can remove .eh_frame and .gcc_except_table from the linker script,
> but we loose control on its exact placement and .eh_frame looses KEEP,
> so that it can be garbage collected out of the binary/dso.
> Or the following patch adds an linker script extension which allows to
> keep control on where exactly is the output section placed, both if it
> consists of all read-only sections only, or if it contains
> at least one read-write section.
> What do you think?
Hi Jakub,
I'm thinking a more generally useful linker script enhancement might
be better, and should be easy to implement. How about an AUTO_PLACE
keyword for an output section? Allows KEEP and other input section
flags + ordering etc., but placement relative to other output sections
is chosen automatically by the linker.
--
Alan Modra
IBM OzLabs - Linux Technology Centre