This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

gold patch committed: Recognize -fsplit-stack prologue


A function with a static chain can have a slightly different prologue
when using -fsplit-stack, because if the frame is large is computes
the offset into %edx rather than %ecx.  This is because %ecx holds the
static chain pointer.  We normally use %ecx because it is available if
the function has a regparm attribute of less than 3.

I committed this patch to gold to recognize this prologue.

Ian


2009-12-23  Ian Lance Taylor  <iant@google.com>

	* i386.cc (Target_i386::do_calls_non_split): Recognize
	-fsplit-stack prologue for a function with a static chain.


Index: i386.cc
===================================================================
RCS file: /cvs/src/src/gold/i386.cc,v
retrieving revision 1.105
diff -p -u -r1.105 i386.cc
--- i386.cc	14 Dec 2009 19:53:04 -0000	1.105
+++ i386.cc	23 Dec 2009 23:52:57 -0000
@@ -2703,7 +2703,9 @@ Target_i386::do_calls_non_split(Relobj* 
       this->set_view_to_nop(view, view_size, fnoffset + 1, 6);
     }
   // lea NN(%esp),%ecx
-  else if (this->match_view(view, view_size, fnoffset, "\x8d\x8c\x24", 3)
+  // lea NN(%esp),%edx
+  else if ((this->match_view(view, view_size, fnoffset, "\x8d\x8c\x24", 3)
+	    || this->match_view(view, view_size, fnoffset, "\x8d\x94\x24", 3))
 	   && fnsize > 7)
     {
       // This is loading an offset from the stack pointer for a

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