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]
Other format: [Raw text]

Re: [PATCH] Don't use weak linkage for symbols in COMDAT groups


Mark Mitchell wrote:
Julian Brown wrote:

Hi,

This patch stops entities with vague linkage from being declared as ELF weak symbols when HAVE_GAS_COMDAT_GROUP is true. This is mainly cosmetic, but could lead to subtle interoperability problems.

Tested with cross to arm-none-eabi.

OK to apply?

Is there any reason not to do this in elf.h? It doesn't seem ARM-specific to me. Would you try making that change, and testing on IA32 GNU/Linux as well? Does anyone see backwards compatibility problems here?

It doesn't lead to any new regressions on HEAD for i686-pc-linux-gnu with the alteration in config/elfos.h instead.


So now I guess this could be applied to both HEAD & csl-arm-branch. OK?

ChangeLog:

	* config/elfos.h (MAKE_DECL_ONE_ONLY): Redefined to stop
	DECL_WEAK from being used for symbols with vague linkage when
	HAVE_GAS_COMDAT_GROUP is true.

--
Julian Brown
CodeSourcery, LLC
Index: gcc/config/elfos.h
===================================================================
RCS file: /home/gcc/repos/gcc/gcc/gcc/config/elfos.h,v
retrieving revision 1.66
diff -c -p -r1.66 elfos.h
*** gcc/config/elfos.h	17 Oct 2004 18:09:33 -0000	1.66
--- gcc/config/elfos.h	25 Feb 2005 16:12:24 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 212,218 ****
    fprintf ((FILE), "%s\n", ASM_SECTION_START_OP)
  #endif
  
! #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
  
  /* Switch into a generic section.  */
  #define TARGET_ASM_NAMED_SECTION  default_elf_asm_named_section
--- 212,226 ----
    fprintf ((FILE), "%s\n", ASM_SECTION_START_OP)
  #endif
  
! /* Don't use weak for entities with vague linkage when HAVE_GAS_COMDAT_GROUP
!    is true.  */
! #define MAKE_DECL_ONE_ONLY(DECL)			\
!   do							\
!     {							\
!       if (!HAVE_GAS_COMDAT_GROUP)			\
! 	DECL_WEAK(DECL) = 1;				\
!     }							\
!   while (0)
  
  /* Switch into a generic section.  */
  #define TARGET_ASM_NAMED_SECTION  default_elf_asm_named_section

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