-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
1.1.3
-
sparc
-
solaris_2.5.1
Date: Sun, 6 Jul 1997 18:33:37 -0700 (PDT)
From: David Rivas <jdr@shorter>
Subject: dlsym resolution in 1.1.3
To: mr@shorter, lindholm@shorter, thomasb@shorter
Didn't know who to talk to on this one, so=20
excuse me for the distribution.
I think the=041.1.3 symbol resolving logic, which seems
to have been totally rewritten in 1.2, has a little
bug that I found and need fixed.
Symbol resolution seems to come down to the function,
in src/solaris/java/runtime/linker_md.c:
long
sysDynamicLink(char *sym_p)
{
void *f =3D 0;
int i;
/*
* we need this kludge, because the java interpreter internals need
* to access this before the Linker class is loaded and calls
* the static initializers
*/
if (!linkerinitialized) {
=09(void)sysInitializeLinker();
}
=20
if ((f =3D dlsym(RTLD_NEXT, sym_p)) =3D=3D 0) {
=09for (i =3D useddlsegments; --i >=3D 0;) {
=09 if ((f =3D dlsym(dlsegment[i].handle, sym_p))) {
=09=09return((long)f);
=09 }
=09}
}
return 0;
}
The problem is that if the first dlsym succeeds it returns 0
instead of the symbol address.=20
A possible fix is:
long
sysDynamicLink(char *sym_p)
{
void *f =3D 0;
int i;
/*
* we need this kludge, because the java interpreter internals need
* to access this before the Linker class is loaded and calls
* the static initializers
*/
if (!linkerinitialized) {
=09(void)sysInitializeLinker();
}
if ((f =3D dlsym(RTLD_NEXT, sym_p)) =3D=3D 0) {
=09for (i =3D useddlsegments; --i >=3D 0;) {
=09 if ((f =3D dlsym(dlsegment[i].handle, sym_p))) {
=09=09return((long)f);
=09 }
=09}
}=20
/* Return the symbol (which may be null) */
return f;
}
For a variety of reasons I'm trying to get the AuidoEngine to
work on pre 1.2 platforms, and this bug gets tickled.
Who can review and put this (or another) fix back? I can
put it back if that's approprate.
david
From: David Rivas <jdr@shorter>
Subject: dlsym resolution in 1.1.3
To: mr@shorter, lindholm@shorter, thomasb@shorter
Didn't know who to talk to on this one, so=20
excuse me for the distribution.
I think the=041.1.3 symbol resolving logic, which seems
to have been totally rewritten in 1.2, has a little
bug that I found and need fixed.
Symbol resolution seems to come down to the function,
in src/solaris/java/runtime/linker_md.c:
long
sysDynamicLink(char *sym_p)
{
void *f =3D 0;
int i;
/*
* we need this kludge, because the java interpreter internals need
* to access this before the Linker class is loaded and calls
* the static initializers
*/
if (!linkerinitialized) {
=09(void)sysInitializeLinker();
}
=20
if ((f =3D dlsym(RTLD_NEXT, sym_p)) =3D=3D 0) {
=09for (i =3D useddlsegments; --i >=3D 0;) {
=09 if ((f =3D dlsym(dlsegment[i].handle, sym_p))) {
=09=09return((long)f);
=09 }
=09}
}
return 0;
}
The problem is that if the first dlsym succeeds it returns 0
instead of the symbol address.=20
A possible fix is:
long
sysDynamicLink(char *sym_p)
{
void *f =3D 0;
int i;
/*
* we need this kludge, because the java interpreter internals need
* to access this before the Linker class is loaded and calls
* the static initializers
*/
if (!linkerinitialized) {
=09(void)sysInitializeLinker();
}
if ((f =3D dlsym(RTLD_NEXT, sym_p)) =3D=3D 0) {
=09for (i =3D useddlsegments; --i >=3D 0;) {
=09 if ((f =3D dlsym(dlsegment[i].handle, sym_p))) {
=09=09return((long)f);
=09 }
=09}
}=20
/* Return the symbol (which may be null) */
return f;
}
For a variety of reasons I'm trying to get the AuidoEngine to
work on pre 1.2 platforms, and this bug gets tickled.
Who can review and put this (or another) fix back? I can
put it back if that's approprate.
david
- duplicates
-
JDK-4051340 Dynamic link errors occur on a large number of JCK-111a tests.
-
- Closed
-