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]

[PATCH] Fix LTO weakref handling without .weakref assembler support (PR target/47333)


Hi!

If as doesn't support .weakref, we handle weakrefs by
assemble_alias setting IDENTIFIER_TRANSPARENT_ALIAS and using
ultimate_transparent_alias_target from assemble_name.
But for this to work, assemble_alias has to be called before
asm for functions is emitted, not after it.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux
and tested with the hacked up x86_64-linux gcc without HAVE_GAS_WEAKREF
in auto-host.h on the testcase.

Ok for trunk?

2012-01-06  Jakub Jelinek  <jakub@redhat.com>

	PR target/47333
	* cgraphunit.c (cgraph_optimize): Call output_weakrefs
	before emitting functions.

--- gcc/cgraphunit.c.jj	2011-12-15 08:06:54.000000000 +0100
+++ gcc/cgraphunit.c	2012-01-06 14:50:50.291364878 +0100
@@ -2187,6 +2187,7 @@ cgraph_optimize (void)
 #endif
   bitmap_obstack_release (NULL);
   cgraph_mark_functions_to_output ();
+  output_weakrefs ();
 
   cgraph_state = CGRAPH_STATE_EXPANSION;
   if (!flag_toplevel_reorder)
@@ -2201,7 +2202,6 @@ cgraph_optimize (void)
       varpool_assemble_pending_decls ();
     }
 
-  output_weakrefs ();
   cgraph_process_new_functions ();
   cgraph_state = CGRAPH_STATE_FINISHED;
 

	Jakub


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