From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 5223 invoked from network); 6 Aug 1998 13:03:06 -0000 Received: from stefan.sime.com (193.228.80.247) by mail2.redhat.com with SMTP; 6 Aug 1998 13:03:06 -0000 Received: (from stefan@localhost) by stefan.sime.com (8.8.7/8.8.7) id OAA00370; Thu, 6 Aug 1998 14:59:42 +0200 Date: Thu, 6 Aug 1998 14:59:42 +0200 Message-Id: <199808061259.OAA00370@stefan.sime.com> From: Quant-X Alpha Linux Support To: Eric Ding CC: axp-list@redhat.com In-reply-to: (message from Eric Ding on 05 Aug 1998 22:38:32 -0400) Subject: Re: BUG: probs with resolving functions in shared library MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: Quant-X Alpha Linux Support Reply-To: Quant-X Alpha Linux Support Organization: Quant-X Service & Consulting Ges.m.b.H. X-Mailer: GNU Emacs 20.2.1 C-x m (X11 ; I; Linux 2.1.113 i586) References: <199808052248.AAA01063@stefan.sime.com> Hi Eric ! > thanks for the tip; unfortunately, we *do* need to use the -export-dynamic > flag with our main executable, so this helps but doesn't solve the problem > sufficiently to get Applixware for Linux/Alpha any closer to running. :) I think the problem is in your head. ;-} The solution is easy (correct me if not...). You only must make shure that the main program does **not** need -export-dynamic. That's really easy (at least here, maybe not for you...) a) make the main-program a shared library (this step needs (here) no code changes, only affects linking stage). b) use a stub (linked without -export-dynamic) to start the main program (library). c) run the stub. Here a sample stub: /* start stub.c */ #include #include int main(int argc, char **argv) { void *handle; int (*real_main)(int, char **); int rc; if((handle = dlopen("./libapplix.so", RTLD_NOW)) == NULL) { fprintf(stderr, "error dlopen: %s\n", dlerror()); exit(1); } if((real_main = dlsym(handle, "main")) == NULL) { fprintf(stderr, "error dlsym: %s\n", dlerror()); exit(1); } rc = (*real_main)(argc, argv); dlclose(handle); return(rc); } /* end stub.c */ Hope it helps (maybe this time...) > > Eric > > Quant-X Alpha Linux Support writes: > > > I don't know if it helps: > > > > ld -shared -Bdynamic --noinhibit-exec -o libtest2.so test2.o test3.o > > > > works here as expected. (The difference is only that I'm using > > -Bdynamic instead of -Bsymbolic) > > > > It is a bug. But ok so. > > If you want -Bdynamic work as the specs say, you need to compile the main > > program (!) with -Xlinker -export-dynamic. If you do this, you > > get the "OOPS!". > -- > Software Development Engineer / ericding@applix.com <>< > Applix, Inc. / 112 Turnpike Road / Westboro MA 01581-2842 > TEL: (508) 870-0300 x284 / FAX: (508) 366-4873 > > -- > To unsubscribe: send e-mail to axp-list-request@redhat.com with > 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com > ciao - Stefan -- Quant-X Service & Ph: (+43) 4212 6004-0 Consulting Ges.m.b.H. Fax: (+43) 4212 600420 http://www.quant-x.com Email: support@quant-x.com