[RFC] binutils support for x86-64 medium model shared libraries

Jakub Jelinek jakub@redhat.com
Thu Sep 2 07:32:00 GMT 2004


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



More information about the Binutils mailing list