X86-64: Difference between revisions

Jump to navigation Jump to search
m
Undo revision 25151 by Nullplan (talk) Nullplan was wrong, quoted GNU gcc manual.
[unchecked revision][unchecked revision]
(→‎Text Segment Types: Irrelevant and false information removed)
m (Undo revision 25151 by Nullplan (talk) Nullplan was wrong, quoted GNU gcc manual.)
Line 190:
| The kernel runs in the negative 2 GB of the address space. This model has to be used for Linux kernel code.
|}
It worth noting that code models are different for architectures, as they are tied with the instruction encoding. For example, AArch64 has a "-mcmodel=tiny" too, which allows 1M addressing, unknown to x86_64. And for AArch64 "-mcmodel=small" has a 4G limitation, not 2G as for the x86_64.
 
From experience, you should not use "-mcmodel=kernel". According to the [https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html GNU gcc manual] "this model has to be used for Linux kernel code". It is not available for other architectures, and it might change any time to suit the Linux kernel needs. It is better if you use a proper linker script with explicit higher-half addresses to place your kernel into the negative address range.
 
== See Also ==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu