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]

Fix for -fdata-sections overriding __attribute__((section))


Hi Guys,

  There is a bug with the current arm-elf port.  If a variable is
  given an explicit section, using the section attribute, this
  attribute will be ignored if the -fdata-sections command line switch
  it used.  I have applied the patch below to fix this problem.

Cheers
	Nick

2000-10-31  Nick Clifton  <nickc@redhat.com>

	* config/arm/unknown-elf.h (UNIQUE_SECTION_P): Do not allow
	-fdata-sections to override the section attribute of a DECL.

Index: config/arm/unknown-elf.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/arm/unknown-elf.h,v
retrieving revision 1.15
diff -p -r1.15 unknown-elf.h
*** unknown-elf.h	2000/09/25 12:08:01	1.15
--- unknown-elf.h	2000/11/01 01:16:00
*************** rdata_section ()						\
*** 139,145 ****
  
  #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
  
! #define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL) || flag_data_sections)
  
  #define UNIQUE_SECTION(DECL, RELOC)					\
    do									\
--- 139,145 ----
  
  #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
  
! #define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
  
  #define UNIQUE_SECTION(DECL, RELOC)					\
    do									\

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