Port-mips archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: undefined functions and lazy dlopen()
On Thu, Jan 23, 2014 at 04:10:01PM +0100, Manuel Bouyer wrote:
> Looks similar to:
> http://sourceware-org.1504.n7.nabble.com/MIPS-R-MIPS-GOT-DISP-interferes-with-lazy-binding-td230667.html
>
> which triggered:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57260
>
> I will try to apply the patch here (or find the commit in the sources)
> and see how it goes
I've built a (netbsd-6, as HEAD has issues) release and running it on
loongson, including kernel, with the attached patch. I didn't notice
side effects yet, and X can now load its modules (doens't work yet, but
now I can look at how to access registers :)
Any objection before I commit ?
--
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
NetBSD: 26 ans d'experience feront toujours la difference
--
Index: gcc/config/mips/mips.c
===================================================================
RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/mips/mips.c,v
retrieving revision 1.1.1.1
diff -u -p -u -r1.1.1.1 mips.c
--- gcc/config/mips/mips.c 21 Jun 2011 01:22:34 -0000 1.1.1.1
+++ gcc/config/mips/mips.c 23 Jan 2014 16:47:01 -0000
@@ -6522,6 +6522,15 @@ mips_function_ok_for_sibcall (tree decl,
&& const_call_insn_operand (XEXP (DECL_RTL (decl), 0), VOIDmode))
return false;
+ /* Sibling calls should not prevent lazy binding. Lazy-binding stubs
+ require $gp to be valid on entry, so sibcalls can only use stubs
+ if $gp is call-clobbered. */
+ if (decl
+ && TARGET_CALL_SAVED_GP
+ && !TARGET_ABICALLS_PIC0
+ && !targetm.binds_local_p (decl))
+ return false;
+
/* Otherwise OK. */
return true;
}
Home |
Main Index |
Thread Index |
Old Index