This is the mail archive of the
mailing list for the GCC project.
Re: [patch] Allow -mcmodel=large for x86-64 target
> The kernel VM layout for NetBSD/x86_64 is larger than will fit in either
> kernel or medium models. The issue is the amount of VM required for 2
> recursive linear PTE mappings (one for the current process, one for the
> "alternate" PTE spaced used to operate the page tables of a non-current
This appears to be similar to what other OSes hit as well. Linux sollution
is to put code+data into last 2gigs of address space, so it fits in the
negative 32bits allows by the kernel model.
In case you need data to be placed elsewhere and you need the relocations
to such data (In linux case the kernel do use some data outside the
allowed range, but all addresses to that are compilation time constants
and gcc will generate proper instructions in such case or they are accessed
Other possibility is the medium model - or I may hack together the mediumkernel
model allowing code in the negative 32bits and rest anywhere, but I would
preffer to not introduce such thing to gcc unless there is real need for it.
Medium code model produce longer and slower code, so it is better to fit
in kernel one. It is usually not that dificult as it looks, since while
x86_64 vm works in "signed" way.
> The kernel does not link unless large is used ("relocation truncted" errors).
> -- Jason R. Thorpe <firstname.lastname@example.org>