X86-64: Difference between revisions
Jump to navigation
Jump to search
[unchecked revision] | [unchecked revision] |
Content deleted Content added
m →Text Segment Types: typo fix: nothing -> noting |
→Text Segment Types: Irrelevant and false information removed |
||
Line 190: | Line 190: | ||
| The kernel runs in the negative 2 GB of the address space. This model has to be used for Linux kernel code. |
| 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, and for AArch64 "-mcmodel=small" has a 4G limitation, not 2G. |
|||
From experience, you should not use "-mcmodel=kernel". That is a hack for the Linux kernel on x86_64. It is not available for other architectures, and you should not rely on a hack that was written for a kernel with non-stable API. It might change any time. It is better if you use a proper linker script instead to place your kernel into the negative address range. |
|||
== See Also == |
== See Also == |