public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Varasm.c change.
       [not found] <27004079.1105373200696.JavaMail.root@dtm1eusosrv72.dtm.ops.eu.uu.net>
@ 2005-01-10 23:42 ` Toon Moene
  0 siblings, 0 replies; 6+ messages in thread
From: Toon Moene @ 2005-01-10 23:42 UTC (permalink / raw)
  To: gcc

I wrote:

> Is this one:
> 
>     2005-01-10  Jan Beulich  <jbeulich@novell.com>
>     
>     ...
>     * varasm.c (default_section_type_flags_1): Also set SECTION_SMALL
>     based on the section name. Rearrange the section name comparison logic
>     slightly so that each section name is compared against at most once.
> 
> responsible for this problem (on powerpc-unknown-linux-gnu):
> 
> stage1/xgcc -Bstage1/ -B/usr/snp/powerpc-unknown-linux-gnu/bin/ -c   -g 
> -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes 
> -Wmissing-prototypes  -fno-common -Wno-error  -DHAVE_CONFIG_H 
> -DGENERATOR_FILE    -I. -Ibuild -I../../gcc/gcc -I../../gcc/gcc/build 
> -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include  \
>  -o build/gengtype-lex.o gengtype-lex.c
> gengtype-lex.c:3367: warning: no previous prototype for 'yyget_lineno'
> gengtype-lex.c:3376: warning: no previous prototype for 'yyget_in'
> gengtype-lex.c:3384: warning: no previous prototype for 'yyget_out'
> gengtype-lex.c:3392: warning: no previous prototype for 'yyget_leng'
> gengtype-lex.c:3401: warning: no previous prototype for 'yyget_text'
> gengtype-lex.c:3410: warning: no previous prototype for 'yyset_lineno'
> gengtype-lex.c:3422: warning: no previous prototype for 'yyset_in'
> gengtype-lex.c:3427: warning: no previous prototype for 'yyset_out'
> gengtype-lex.c:3432: warning: no previous prototype for 'yyget_debug'
> gengtype-lex.c:3437: warning: no previous prototype for 'yyset_debug'
> gengtype-lex.c:3443: warning: no previous prototype for 'yylex_destroy'
> /tmp/ccfHJpOu.s: Assembler messages:
> /tmp/ccfHJpOu.s:18: Fatal error: Bad .section directive: want 
> a,e,w,x,M,S,G,T in string
> 
> ?

[ Beware, the answer might not be the obvious ]

But unfortunately, it is.  After reverting the varasm change from the 
patch, I was able to get past the problem spot, caused by a

	.section	.sdata, "aws"

statement.  The powerpc-unknown-linux-gnu GAS apparently doesn't like 
the "s" in the section attributes (this is
as --version
GNU assembler 2.15
Copyright 2002 Free Software Foundation, Inc.
so it is pretty old - Debian testing as of last weekend).

In short, Jan Beulich's update to varasm.c is probably correct, so I 
only reverted it locally.

-- 
Toon Moene - e-mail: toon@moene.indiv.nluug.nl - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Varasm.c change.
  2005-01-11  5:49     ` Richard Henderson
@ 2005-01-11  6:05       ` Alan Modra
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Modra @ 2005-01-11  6:05 UTC (permalink / raw)
  To: Richard Henderson, Eric Christopher, Toon Moene, gcc, jbeulich

On Mon, Jan 10, 2005 at 09:16:01PM -0800, Richard Henderson wrote:
> On Tue, Jan 11, 2005 at 02:37:41PM +1030, Alan Modra wrote:
> > No, don't.  ia64 is unique in that it defines a SHF_* value for ELF
> > section header sh_flags field to specify small section data.
> 
> Hmm?
> 
> #define SHF_ALPHA_GPREL         0x10000000
> #define SHF_MIPS_GPREL          0x10000000

Err, OK, I spoke too soon.

> It's probably default_elf_asm_named_section that should be tweaked
> such that it doesn't just assume that SECTION_SMALL -> 's'.

I considered that, but that means more target code.  ie. duplicating
elf_asm_named_section.  Hmm, unless you pull out the code that builds
flagchars.  Yeah, I guess that would be better..

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Varasm.c change.
  2005-01-11  5:33   ` Alan Modra
