| View previous topic :: View next topic |
| Author |
Message |
Forum Administrator
Joined: 09 Jul 2004 Posts: 45 Location: Lake Oswego, OR
|
Posted: Fri Jul 16, 2004 1:40 pm Post subject: What's "-mcmodel=medium" and "-Mlarge_arrays& |
|
|
| I'm not 100% clear on what "-mcmodel=medium" and "-Mlarge_arrays" do. Can someone give an explaination? What impact do they have on performance? |
|
| Back to top |
|
 |
mleair
Joined: 19 Jul 2004 Posts: 67 Location: Portland Group
|
Posted: Wed Jul 28, 2004 8:58 am Post subject: RE: -mcmodel=medium and -Mlarge_arrays |
|
|
The -mcmodem=medium and -Mlarge_arrays compiler and linker options are supported under 64-bit linux environments (they are not supported under 32-bit linux environments).
The -mcmodel=medium option must be used to compile/link a program whose data and .bss sections exceed 2GB. In order for the program to use these large data sections, additional addressing instructions that support 64-bit offsets need to be generated. The effect this option has on performance is a function of the amount of data-use in the application. Therefore, this option should be used only when the aggregate data size exceeds 2GB.
The -Mlarge_arrays option tells the compiler that you have at least one single static data section (array) larger than 2GB. In this case, array accesses require 64-bit index arithmetic. This option must be used in conjunction with -mcmodel=medium.
A tell tale sign that you might need -mcmodel=medium occurs when you get warnings from the linker that mention "relocation truncated to fit".
There are other limitations to -mcmodel=medium (w.r.t. -fpic or position-independent code, shared libraries, etc.). Refer to the release notes (page 13) for more information:
http://www.pgroup.com/doc/pgiwsrn.pdf
-Mark |
|
| Back to top |
|
 |
|