[hjl@gnu-cfl-2 tmp]$ cat l.c #include <stdio.h> char foo[0x100000000] = { 1 }; int main () { printf ("%p\n", foo); return 0; } [hjl@gnu-cfl-2 tmp]$ gcc l.c -mcmodel=large /usr/lib/gcc/x86_64-redhat-linux/11/crtbegin.o: in function `deregister_tm_clones': crtstuff.c:(.text+0x1): relocation truncated to fit: R_X86_64_32 against symbol `__TMC_END__' defined in .data section in a.out crtstuff.c:(.text+0x7): relocation truncated to fit: R_X86_64_32S against `.tm_clone_table' crtstuff.c:(.text+0x18): relocation truncated to fit: R_X86_64_32 against `.tm_clone_table' /usr/lib/gcc/x86_64-redhat-linux/11/crtbegin.o: in function `register_tm_clones': crtstuff.c:(.text+0x31): relocation truncated to fit: R_X86_64_32 against symbol `__TMC_END__' defined in .data section in a.out crtstuff.c:(.text+0x38): relocation truncated to fit: R_X86_64_32S against `.tm_clone_table' crtstuff.c:(.text+0x5a): relocation truncated to fit: R_X86_64_32 against `.tm_clone_table' /usr/lib/gcc/x86_64-redhat-linux/11/crtbegin.o: in function `__do_global_dtors_aux': crtstuff.c:(.text+0x76): relocation truncated to fit: R_X86_64_PC32 against `.bss' crtstuff.c:(.text+0x88): relocation truncated to fit: R_X86_64_PC32 against `.bss' collect2: error: ld returned 1 exit status [hjl@gnu-cfl-2 tmp]$
1. Need large model crtbegin*.o and crtend*.o. 2. Need large mode libgcc.a, libgcc_eh.a and libgcov.a. 3. Need large mode lib*.a if we want to link with lib*.a 4. Need the large model libc.a if we want to support large model static executable.
libc_nonshared.a and crt1.o from glibc need build changes even for dynamic linking.