aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1996-10-28 14:11:15 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1996-10-28 14:11:15 -0500
commit0bcc6fc75583d6f1528ec8ab9a5e8826d5cf97c0 (patch)
tree924415258df88805098e2824cd3f5f1c8489397b /gcc/varasm.c
parent5507b94b23cf2315842a3ad79d7ee24157da999c (diff)
downloadgcc-0bcc6fc75583d6f1528ec8ab9a5e8826d5cf97c0.zip
gcc-0bcc6fc75583d6f1528ec8ab9a5e8826d5cf97c0.tar.gz
gcc-0bcc6fc75583d6f1528ec8ab9a5e8826d5cf97c0.tar.bz2
(make_decl_rtl,assemble_variable): Allow named sections for
uninitialized variables. From-SVN: r13053
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index bae1242..7779828 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -706,23 +706,13 @@ make_decl_rtl (decl, asmspec, top_level)
globalize_reg (reg_number + --nregs);
}
}
- /* Specifying a section attribute on an uninitialized variable does not
- (and cannot) cause it to be put in the given section. The linker
- can only put initialized objects in specific sections, everything
- else goes in bss for the linker to sort out later (otherwise the
- linker would give a duplicate definition error for each compilation
- unit that behaved thusly). So warn the user. */
+ /* Specifying a section attribute on a variable forces it into a
+ non-.bss section, and thus it cannot be common. */
else if (TREE_CODE (decl) == VAR_DECL
&& DECL_SECTION_NAME (decl) != NULL_TREE
&& DECL_INITIAL (decl) == NULL_TREE
&& DECL_COMMON (decl))
- {
- warning_with_decl (decl,
- "section attribute ignored for uninitialized variable `%s'");
- /* Remove the section name so subsequent declarations won't see it.
- We are ignoring it, remember. */
- DECL_SECTION_NAME (decl) = NULL_TREE;
- }
+ DECL_COMMON (decl) = 0;
/* Now handle ordinary static variables and functions (in memory).
Also handle vars declared register invalidly. */