@ 2005-01-11  5:49     ` Richard Henderson
  2005-01-11  6:05       ` Alan Modra
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Henderson @ 2005-01-11  5:49 UTC (permalink / raw)
  To: Eric Christopher, Toon Moene, gcc, jbeulich

On Tue, Jan 11, 2005 at 02:37:41PM +1030, Alan Modra wrote:
> No, don't.  ia64 is unique in that it defines a SHF_* value for ELF
> section header sh_flags field to specify small section data.

Hmm?

#define SHF_ALPHA_GPREL         0x10000000
#define SHF_MIPS_GPREL          0x10000000

It's probably default_elf_asm_named_section that should be tweaked
such that it doesn't just assume that SECTION_SMALL -> 's'.


r~

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Varasm.c change.
  2005-01-11  5:16 ` Eric Christopher
@ 2005-01-11  5:33   ` Alan Modra
  2005-01-11  5:49     ` Richard Henderson
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Modra @ 2005-01-11  5:33 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Eric Christopher, Toon Moene, gcc, jbeulich

On Mon, Jan 10, 2005 at 04:20:22PM -0800, Eric Christopher wrote:
> On Mon, 2005-01-10 at 16:59 +0100, Toon Moene wrote:
> > Is this one:
> > 
> > 	2005-01-10  Jan Beulich  <jbeulich@novell.com>
> > 	
> > 	...
> > 	* varasm.c (default_section_type_flags_1): Also set SECTION_SMALL
> > 	based on the section name. Rearrange the section name comparison logic
> > 	slightly so that each section name is compared against at most once.
> > 
> > responsible for this problem (on powerpc-unknown-linux-gnu):
> 
> It is and it broke mips as well. Now I could probably add the support
> into the assembler, but...

No, don't.  ia64 is unique in that it defines a SHF_* value for ELF
section header sh_flags field to specify small section data.  Since
other ELF targets can't do anything special with small data sections via
flags, I don't think the assembler should try to handle the 's' flag.

I've applied the following as an obvious fix for the ppc bootstrap
breakage.  If rth decides the original ought to be reverted, then
reverting this as well isn't much harder..

	* varasm.c (default_section_type_flags_1): Don't set SECTION_SMALL.
	* config/ia64/ia64.c (TARGET_SECTION_TYPE_FLAGS): Define.
	(TARGET_RWRELOC): Define.
	(ia64_rwreloc_section_type_flags): Delete.
	(ia64_section_type_flags): New function.
	* config/ia64/hpux.h (TARGET_SECTION_TYPE_FLAGS): Don't define.
	(TARGET_RWRELOC): Define.

Index: gcc/varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.473
diff -u -p -r1.473 varasm.c
--- gcc/varasm.c	10 Jan 2005 07:42:48 -0000	1.473
+++ gcc/varasm.c	11 Jan 2005 03:38:03 -0000
@@ -4606,20 +4606,11 @@ default_section_type_flags_1 (tree decl,
 
   if (strcmp (name, ".bss") == 0
       || strncmp (name, ".bss.", 5) == 0
-      || strncmp (name, ".gnu.linkonce.b.", 16) == 0)
-    flags |= SECTION_BSS;
-
-  if (strcmp (name, ".sdata") == 0
-      || strncmp (name, ".sdata.", 7) == 0
-      || strncmp (name, ".gnu.linkonce.s.", 16) == 0
-      || strncmp (name, ".sdata2.", 8) == 0
-      || strncmp (name, ".gnu.linkonce.s2.", 17) == 0)
-    flags |= SECTION_SMALL;
-
-  if (strcmp (name, ".sbss") == 0
+      || strncmp (name, ".gnu.linkonce.b.", 16) == 0
+      || strcmp (name, ".sbss") == 0
       || strncmp (name, ".sbss.", 6) == 0
       || strncmp (name, ".gnu.linkonce.sb.", 17) == 0)
-    flags |= SECTION_SMALL | SECTION_BSS;
+    flags |= SECTION_BSS;
 
   if (strcmp (name, ".tdata") == 0
       || strncmp (name, ".tdata.", 7) == 0
Index: gcc/config/ia64/hpux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/hpux.h,v
retrieving revision 1.44
diff -u -p -r1.44 hpux.h
--- gcc/config/ia64/hpux.h	30 Jun 2004 03:50:55 -0000	1.44
+++ gcc/config/ia64/hpux.h	11 Jan 2005 03:38:03 -0000
@@ -193,8 +193,7 @@ do {								\
 #define TARGET_ASM_UNIQUE_SECTION  ia64_rwreloc_unique_section
 #undef  TARGET_ASM_SELECT_RTX_SECTION
 #define TARGET_ASM_SELECT_RTX_SECTION  ia64_rwreloc_select_rtx_section
-#undef  TARGET_SECTION_TYPE_FLAGS
-#define TARGET_SECTION_TYPE_FLAGS  ia64_rwreloc_section_type_flags
+#define TARGET_RWRELOC  true
 
 /* ia64 HPUX has the float and long double forms of math functions.  */
 #undef TARGET_C99_FUNCTIONS
Index: gcc/config/ia64/ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.c,v
retrieving revision 1.341
diff -u -p -r1.341 ia64.c
--- gcc/config/ia64/ia64.c	10 Jan 2005 07:42:49 -0000	1.341
+++ gcc/config/ia64/ia64.c	11 Jan 2005 03:38:08 -0000
@@ -258,9 +258,7 @@ static void ia64_rwreloc_unique_section 
 static void ia64_rwreloc_select_rtx_section (enum machine_mode, rtx,
 					     unsigned HOST_WIDE_INT)
      ATTRIBUTE_UNUSED;
-static unsigned int ia64_rwreloc_section_type_flags (tree, const char *, int)
-     ATTRIBUTE_UNUSED;
-
+static unsigned int ia64_section_type_flags (tree, const char *, int);
 static void ia64_hpux_add_extern_decl (tree decl)
      ATTRIBUTE_UNUSED;
 static void ia64_hpux_file_end (void)
@@ -387,6 +385,9 @@ static const struct attribute_spec ia64_
 #undef TARGET_ENCODE_SECTION_INFO
 #define TARGET_ENCODE_SECTION_INFO ia64_encode_section_info
 
+#undef  TARGET_SECTION_TYPE_FLAGS
+#define TARGET_SECTION_TYPE_FLAGS  ia64_section_type_flags
+
 /* ??? ABI doesn't allow us to define this.  */
 #if 0
 #undef TARGET_PROMOTE_FUNCTION_ARGS
@@ -8796,10 +8797,27 @@ ia64_rwreloc_select_rtx_section (enum ma
   flag_pic = save_pic;
 }
 
+#ifndef TARGET_RWRELOC
+#define TARGET_RWRELOC flag_pic
+#endif
+
 static unsigned int
-ia64_rwreloc_section_type_flags (tree decl, const char *name, int reloc)
+ia64_section_type_flags (tree decl, const char *name, int reloc)
 {
-  return default_section_type_flags_1 (decl, name, reloc, true);
+  unsigned int flags = 0;
+
+  if (strcmp (name, ".sdata") == 0
+      || strncmp (name, ".sdata.", 7) == 0
+      || strncmp (name, ".gnu.linkonce.s.", 16) == 0
+      || strncmp (name, ".sdata2.", 8) == 0
+      || strncmp (name, ".gnu.linkonce.s2.", 17) == 0
+      || strcmp (name, ".sbss") == 0
+      || strncmp (name, ".sbss.", 6) == 0
+      || strncmp (name, ".gnu.linkonce.sb.", 17) == 0)
+    flags = SECTION_SMALL;
+
+  flags |= default_section_type_flags_1 (decl, name, reloc, TARGET_RWRELOC);
+  return flags;
 }
 
 /* Returns true if FNTYPE (a FUNCTION_TYPE or a METHOD_TYPE) returns a

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Varasm.c change.
  2005-01-10 16:59 Toon Moene
@ 2005-01-11  5:16 ` Eric Christopher
  2005-01-11  5:33   ` Alan Modra
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Christopher @ 2005-01-11  5:16 UTC (permalink / raw)
  To: Toon Moene; +Cc: gcc, jbeulich

On Mon, 2005-01-10 at 16:59 +0100, Toon Moene wrote:
> Is this one:
> 
> 	2005-01-10  Jan Beulich  <jbeulich@novell.com>
> 	
> 	...
> 	* varasm.c (default_section_type_flags_1): Also set SECTION_SMALL
> 	based on the section name. Rearrange the section name comparison logic
> 	slightly so that each section name is compared against at most once.
> 
> responsible for this problem (on powerpc-unknown-linux-gnu):

It is and it broke mips as well. Now I could probably add the support
into the assembler, but...

-eric

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Varasm.c change.
@ 2005-01-10 16:59 Toon Moene
  2005-01-11  5:16 ` Eric Christopher
  0 siblings, 1 reply; 6+ messages in thread
