- publishing free software manuals
An Introduction to GCC - for the GNU compilers gcc and g++
by Brian J. Gough, foreword by Richard M. Stallman
Paperback (6"x9"), 144 pages
ISBN 0954161793
RRP £12.95 ($19.95)

"An excellent introduction... fills a much-needed niche in the marketplace" --- Association of C and C++ Users book review (Issue 16-4, August 2004) Get a printed copy>>>

8.1.2 x86 64-bit processors

AMD has enhanced the 32-bit x86 instruction set to a 64-bit instruction set called x86-64, which is implemented in their AMD64 processors.(24) On AMD64 systems GCC generates 64-bit code by default. The option -m32 allows 32-bit code to be generated instead.

The AMD64 processor has several different memory models for programs running in 64-bit mode. The default model is the small code model, which allows code and data up to 2GB in size. The medium code model allows unlimited data sizes and can be selected with -mcmodel=medium. There is also a large code model, which supports an unlimited code size in addition to unlimited data size. It is not currently implemented in GCC since the medium code model is sufficient for all practical purposes--executables with sizes greater than 2GB are not encountered in practice.

A special kernel code model -mcmodel=kernel is provided for system-level code, such as the Linux kernel. An important point to note is that by default on the AMD64 there is a 128-byte area of memory allocated below the stack pointer for temporary data, referred to as the "red-zone", which is not supported by the Linux kernel. Compilation of the Linux kernel on the AMD64 requires the options -mcmodel=kernel -mno-red-zone.

ISBN 0954161793An Introduction to GCC - for the GNU compilers gcc and g++See the print edition