default_elf_select_section

Alan Modra amodra@bigpond.net.au
Sun Nov 28 23:11:00 GMT 2004


On Sat, Nov 27, 2004 at 11:58:44PM -0800, Richard Henderson wrote:
> On Sun, Nov 28, 2004 at 02:20:22PM +1030, Alan Modra wrote:
> > Is there a reason why default_elf_select_section_1 doesn't pass decl
> > down to named_section?
> 
> Not that I can think of...

This fixes the assembler complaint in pr9571 by giving
targetm.section_type_flags the decl that it needs.  See
default_section_type_flags_1.  No problems fould with powerpc-linux
and powerpc64-linux bootstraps and regression tests.

	PR target/9571
	* varasm.c (default_elf_select_section_1): Pass decl to named_section.

diff -urp -xCVS -x'*~' gcc-virgin/gcc/varasm.c gcc-current/gcc/varasm.c
--- gcc-virgin/gcc/varasm.c	2004-11-20 21:49:05.000000000 +1030
+++ gcc-current/gcc/varasm.c	2004-11-27 23:22:10.671019119 +1030
@@ -4915,41 +4915,41 @@ default_elf_select_section_1 (tree decl,
       mergeable_constant_section (DECL_MODE (decl), align, 0);
       break;
     case SECCAT_SRODATA:
-      named_section (NULL_TREE, ".sdata2", reloc);
+      named_section (decl, ".sdata2", reloc);
       break;
     case SECCAT_DATA:
       data_section ();
       break;
     case SECCAT_DATA_REL:
-      named_section (NULL_TREE, ".data.rel", reloc);
+      named_section (decl, ".data.rel", reloc);
       break;
     case SECCAT_DATA_REL_LOCAL:
-      named_section (NULL_TREE, ".data.rel.local", reloc);
+      named_section (decl, ".data.rel.local", reloc);
       break;
     case SECCAT_DATA_REL_RO:
-      named_section (NULL_TREE, ".data.rel.ro", reloc);
+      named_section (decl, ".data.rel.ro", reloc);
       break;
     case SECCAT_DATA_REL_RO_LOCAL:
-      named_section (NULL_TREE, ".data.rel.ro.local", reloc);
+      named_section (decl, ".data.rel.ro.local", reloc);
       break;
     case SECCAT_SDATA:
-      named_section (NULL_TREE, ".sdata", reloc);
+      named_section (decl, ".sdata", reloc);
       break;
     case SECCAT_TDATA:
-      named_section (NULL_TREE, ".tdata", reloc);
+      named_section (decl, ".tdata", reloc);
       break;
     case SECCAT_BSS:
 #ifdef BSS_SECTION_ASM_OP
       bss_section ();
 #else
-      named_section (NULL_TREE, ".bss", reloc);
+      named_section (decl, ".bss", reloc);
 #endif
       break;
     case SECCAT_SBSS:
-      named_section (NULL_TREE, ".sbss", reloc);
+      named_section (decl, ".sbss", reloc);
       break;
     case SECCAT_TBSS:
-      named_section (NULL_TREE, ".tbss", reloc);
+      named_section (decl, ".tbss", reloc);
       break;
     default:
       abort ();


-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Gcc-patches mailing list