summaryrefslogtreecommitdiff
path: root/pr/src/linking/prlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'pr/src/linking/prlink.c')
-rw-r--r--pr/src/linking/prlink.c128
1 files changed, 5 insertions, 123 deletions
diff --git a/pr/src/linking/prlink.c b/pr/src/linking/prlink.c
index 4503d9f8..31f30b6a 100644
--- a/pr/src/linking/prlink.c
+++ b/pr/src/linking/prlink.c
@@ -7,10 +7,6 @@
#include <string.h>
-#ifdef XP_BEOS
-#include <image.h>
-#endif
-
#if defined(XP_MACOSX) && defined(USE_MACH_DYLD)
#include <Carbon/Carbon.h>
#include <CoreFoundation/CoreFoundation.h>
@@ -92,10 +88,6 @@ struct PRLibrary {
#endif
#endif
-#ifdef XP_BEOS
- void* dlh;
- void* stub_dlh;
-#endif
};
static PRLibrary *pr_loadmap;
@@ -272,23 +264,16 @@ PR_GetLibraryPath(void)
ev = strdup(ev);
#endif
-#if defined(XP_UNIX) || defined(XP_BEOS)
-#if defined(USE_DLFCN) || defined(USE_MACH_DYLD) || defined(XP_BEOS)
+#if defined(XP_UNIX)
+#if defined(USE_DLFCN) || defined(USE_MACH_DYLD)
{
char *p=NULL;
int len;
-#ifdef XP_BEOS
- ev = getenv("LIBRARY_PATH");
- if (!ev) {
- ev = "%A/lib:/boot/home/config/lib:/boot/beos/system/lib";
- }
-#else
ev = getenv("LD_LIBRARY_PATH");
if (!ev) {
ev = "/usr/lib:/lib";
}
-#endif
len = strlen(ev) + 1; /* +1 for the null */
p = (char*) malloc(len);
@@ -345,7 +330,7 @@ PR_GetLibraryName(const char *path, const char *lib)
}
}
#endif /* XP_PC */
-#if defined(XP_UNIX) || defined(XP_BEOS)
+#if defined(XP_UNIX)
if (strstr(lib, PR_DLL_SUFFIX) == NULL)
{
if (path) {
@@ -360,7 +345,7 @@ PR_GetLibraryName(const char *path, const char *lib)
fullname = PR_smprintf("%s", lib);
}
}
-#endif /* XP_UNIX || XP_BEOS */
+#endif /* XP_UNIX */
return fullname;
}
@@ -838,96 +823,6 @@ pr_LoadLibraryByPathname(const char *name, PRIntn flags)
lm->refCount = 1;
-#ifdef XP_BEOS
- {
- image_info info;
- int32 cookie = 0;
- image_id imageid = B_ERROR;
- image_id stubid = B_ERROR;
- PRLibrary *p;
-
- for (p = pr_loadmap; p != NULL; p = p->next) {
- /* hopefully, our caller will always use the same string
- to refer to the same library */
- if (strcmp(name, p->name) == 0) {
- /* we've already loaded this library */
- imageid = info.id;
- lm->refCount++;
- break;
- }
- }
-
- if(imageid == B_ERROR) {
- /* it appears the library isn't yet loaded - load it now */
- char stubName [B_PATH_NAME_LENGTH + 1];
-
- /* the following is a work-around to a "bug" in the beos -
- the beos system loader allows only 32M (system-wide)
- to be used by code loaded as "add-ons" (code loaded
- through the 'load_add_on()' system call, which includes
- mozilla components), but allows 256M to be used by
- shared libraries.
-
- unfortunately, mozilla is too large to fit into the
- "add-on" space, so we must trick the loader into
- loading some of the components as shared libraries. this
- is accomplished by creating a "stub" add-on (an empty
- shared object), and linking it with the component
- (the actual .so file generated by the build process,
- without any modifications). when this stub is loaded
- by load_add_on(), the loader will automatically load the
- component into the shared library space.
- */
-
- strcpy(stubName, name);
- strcat(stubName, ".stub");
-
- /* first, attempt to load the stub (thereby loading the
- component as a shared library */
- if ((stubid = load_add_on(stubName)) > B_ERROR) {
- /* the stub was loaded successfully. */
- imageid = B_FILE_NOT_FOUND;
-
- cookie = 0;
- while (get_next_image_info(0, &cookie, &info) == B_OK) {
- const char *endOfSystemName = strrchr(info.name, '/');
- const char *endOfPassedName = strrchr(name, '/');
- if( 0 == endOfSystemName )
- endOfSystemName = info.name;
- else
- endOfSystemName++;
- if( 0 == endOfPassedName )
- endOfPassedName = name;
- else
- endOfPassedName++;
- if (strcmp(endOfSystemName, endOfPassedName) == 0) {
- /* this is the actual component - remember it */
- imageid = info.id;
- break;
- }
- }
-
- } else {
- /* we failed to load the "stub" - try to load the
- component directly as an add-on */
- stubid = B_ERROR;
- imageid = load_add_on(name);
- }
- }
-
- if (imageid <= B_ERROR) {
- oserr = imageid;
- PR_DELETE( lm );
- goto unlock;
- }
- lm->name = strdup(name);
- lm->dlh = (void*)imageid;
- lm->stub_dlh = (void*)stubid;
- lm->next = pr_loadmap;
- pr_loadmap = lm;
- }
-#endif
-
result = lm; /* success */
PR_LOG(_pr_linker_lm, PR_LOG_MIN, ("Loaded library %s (load lib)", lm->name));
@@ -975,13 +870,6 @@ PR_UnloadLibrary(PRLibrary *lib)
goto done;
}
-#ifdef XP_BEOS
- if(((image_id)lib->stub_dlh) == B_ERROR)
- unload_add_on( (image_id) lib->dlh );
- else
- unload_add_on( (image_id) lib->stub_dlh);
-#endif
-
#ifdef XP_UNIX
#ifdef HAVE_DLL
#ifdef USE_DLFCN
@@ -1078,7 +966,7 @@ pr_FindSymbolInLib(PRLibrary *lm, const char *name)
** If the symbol was not found in the static table then check if
** the symbol was exported in the DLL... Win16 only!!
*/
-#if !defined(WIN16) && !defined(XP_BEOS)
+#if !defined(WIN16)
PR_SetError(PR_FIND_SYMBOL_ERROR, 0);
return (void*)NULL;
#endif
@@ -1145,12 +1033,6 @@ pr_FindSymbolInLib(PRLibrary *lm, const char *name)
#undef SYM_OFFSET
#endif /* XP_MACOSX && USE_MACH_DYLD */
-#ifdef XP_BEOS
- if( B_NO_ERROR != get_image_symbol( (image_id)lm->dlh, name, B_SYMBOL_TYPE_TEXT, &f ) ) {
- f = NULL;
- }
-#endif
-
#ifdef XP_UNIX
#ifdef HAVE_DLL
#ifdef USE_DLFCN