OSDN Git Service

PR middle-end/31490
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 3 Feb 2011 19:12:07 +0000 (19:12 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 3 Feb 2011 19:12:07 +0000 (19:12 +0000)
commit91da0f1cbba29c0c0d36e70d0d88842d5aaa496d
treed84c6553f07cd91230768e24b2d35f690b8488db
parent61aeb5015aac5a923b4a162b4bbf3cba566b5efe
PR middle-end/31490
* output.h (SECTION_RELRO): Define.
(SECTION_MACH_DEP): Adjust.
(get_variable_section): New prototype.
* varpool.c (varpool_finalize_named_section_flags): New function.
(varpool_assemble_pending_decls): Call it.
* cgraph.h (varpool_finalize_named_section_flags): New prototype.
* cgraphunit.c (cgraph_output_in_order): Call
varpool_finalize_named_section_flags.
* varasm.c (get_section): Allow section flags conflicts between
relro and read-only sections if the section hasn't been declared yet.
Set SECTION_OVERRIDE after diagnosing section type conflict.
(get_variable_section): No longer static.
(default_section_type_flags): Use SECTION_WRITE | SECTION_RELRO for
readonly sections that need relocations.
(decl_readonly_section_1): New function.
(decl_readonly_section): Use it.

Revert:
2010-11-17  Dinar Temirbulatov <dtemirbulatov@gmail.com>
    Steve Ellcey  <sje@cup.hp.com>

PR middle-end/31490
* varasm.c (categorize_decl_for_section): Ignore reloc_rw_mask
if section attribute used.

* gcc.dg/pr31490-2.c: New test.
* gcc.dg/pr31490-3.c: New test.
* gcc.dg/pr31490-4.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169804 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/cgraph.h
gcc/cgraphunit.c
gcc/output.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr31490-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr31490-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr31490-4.c [new file with mode: 0644]
gcc/varasm.c
gcc/varpool.c