diff mbox

RFA: PR 66655: Use COFF/PE weak symbols

Message ID 87si2uss7r.fsf@redhat.com
State New
Headers show

Commit Message

Nick Clifton Dec. 22, 2015, 10:17 a.m. UTC
Hi Guys,

  The patch below is a proposed fix for PR 66655.  The issue I believe
  is not that the ming32 definition of bind_local_p is wrong, but rather
  that G++ thinks that it cannot make the decl weak even though
  bind_local_p says that it should.  The answer is to define
  MAKE_DECL_ONE_ONLY using the COFF/PE weak symbol support now available
  in gas and the linker.  Doing this allows the test to pass.

  OK to apply ?

Cheers
  Nick

gcc/ChangeLog
2015-12-22  Nick Clifton  <nickc@redhat.com>

	PR target/66655
	* config/i386/cygming.h (MAKE_DECL_ONE_ONLY): Use weak symbol
	support, if available.

Comments

Jeff Law Jan. 2, 2016, 5:29 a.m. UTC | #1
On 12/22/2015 03:17 AM, Nick Clifton wrote:
> Hi Guys,
>
>    The patch below is a proposed fix for PR 66655.  The issue I believe
>    is not that the ming32 definition of bind_local_p is wrong, but rather
>    that G++ thinks that it cannot make the decl weak even though
>    bind_local_p says that it should.  The answer is to define
>    MAKE_DECL_ONE_ONLY using the COFF/PE weak symbol support now available
>    in gas and the linker.  Doing this allows the test to pass.
>
>    OK to apply ?
>
> Cheers
>    Nick
>
> gcc/ChangeLog
> 2015-12-22  Nick Clifton  <nickc@redhat.com>
>
> 	PR target/66655
> 	* config/i386/cygming.h (MAKE_DECL_ONE_ONLY): Use weak symbol
> 	support, if available.
You probably know the capabilities of COFF/PE better than I, so the 
patch itself is fine.

Is there any way that test can be shoved into our dejagnu testing 
harness?  I think we've got support somewhere for tests which require 
multiple input files.

Jeff
diff mbox

Patch

Index: config/i386/cygming.h
===================================================================
--- config/i386/cygming.h       (revision 231898)
+++ config/i386/cygming.h       (working copy)
@@ -432,6 +432,10 @@ 
       fputc ('\n', (FILE));           \
     }                                 \
   while (0)
+
+/* Make use of the weak support for ONE_ONLY decls.  */
+#undef  MAKE_DECL_ONE_ONLY
+#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
 #endif /* HAVE_GAS_WEAK */
 
 /* FIXME: SUPPORTS_WEAK && TARGET_HAVE_NAMED_SECTIONS is true,