This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [RFC] binutils support for x86-64 medium model shared libraries
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Jan Hubicka <jh at suse dot cz>, binutils at sources dot redhat dot com, schwab at suse dot de, evandro dot menezes at amd dot com
- Date: Thu, 2 Sep 2004 03:32:09 -0400
- Subject: Re: [RFC] binutils support for x86-64 medium model shared libraries
- References: <20040828135347.GK20631@kam.mff.cuni.cz> <20040902031151.GA15470@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Sep 01, 2004 at 08:11:51PM -0700, Richard Henderson wrote:
> Something you could do to avoid this conflict is to move large
> data structures to new sections ".large_data", ".large_rodata",
> etc, rather than moving the existing sections.
>
> You could arrange for these new sections to have their own PHDRs,
> such that program layout looks like
>
> LOAD ... vaddr 0x0000000000400000 ... flags r-x
> containing .text, .rodata, etc
> LOAD ... vaddr 0x0000000000500000 ... flags rw-
> containing .data, .bss, etc
> LOAD ... vaddr 0x0000000001000000 ... flags r--
> containing .large_rodata
> LOAD ... vaddr 0x0000000002000000 ... flags rw-
> containing .large_data, .large_bss
>
> The kernel might need some tweaking to set brk properly in this case.
The kernel should handle this properly, this had to be fixed already
for some prelinked binaries.
And the dynamic linker (which will be loading most of such shared libraries,
kernel would be handling only dynamic linkers or PIEs) handles this too
AFAIK.
Jakub