-
- Downloads
i386: Allow -mlarge-data-threshold with -mcmodel=large
From: Fangrui Song <maskray@google.com> When using -mcmodel=medium, large data objects larger than the -mlarge-data-threshold threshold are placed into large data sections (.lrodata, .ldata, .lbss and some variants). GNU ld and ld.lld 17 place .l* sections into separate output sections. If small and medium code model object files are mixed, the .l* sections won't exert relocation overflow pressure on sections in object files built with -mcmodel=small. However, when using -mcmodel=large, -mlarge-data-threshold doesn't apply. This means that the .rodata/.data/.bss sections may exert relocation overflow pressure on sections in -mcmodel=small object files. This patch allows -mcmodel=large to generate .l* sections and drops an unneeded documentation restriction that the value must be the same. Link: https://groups.google.com/g/x86-64-abi/c/jnQdJeabxiU ("Large data sections for the large code model") Signed-off-by:Fangrui Song <maskray@google.com> gcc/ChangeLog: * config/i386/i386.cc (ix86_can_inline_p): Handle CM_LARGE and CM_LARGE_PIC. (x86_elf_aligned_decl_common): Ditto. (x86_output_aligned_bss): Ditto. * config/i386/i386.opt: Update doc for -mlarge-data-threshold=. * doc/invoke.texi: Update doc for -mlarge-data-threshold=. gcc/testsuite/ChangeLog: * gcc.target/i386/large-data.c: New test.
Showing
- gcc/config/i386/i386.cc 6 additions, 3 deletionsgcc/config/i386/i386.cc
- gcc/config/i386/i386.opt 1 addition, 1 deletiongcc/config/i386/i386.opt
- gcc/doc/invoke.texi 3 additions, 3 deletionsgcc/doc/invoke.texi
- gcc/testsuite/gcc.target/i386/large-data.c 13 additions, 0 deletionsgcc/testsuite/gcc.target/i386/large-data.c
Loading
Please register or sign in to comment