public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Confused by Multilib on AIX
@ 1998-10-08  7:28 Frank Pilhofer
  1998-10-08 22:06 ` David Edelsohn
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Pilhofer @ 1998-10-08  7:28 UTC (permalink / raw)
  To: egcs

  Hi,

 I have run into problems with egcs 1.1a's libstdc++ on the
rs6000-ibm-aix4.2.1.0 architecture. I am fooling around with
shared libraries.

 egcs installs 6 versions of libstdc++:

  ./libstdc++.so
  ./soft-float/libstdc++.so
  ./soft-float/power/libstdc++.so
  ./soft-float/powerpc/libstdc++.so
  ./power/libstdc++.so
  ./powerpc/libstdc++.so

 My problem is that these libraries refuse to load at runtime. If you
want to dynamically load a module that is linked against one of the
afore-mentioned libstdc++ versions into a main program that is *not*
linked against libstdc++ (meaning that libstdc++ is supposed to be
loaded at runtime), dlopen() reports "Exec format error."
 The same happens when you try to dlopen() libstdc++ directly.

 Any solution?

	Frank

-- 
 + Frank Pilhofer                        fp@informatik.uni-frankfurt.de  +
 |                                      http://www.uni-frankfurt.de/~fp/ |
 +---- Life would be a very great deal less weird without you.  - DA ----+


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Confused by Multilib on AIX
  1998-10-08  7:28 Confused by Multilib on AIX Frank Pilhofer
@ 1998-10-08 22:06 ` David Edelsohn
  1998-10-09 10:40   ` Frank Pilhofer
  0 siblings, 1 reply; 4+ messages in thread
From: David Edelsohn @ 1998-10-08 22:06 UTC (permalink / raw)
  To: Frank Pilhofer; +Cc: egcs

>>>>> Frank Pilhofer writes:

Frank> My problem is that these libraries refuse to load at runtime. If you
Frank> want to dynamically load a module that is linked against one of the
Frank> afore-mentioned libstdc++ versions into a main program that is *not*
Frank> linked against libstdc++ (meaning that libstdc++ is supposed to be
Frank> loaded at runtime), dlopen() reports "Exec format error."
Frank> The same happens when you try to dlopen() libstdc++ directly.

	One thing that comes to mind is this is AIX, not Solaris.  AIX's
original runtime loading functionality is supplied by the load() system
call, not dlopen().  I thought that dlopen() was suppose to work with
shared objects, but maybe it requires additional / different shared
library linking options.  Have you used the AIX "dump" command to inspect
the shared object to see what it contains?

David


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Confused by Multilib on AIX
  1998-10-08 22:06 ` David Edelsohn
@ 1998-10-09 10:40   ` Frank Pilhofer
  1998-10-09 18:23     ` David Edelsohn
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Pilhofer @ 1998-10-09 10:40 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Frank Pilhofer, egcs

On Fri, Oct 09, 1998 at 01:06:32AM -0400, David Edelsohn wrote:
>
>                      I thought that dlopen() was suppose to work with
> shared objects, but maybe it requires additional / different shared
> library linking options.
>

 Well, dlopen() works fine on my own shared objects (created with
gcc -shared), as long as they don't depend on libstdc++. I have
tried linking the main program and the module with `-Wl,-brtl'
(which is supposedly necessary to invoke the runtime linker), but
that didn't change anything.
 I have also re-linked libstdc++ from egcs's source directory with
  g++ -v -nostdlib -Wl,-brtl -shared -o libstdc++.so \
    `cat piclist` -lgcc -lm -lc
 but that didn't work either. The resulting shared library can be
linked against, but not be loaded at runtime. This is puzzling.

>
>                 Have you used the AIX "dump" command to inspect
> the shared object to see what it contains?
>

 I am not very familiar with dump. I know about `dump -H', which
shows a file's dependencies on shared libraries. It reports:

dump -H main   (the main program that wants to load the module)

                        ***Import File Strings***
INDEX  PATH                          BASE                MEMBER              
0      /local/pkg/egcs/1.1a/IBMrisc/lib/gcc-lib/powerpc-ibm-aix4.2.0.0/egcs-2.91.57:/local/pkg/egcs/1.1a/IBMrisc/powerpc-ibm-aix4.2.0.0/lib:/local/pkg/egcs/1.1a/IBMrisc/lib:/usr/lib:/lib                                         
1                                    libdl.a             shr.o               
2                                    libc.a              shr.o               
3                                    librtl.a            shr.o               
4                                    .                                       


dump -H module.so   (the module that refuses to load)

                        ***Import File Strings***
INDEX  PATH                          BASE                MEMBER              
0      /local/pkg/egcs/1.1a/IBMrisc/lib/gcc-lib/powerpc-ibm-aix4.2.0.0/egcs-2.91.57:/local/pkg/egcs/1.1a/IBMrisc/powerpc-ibm-aix4.2.0.0/lib:/local/pkg/egcs/1.1a/IBMrisc/lib:/usr/lib:/lib                                         
1                                    libstdc++.so                            
2                                    libc.a              shr.o               
3                                    librtl.a            shr.o               
4                                    .                                       


dump -H /local/pkg/egcs/1.1a/IBMrisc/lib/libstdc++.so

                        ***Import File Strings***
INDEX  PATH                          BASE                MEMBER              
0      /local/pkg/egcs/1.1a/egcs-1.1a/obj-IBMrisc/gcc:/usr/lib:/lib
1                                    libc.a              shr.o               
2                                    .                                       

	Frank


-- 
 + Frank Pilhofer                        fp@informatik.uni-frankfurt.de  +
 |                                      http://www.uni-frankfurt.de/~fp/ |
 +---- Life would be a very great deal less weird without you.  - DA ----+


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Confused by Multilib on AIX
  1998-10-09 10:40   ` Frank Pilhofer
@ 1998-10-09 18:23     ` David Edelsohn
  0 siblings, 0 replies; 4+ messages in thread
From: David Edelsohn @ 1998-10-09 18:23 UTC (permalink / raw)
  To: Frank Pilhofer; +Cc: egcs

>>>>> Frank Pilhofer writes:

Frank> Well, dlopen() works fine on my own shared objects (created with
Frank> gcc -shared), as long as they don't depend on libstdc++. 
Frank> dlopen() reports "Exec format error."

	I presume that dlopen() is setting errno to "ENOEXEC".  I think
that you need to use the dlerror() function immedaitely after the dlopen()
call failure to determine what the runtime loader really thinks is wrong.

	See the dlopen() and dlerror() documentation.  dlerror()
specifically provides further information for ENOEXEC errors from dlopen().

David

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1998-10-09 18:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-10-08  7:28 Confused by Multilib on AIX Frank Pilhofer
1998-10-08 22:06 ` David Edelsohn
1998-10-09 10:40   ` Frank Pilhofer
1998-10-09 18:23     ` David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).