From: Toon Moene @ 2005-01-10 16:59 UTC (permalink / raw)
  To: gcc

Is this one:

	2005-01-10  Jan Beulich  <jbeulich@novell.com>
	
	...
	* varasm.c (default_section_type_flags_1): Also set SECTION_SMALL
	based on the section name. Rearrange the section name comparison logic
	slightly so that each section name is compared against at most once.

responsible for this problem (on powerpc-unknown-linux-gnu):

stage1/xgcc -Bstage1/ -B/usr/snp/powerpc-unknown-linux-gnu/bin/ -c   -g 
-O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes 
-Wmissing-prototypes  -fno-common -Wno-error  -DHAVE_CONFIG_H 
-DGENERATOR_FILE    -I. -Ibuild -I../../gcc/gcc -I../../gcc/gcc/build 
-I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include  \
  -o build/gengtype-lex.o gengtype-lex.c
gengtype-lex.c:3367: warning: no previous prototype for 'yyget_lineno'
gengtype-lex.c:3376: warning: no previous prototype for 'yyget_in'
gengtype-lex.c:3384: warning: no previous prototype for 'yyget_out'
gengtype-lex.c:3392: warning: no previous prototype for 'yyget_leng'
gengtype-lex.c:3401: warning: no previous prototype for 'yyget_text'
gengtype-lex.c:3410: warning: no previous prototype for 'yyset_lineno'
gengtype-lex.c:3422: warning: no previous prototype for 'yyset_in'
gengtype-lex.c:3427: warning: no previous prototype for 'yyset_out'
gengtype-lex.c:3432: warning: no previous prototype for 'yyget_debug'
gengtype-lex.c:3437: warning: no previous prototype for 'yyset_debug'
gengtype-lex.c:3443: warning: no previous prototype for 'yylex_destroy'
/tmp/ccfHJpOu.s: Assembler messages:
/tmp/ccfHJpOu.s:18: Fatal error: Bad .section directive: want 
a,e,w,x,M,S,G,T in string

?

It 'Just Worked' yesterday ...

-- 
Toon Moene - e-mail: toon@moene.indiv.nluug.nl - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-01-11  5:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <27004079.1105373200696.JavaMail.root@dtm1eusosrv72.dtm.ops.eu.uu.net>
2005-01-10 23:42 ` Varasm.c change Toon Moene
2005-01-10 16:59 Toon Moene
2005-01-11  5:16 ` Eric Christopher
2005-01-11  5:33   ` Alan Modra
2005-01-11  5:49     ` Richard Henderson
2005-01-11  6:05       ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).