This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

re: Bug in arm-elf-gcc


Hi Soh,

  I am about to check in the patch below which should fix this problem
  for you.  What was happening was that gcc was setting the initial
  value of the __hc structure to 'error_mark_node' and this was being
  incorrectly interpreted by the UNIQUE_SECTION macro in the Arm ELF
  backend as meaning that the structure should be placed in the .bss
  section.

  The patch below fixes this problem, and also rearrnages the code so
  that constant, unitialised data will be placed in the .rodata
  section, not the .bss section.

Cheers
	Nick


2000-05-18  Nick Clifton  <nickc@cygnus.com>

	* config/arm/unknown-elf.h (UNIQUE_SECTION): Place constant,
	uninitialised data in .rodata not .bss, and do not interpret an
	error in the initialisation value as meaning that the variable
	should be placed in the .bss section.

Index: gcc/config/arm/unknown-elf.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/arm/unknown-elf.h,v
retrieving revision 1.12
diff -p -r1.12 unknown-elf.h
*** unknown-elf.h	2000/04/08 14:29:53	1.12
--- unknown-elf.h	2000/05/18 18:52:21
*************** rdata_section ()						\
*** 159,169 ****
        									\
        if (TREE_CODE (DECL) == FUNCTION_DECL)				\
  	sec = 0;							\
-       else if (DECL_INITIAL (DECL) == 0					\
- 	       || DECL_INITIAL (DECL) == error_mark_node)		\
- 	sec = 3;							\
        else if (DECL_READONLY_SECTION (DECL, RELOC))			\
  	sec = 1;							\
        else								\
  	sec = 2;							\
        									\
--- 159,168 ----
        									\
        if (TREE_CODE (DECL) == FUNCTION_DECL)				\
  	sec = 0;							\
        else if (DECL_READONLY_SECTION (DECL, RELOC))			\
  	sec = 1;							\
+       else if (DECL_INITIAL (DECL) == NULL_TREE)			\
+ 	sec = 3;							\
        else								\
  	sec = 2;							\
        									\

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]