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

Richard Henderson rth@redhat.com
Thu Sep 2 03:11:00 GMT 2004


On Sat, Aug 28, 2004 at 03:53:47PM +0200, Jan Hubicka wrote:
> 1) Currently the GOT/PLT sections are placed after data section, I need
>    to have thse before for medium model PIC libraries.  Please see the
>    changes to linker scripts at the end of patch;  I would like to ask
>    for proper sollution to this especially because I was told that this
>    is in conflict with optimization Jakub implements (ie it would be
>    nice to use "normal" ordering for small libraries and reversed for
>    big.  IP relative access to GOT/PLT is very important for
>    perfomrance...

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.



r~



More information about the Binutils mailing list