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, spu: quieten libgcc builds


> 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;



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