https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102625
Bug ID: 102625
Summary: [meta-bug] -mcmodel=large can't link
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: meta-bug
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: hjl.tools at gmail dot com
Depends on: 95620, 98693
Target Milestone: ---
Target: x86-64
[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]$
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95620
[Bug 95620] [10 Regression] relocation truncated to fit: R_X86_64_PC32 against
`.bss'
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98693
[Bug 98693] Compiling with -mcmodel=large emits .eh_frame with R_X86_64_PC32