| From | Sent On | Attachments |
|---|---|---|
| Brian Feldman | Sep 1, 1998 4:33 am | .c |
| John Polstra | Sep 1, 1998 10:21 am | |
| John Polstra | Sep 1, 1998 11:01 am | |
| Doug Rabson | Sep 1, 1998 11:12 am | |
| Brian Feldman | Sep 1, 1998 12:20 pm | |
| Mike Smith | Sep 1, 1998 2:23 pm | |
| Chuck Robey | Sep 1, 1998 2:34 pm | |
| Mike Smith | Sep 1, 1998 2:46 pm | |
| John Polstra | Sep 1, 1998 4:29 pm | |
| Brian Feldman | Sep 1, 1998 4:55 pm | |
| John Polstra | Sep 1, 1998 6:17 pm | |
| John Polstra | Sep 1, 1998 6:24 pm | |
| Joel Ray Holveck | Sep 1, 1998 8:22 pm | |
| John Polstra | Sep 1, 1998 9:35 pm | |
| Terry Lambert | Sep 2, 1998 12:09 am | |
| Doug Rabson | Sep 2, 1998 12:32 am | |
| Terry Lambert | Sep 2, 1998 12:58 am | |
| Mike Smith | Sep 2, 1998 2:33 am | |
| John Polstra | Sep 2, 1998 8:45 am | |
| John Polstra | Sep 2, 1998 8:49 am | |
| Brian Cully | Sep 2, 1998 11:54 am | |
| Brian Feldman | Sep 2, 1998 12:13 pm | |
| Mark Murray | Sep 2, 1998 12:16 pm | |
| Joel Ray Holveck | Sep 2, 1998 4:01 pm | |
| Mike Smith | Sep 2, 1998 6:04 pm | |
| Doug Rabson | Sep 3, 1998 12:49 am | |
| John Polstra | Sep 3, 1998 8:46 am |
| Subject: | Re: E-day problems: rtld-elf dlsym() broken? | |
|---|---|---|
| From: | John Polstra (jd...@polstra.com) | |
| Date: | Sep 1, 1998 6:17:26 pm | |
| List: | org.freebsd.freebsd-current | |
OK, I believe I've fixed this in src/libexec/rtld-elf/rtld.c revision 1.4. It now does what the documentation says it does. Namely:
dlopen(NULL, ...)
returns a handle which, if passed to dlsym(), will cause the main executable and all of its needed shared objects to be searched for the symbol.
And:
dlsym(NULL, ...)
will search for the symbol in the caller's shared object. N.B., that's the caller's shared object _only_. It doesn't include any needed shared objects.
Also, your particular test case of trying to look up "main" still isn't going to work. The reason is that ELF doesn't put "main" into the dynamic symbol table, because it's not needed there. If you are looking up symbols defined in shared libraries or called from shared libraries, it should work fine. But symbols in the main executable that don't meet those criteria probably won't be found.
There is a linker option "-E" that puts all global symbols into the dynamic symbol table. That will cause it to do what you want. But of course you have to specify it when you're building the program (LDFLAGS+=-Wl,-E).
John
-- John Polstra jd...@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth
To Unsubscribe: send mail to majo...@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message






.c