diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-08-23 11:57:44 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-08-23 11:57:44 +0200 |
commit | 520a5868fa96c928b8004702440253ac02f64b9d (patch) | |
tree | 3cc1c3765943a8a0391a6e8943c77100b0db853d /gcc | |
parent | e500c62a863dc846792368cf7eda84cce8501a25 (diff) | |
download | gcc-520a5868fa96c928b8004702440253ac02f64b9d.zip gcc-520a5868fa96c928b8004702440253ac02f64b9d.tar.gz gcc-520a5868fa96c928b8004702440253ac02f64b9d.tar.bz2 |
re PR target/58218 (-mcmodel=medium cause assembler warning "ignoring incorrect section type for .lbss")
PR target/58218
* config/i386/x86-64.h (TARGET_SECTION_TYPE_FLAGS): Define.
* config/i386/i386.c (x86_64_elf_section_type_flags): New function.
* gcc.target/i386/pr58218.c: New test.
From-SVN: r201938
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 22 | ||||
-rw-r--r-- | gcc/config/i386/x86-64.h | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr58218.c | 5 |
5 files changed, 39 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e571e55..a6624ed 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-08-23 Jakub Jelinek <jakub@redhat.com> + + PR target/58218 + * config/i386/x86-64.h (TARGET_SECTION_TYPE_FLAGS): Define. + * config/i386/i386.c (x86_64_elf_section_type_flags): New function. + 2013-08-23 Kirill Yukhin <kirill.yukhin@intel.com> * gcc/config/i386/predicates.md (ext_sse_reg_operand): New. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index d05dbf0..536c357 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4912,6 +4912,28 @@ x86_64_elf_select_section (tree decl, int reloc, return default_elf_select_section (decl, reloc, align); } +/* Select a set of attributes for section NAME based on the properties + of DECL and whether or not RELOC indicates that DECL's initializer + might contain runtime relocations. */ + +static unsigned int ATTRIBUTE_UNUSED +x86_64_elf_section_type_flags (tree decl, const char *name, int reloc) +{ + unsigned int flags = default_section_type_flags (decl, name, reloc); + + if (decl == NULL_TREE + && (strcmp (name, ".ldata.rel.ro") == 0 + || strcmp (name, ".ldata.rel.ro.local") == 0)) + flags |= SECTION_RELRO; + + if (strcmp (name, ".lbss") == 0 + || strncmp (name, ".lbss.", 5) == 0 + || strncmp (name, ".gnu.linkonce.lb.", 16) == 0) + flags |= SECTION_BSS; + + return flags; +} + /* Build up a unique section name, expressed as a STRING_CST node, and assign it to DECL_SECTION_NAME (decl). RELOC indicates whether the initial value of EXP requires diff --git a/gcc/config/i386/x86-64.h b/gcc/config/i386/x86-64.h index 3363439..0c62723 100644 --- a/gcc/config/i386/x86-64.h +++ b/gcc/config/i386/x86-64.h @@ -103,3 +103,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #undef TARGET_ASM_UNIQUE_SECTION #define TARGET_ASM_UNIQUE_SECTION x86_64_elf_unique_section + +#undef TARGET_SECTION_TYPE_FLAGS +#define TARGET_SECTION_TYPE_FLAGS x86_64_elf_section_type_flags diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c6e0653..db1c984 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2013-08-23 Jakub Jelinek <jakub@redhat.com> + PR target/58218 + * gcc.target/i386/pr58218.c: New test. + PR tree-optimization/58209 * gcc.c-torture/execute/pr58209.c: New test. diff --git a/gcc/testsuite/gcc.target/i386/pr58218.c b/gcc/testsuite/gcc.target/i386/pr58218.c new file mode 100644 index 0000000..4145242 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr58218.c @@ -0,0 +1,5 @@ +/* PR target/58218 */ +/* { dg-do assemble { target lp64 } } */ +/* { dg-options "-mcmodel=medium" } */ + +struct { float x[16385]; } a = { { 0.f, } }; |