From 0b70a74f8182b817c8aa97874d9027d5d4047220 Mon Sep 17 00:00:00 2001
From: "benjamin%smedbergs.us" <benjamin%smedbergs.us>
Date: Tue, 11 Apr 2006 13:28:21 +0000
Subject: [PATCH] Bug 326925 - components should be loaded with RLTD_NOW,
 r=darin - This is an experimental checkin that has the potential to affect Ts
 times on linux machines, especially nonstatic builds.

---
 xpcom/io/nsLocalFileOSX.cpp  | 7 ++++++-
 xpcom/io/nsLocalFileUnix.cpp | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/xpcom/io/nsLocalFileOSX.cpp b/xpcom/io/nsLocalFileOSX.cpp
index 2b75d21050d21..c90710fafd1b1 100644
--- a/xpcom/io/nsLocalFileOSX.cpp
+++ b/xpcom/io/nsLocalFileOSX.cpp
@@ -1253,7 +1253,12 @@ NS_IMETHODIMP nsLocalFile::Load(PRLibrary **_retval)
   if (NS_FAILED(rv))
     return rv;
 
-  *_retval = PR_LoadLibrary(path.get());
+  PRLibSpec ls = {
+    PR_LibSpec_Pathname,
+    path.get()
+  };
+
+  *_retval = PR_LoadLibraryWithFlags(ls, PR_LD_NOW);
 
   NS_TIMELINE_STOP_TIMER("PR_LoadLibrary");
   NS_TIMELINE_MARK_TIMER1("PR_LoadLibrary", path.get());
diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
index 3191a4e642718..e8a66fb6874fc 100644
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
@@ -1586,7 +1586,12 @@ nsLocalFile::Load(PRLibrary **_retval)
 
     NS_TIMELINE_START_TIMER("PR_LoadLibrary");
 
-    *_retval = PR_LoadLibrary(mPath.get());
+    PRLibSpec ls = {
+        PR_LibSpec_Pathname,
+        mPath.get()
+    };
+
+    *_retval = PR_LoadLibraryWithFlags(ls, PR_LD_NOW);
 
     NS_TIMELINE_STOP_TIMER("PR_LoadLibrary");
     NS_TIMELINE_MARK_TIMER1("PR_LoadLibrary", mPath.get());
-- 
GitLab