This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH, spu: quieten libgcc builds
- From: Ben Elliston <bje at au1 dot ibm dot com>
- To: Trevor_Smigiel at playstation dot sony dot com
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, andrew_pinski at playstation dot sony dot com
- Date: Mon, 08 Dec 2008 13:31:55 +1100
- Subject: Re: PATCH, spu: quieten libgcc builds
- References: <1228362024.24236.7.camel@helios> <20081204035821.GV448@playstation.sony.com>
> Could you provide details on which libgcc functions are causing the
> messages? And why it is ok to ignore them?
One of the functions in mfc_tag_table.c is marked with __attribute__
((constructor)), producing this warning:
mfc_tag_table.c: In function â__mfc_tag_initâ:
mfc_tag_table.c:39: warning: creating run-time relocation for â__mfc_tag_initâ
When final outputs the address of this function to the table in
the .ctors section, reloc_diagnostic flags this as a runtime relocation.
The symbol is always provided, and so the linker will always be able to
resolve these at link time.
What about silencing the warning for constructor/destructor functions,
like so?
Index: config/spu/spu.c
===================================================================
--- config/spu/spu.c (revision 142545)
+++ config/spu/spu.c (working copy)
@@ -4767,6 +4767,11 @@ reloc_diagnostic (rtx x)
&& GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF)
decl = SYMBOL_REF_DECL (XEXP (XEXP (x, 0), 0));
+ /* Don't emit a warning for constructor or destructor functions. */
+ if (decl && (DECL_STATIC_CONSTRUCTOR (decl)
+ || DECL_STATIC_DESTRUCTOR (decl)))
+ return;
+
/* SYMBOL_REF_DECL is not necessarily a DECL. */
if (decl && !DECL_P (decl))
decl = 0;