diff options
author | Doug Evans <dje@gnu.org> | 1997-07-01 22:36:13 +0000 |
---|---|---|
committer | Doug Evans <dje@gnu.org> | 1997-07-01 22:36:13 +0000 |
commit | 4144ff62cfdd1912de6a98e8cb9928c81d0dbd9b (patch) | |
tree | 8499988640e0d94201a231fe10b9fa0fec791c19 /gcc/config | |
parent | f953dd66a29dc819ef8a60ab35804b7d1aac6859 (diff) | |
download | gcc-4144ff62cfdd1912de6a98e8cb9928c81d0dbd9b.zip gcc-4144ff62cfdd1912de6a98e8cb9928c81d0dbd9b.tar.gz gcc-4144ff62cfdd1912de6a98e8cb9928c81d0dbd9b.tar.bz2 |
mips.c (mips_output_external): Don't output .extern's for variables in user specified sections unless...
* mips/mips.c (mips_output_external): Don't output .extern's for
variables in user specified sections unless they're .sbss/.sdata.
From-SVN: r14369
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/mips/mips.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index c7dc67f..584de95 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -4283,8 +4283,11 @@ print_operand_address (file, addr) us are in the permanent obstack, so that they will be valid at the end of the compilation. - If we have -G 0, or the extern size is unknown, don't bother - emitting the .externs. */ + If we have -G 0, or the extern size is unknown, or the object is in + a user specified section that is not .sbss/.sdata, don't bother + emitting the .externs. In the case of user specified sections this + behaviour is required as otherwise GAS will think the object lives in + .sbss/.sdata. */ int mips_output_external (file, decl, name) @@ -4294,10 +4297,14 @@ mips_output_external (file, decl, name) { register struct extern_list *p; int len; + tree section_name; if (TARGET_GP_OPT && ((TREE_CODE (decl)) != FUNCTION_DECL) - && ((len = int_size_in_bytes (TREE_TYPE (decl))) > 0)) + && ((len = int_size_in_bytes (TREE_TYPE (decl))) > 0) + && (((section_name = DECL_SECTION_NAME (decl)) == NULL) + || strcmp (TREE_STRING_POINTER (section_name), ".sbss") == 0 + || strcmp (TREE_STRING_POINTER (section_name), ".sdata") == 0)) { p = (struct extern_list *)permalloc ((long) sizeof (struct extern_list)); p->next = extern_head; |