diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2016-04-26 10:10:33 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2016-04-26 10:10:33 +0000 |
commit | 901f29c8c9a5775af65f883701ed10a19084d818 (patch) | |
tree | bcdb13c91a5e6f0e0dd4519b74e8ac2d48f8c76b /gcc | |
parent | b2eb4ed5aa837132cb46375a5facab6d0e7453c6 (diff) | |
download | gcc-901f29c8c9a5775af65f883701ed10a19084d818.zip gcc-901f29c8c9a5775af65f883701ed10a19084d818.tar.gz gcc-901f29c8c9a5775af65f883701ed10a19084d818.tar.bz2 |
Support .largecomm with Solaris as (PR target/61821)
PR target/61821
* config/i386/i386.c (LARGECOMM_SECTION_ASM_OP): Define default.
(x86_elf_aligned_common): Rename to ...
(x86_elf_aligned_decl_common): ... this.
Add decl arg. Switch to .lbss for largecomm object. Use
LARGECOMM_SECTION_ASM_OP.
* config/i386/i386-protos.h (x86_elf_aligned_common): Reflect
renaming.
* config/i386/x86-64.h (ASM_OUTPUT_ALIGNED_COMMON): Rename to ...
(ASM_OUTPUT_ALIGNED_DECL_COMMON): ... this.
Pass new decl arg.
* config/i386/sol2.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
[!USE_GAS] (LARGECOMM_SECTION_ASM_OP): Define.
From-SVN: r235435
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/config/i386/i386-protos.h | 4 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 14 | ||||
-rw-r--r-- | gcc/config/i386/sol2.h | 10 | ||||
-rw-r--r-- | gcc/config/i386/x86-64.h | 6 |
5 files changed, 39 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d86fb69..1907d2b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,21 @@ 2016-04-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + PR target/61821 + * config/i386/i386.c (LARGECOMM_SECTION_ASM_OP): Define default. + (x86_elf_aligned_common): Rename to ... + (x86_elf_aligned_decl_common): ... this. + Add decl arg. Switch to .lbss for largecomm object. Use + LARGECOMM_SECTION_ASM_OP. + * config/i386/i386-protos.h (x86_elf_aligned_common): Reflect + renaming. + * config/i386/x86-64.h (ASM_OUTPUT_ALIGNED_COMMON): Rename to ... + (ASM_OUTPUT_ALIGNED_DECL_COMMON): ... this. + Pass new decl arg. + * config/i386/sol2.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise. + [!USE_GAS] (LARGECOMM_SECTION_ASM_OP): Define. + +2016-04-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + PR target/59407 * config/i386/i386.c (SECTION_LARGE): Define. (x86_64_elf_select_section): Set it for large data/bss sections. diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index 93b5e1e..4145ed5 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -296,8 +296,8 @@ extern int ix86_decompose_address (rtx, struct ix86_address *); extern int memory_address_length (rtx, bool); extern void x86_output_aligned_bss (FILE *, tree, const char *, unsigned HOST_WIDE_INT, int); -extern void x86_elf_aligned_common (FILE *, const char *, - unsigned HOST_WIDE_INT, int); +extern void x86_elf_aligned_decl_common (FILE *, tree, const char *, + unsigned HOST_WIDE_INT, int); #ifdef RTX_CODE extern void ix86_fp_comparison_codes (enum rtx_code code, enum rtx_code *, diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 8495e0a..d8278fb 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6648,19 +6648,27 @@ x86_64_elf_unique_section (tree decl, int reloc) } #ifdef COMMON_ASM_OP + +#ifndef LARGECOMM_SECTION_ASM_OP +#define LARGECOMM_SECTION_ASM_OP "\t.largecomm\t" +#endif + /* This says how to output assembler code to declare an uninitialized external linkage data object. - For medium model x86-64 we need to use .largecomm opcode for + For medium model x86-64 we need to use LARGECOMM_SECTION_ASM_OP opcode for large objects. */ void -x86_elf_aligned_common (FILE *file, +x86_elf_aligned_decl_common (FILE *file, tree decl, const char *name, unsigned HOST_WIDE_INT size, int align) { if ((ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_MEDIUM_PIC) && size > (unsigned int)ix86_section_threshold) - fputs ("\t.largecomm\t", file); + { + switch_to_section (get_named_section (decl, ".lbss", 0)); + fputs (LARGECOMM_SECTION_ASM_OP, file); + } else fputs (COMMON_ASM_OP, file); assemble_name (file, name); diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h index 5d3122e..df23b12 100644 --- a/gcc/config/i386/sol2.h +++ b/gcc/config/i386/sol2.h @@ -184,15 +184,15 @@ along with GCC; see the file COPYING3. If not see /* As in sparc/sol2.h, override the default from i386/x86-64.h to work around Sun as TLS bug. */ -#undef ASM_OUTPUT_ALIGNED_COMMON -#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ +#undef ASM_OUTPUT_ALIGNED_DECL_COMMON +#define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \ do \ { \ if (TARGET_SUN_TLS \ && in_section \ && ((in_section->common.flags & SECTION_TLS) == SECTION_TLS)) \ switch_to_section (bss_section); \ - x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN); \ + x86_elf_aligned_decl_common (FILE, DECL, NAME, SIZE, ALIGN); \ } \ while (0) @@ -230,6 +230,10 @@ along with GCC; see the file COPYING3. If not see #define DTORS_SECTION_ASM_OP "\t.section\t.dtors, \"aw\"" #endif +#ifndef USE_GAS +#define LARGECOMM_SECTION_ASM_OP "\t.lbcomm\t" +#endif + #define USE_IX86_FRAME_POINTER 1 #define USE_X86_64_FRAME_POINTER 1 diff --git a/gcc/config/i386/x86-64.h b/gcc/config/i386/x86-64.h index 204f128..b0bf835 100644 --- a/gcc/config/i386/x86-64.h +++ b/gcc/config/i386/x86-64.h @@ -55,9 +55,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ x86_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -#undef ASM_OUTPUT_ALIGNED_COMMON -#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ - x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN); +#undef ASM_OUTPUT_ALIGNED_DECL_COMMON +#define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \ + x86_elf_aligned_decl_common (FILE, DECL, NAME, SIZE, ALIGN); /* This is used to align code labels according to Intel recommendations. */ |