This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: G++ shared object under AIX 4.1.4


Andrey,

I followed your instructions except that I could only find /usr/lib/libsvld.a on
AIX 4.1.4 so I used that ld library instead.  It appears to provide similar
functionality.  It produces some debug output if you set an environment variable.
Actually, the svld library is automatically used by the svld command (a superset
of 'ld').  I'm curious if collect2 operates compatibly with svld or libsvld.a.

libtcl8.0.a is a C library so I don't understand why the duplicate
__builtin_delete occurs, but I'm looking into it.

Andrey Slepuhin wrote:

> Hi Desmond,
> To check whether dlopen works correctly, please try the following
> program, replacing <your_path> by actual example.so path
>
> --------------- test.cc ------------------------------
> #include <dlfcn.h>
> #include <iostream>
>
> void main ()
> {
>   void* ptr=dlopen("<your_path>/example.so",RTLD_NOW);
>   if (ptr==NULL) cout<<dlerror()<<endl;
> }
> ------------------------------------------------------
> g++ -o test test.cc -ldl
> ./test

I used a main.cpp to avoid a name collision elsewhere.

./g++ -o main main.cpp -lsvld
737> link++> ./main
dlopen(): access failure: permissions denied (errno = EACCES)

Next, I set
 % setenv SVLDRTDEBUG <my_path>
 % g++ -o main main.cpp -lsvld
% ./main
dlopen(): access failure: permissions denied (errno = EACCES)

This also produces a 72k file called <my_path>/svld.<user>.<process> (I believe).

Desmond

Here is the file:

SLHS/6000 RTE 1.16/Built on May  5 1998
Running with flags = 0x00000001
_svld_main: Initial Dump of ExecInfo Structure
--------| Dump of ExecInfo _EI Structure
        *_TCsymHtable = 0x00000000
        _TCsymHTSize  = 0
        *TCbuf        = 0x00000000
        nextTCsym     = 0
        _TCsymHTcollisions = 0
        _TCsymHTprobes =        0
        *_RelocHtable = 0x00000000
        _RelocHTSize  = 0
        *execObjs     = 0x00000000
        nExecObjs     = 0
        *_svldLoadInfo    = 0x00000000
        _svldLoadInfoSize = 4096

loadquery(L_GETINFO,0x20003cf8,4096)
Setting "main" as "main()"
  Looking for "libsvld.a"
  Looking for "libsvld.a"
    Found "libsvld.a" as "/usr/lib/libsvld.a(dl.so)"
  Looking for "libsvld.a"
    Found "libsvld.a" as "/usr/lib/libsvld.a(shr.o)"
  Looking for "libsvld.a"
Checking /usr/lib/libc.a (d0000380/f0149088)
Comparing __DYNAMIC and '_C_locale'
Comparing __DYNAMIC and '__lc_time'
Comparing __DYNAMIC and '__lc_resp'
Comparing __DYNAMIC and '_NLesctab'
Comparing __DYNAMIC and '_jctype1_'
Comparing __DYNAMIC and '_jctype0_'
Comparing __DYNAMIC and '__realloc'
Comparing __DYNAMIC and '_doprnt64'
Comparing __DYNAMIC and '__scanf64'
Comparing __DYNAMIC and '_getpwent'
Comparing __DYNAMIC and '__lc_load'
Comparing __DYNAMIC and '_getshort'
Comparing __DYNAMIC and '_NCgetbuf'
  Looking for "unix"
  Looking for "unix"
  Looking for "unix"
  Looking for "unix"
Checking /usr/lib/libsvld.a (d0157240/f02d3528)
  Looking for "libsvld.a"
  Looking for "libsvld.a"
    Found "libsvld.a" as "/usr/lib/libsvld.a(dl.so)"
      Already loaded
  Looking for "libsvld.a"
    Found "libsvld.a" as "/usr/lib/libsvld.a(shr.o)"
      Already loaded
  Looking for "libsvld.a"
Checking /usr/lib/libsvld.a (d03200b0/f02d16b0)
Relocation Info --- main()
Relocation Info --- /usr/lib/libc.a(shr.o)
  DEFER: f017a1a4 -> 0008708c  __crypt
  DEFER: f017a1a8 -> 0008708c  __setkey
  DEFER: f017a1ac -> 0008708c  __encrypt
Relocation Info --- /usr/lib/libsvld.a(dl.so)
Relocation Info --- /usr/lib/libsvld.a(shr.o)
  DEFER: f02d26cc -> 0008708c  main
  DEFER: f02d26d4 -> 0008708c  _svldBogusFN
  DEFER: f02d26d8 -> ffffffff  _svldBogusData

_svld_main: Dump object array -- final results

--------| Dump of execObjs orderInfo
        execObjs=0x20004f28 nExecObjs=4 maxExecObjs=8
[  0]:  dynInfo=0x20004f28
                flags=0x00000002
                 name=main
        member=0x00000000
        info=0x20004dd8
                filename=main
                ld_info next=0x00000020
[  1]:  dynInfo=0x20004f50
                flags=0x00000002
                 name=libc.a
        member=0x20004e90       shr.o
        info=0x20004e68
                filename=/usr/lib/libc.a
                ld_info next=0x00000000
[  2]:  dynInfo=0x20004f78
                flags=0x00000002
                 name=libsvld.a
        member=0x20004ed3       dl.so
        info=0x20004ea8
                filename=/usr/lib/libsvld.a
                ld_info next=0x00000034
[  3]:  dynInfo=0x20004fa0
                flags=0x00000002
                 name=libsvld.a
        member=0x20004f13       shr.o
        info=0x20004ee8
                filename=/usr/lib/libsvld.a
                ld_info next=0x00000034

_svld_main: Final object list results (in order):
  [  0] main    loaded: main()
  [  1] libc.a  loaded: /usr/lib/libc.a(shr.o)
  [  2] libsvld.a       loaded: /usr/lib/libsvld.a(dl.so)
  [  3] libsvld.a       loaded: /usr/lib/libsvld.a(shr.o)

_svld_main: Final object list results (in order):
  [  0] main    loaded: main()
  [  1] libc.a  loaded: /usr/lib/libc.a(shr.o)
  [  2] libsvld.a       loaded: /usr/lib/libsvld.a(dl.so)
  [  3] libsvld.a       loaded: /usr/lib/libsvld.a(shr.o)

svld_main: Perform loadbind() resolution(in list order):
  Resolving libc.a(shr.o)
        ...against libsvld.a(dl.so)
        ...against libsvld.a(shr.o)
  Resolving libsvld.a(shr.o)

svld_main: Perform opposite resolution (in list order):
  Resolving libc.a(shr.o) against main()
  Resolving libsvld.a(shr.o) against main()
  Resolving libsvld.a(shr.o) against libc.a(shr.o)
  Resolving libsvld.a(shr.o) against libsvld.a(dl.so)

_svld_main: Ready to perform Symbol Resolution fixup
        Dump of the ExecInfo structure
--------| Dump of ExecInfo _EI Structure
        *_TCsymHtable = 0x00000000
        _TCsymHTSize  = 0
        *TCbuf        = 0x00000000
        nextTCsym     = 0
        _TCsymHTcollisions = 0
        _TCsymHTprobes =        0
        *_RelocHtable = 0x00000000
        _RelocHTSize  = 0
        *execObjs     = 0x20004f28
        nExecObjs     = 4
        *_svldLoadInfo    = 0x20003cf8
        _svldLoadInfoSize = 4096


_svld_main: Perform Symbol Resolution fixup

  _svldFindTCandADSymbols:
  hash table size is 2039
  total # of symbols is 1598
------------------------------------------------
| examining main
| LD
|       nextOff =  0x00000020
|       fpOrfd =   02546600
|       textorg =  0x10000000
|       textsize = 00757413
|       dataorg =  0x2000028A
|       datasize = 00006286
|
| LOADER SECTION
|       faddr =  0x10000000
|       fptr =   0x00026948
|       ver =    1
|       #syms =  37
|       #reloc = 994
|       impLen = 196
|       #impId = 3
|       impOff = 0x00003230
|       strLen = 39
|       strOff = 13044


------------------------------------------------
| examining /usr/lib/libc.a(shr.o)
| LD
|       nextOff =  0x00000000
|       fpOrfd =   02490488
|       textorg =  0xD0000380
|       textsize = 01008982
|       dataorg =  0xF0149088
|       datasize = 00339440
|
| LOADER SECTION
|       faddr =  0xD0000380
|       fptr =   0x000DB5C0
|       ver =    1
|       #syms =  1484
|       #reloc = 5443
|       impLen = 24
|       #impId = 2
|       impOff = 0x00018A64
|       strLen = 9498
|       strOff = 100988


------------------------------------------------
| examining /usr/lib/libsvld.a(dl.so)
| LD
|       nextOff =  0x00000034
|       fpOrfd =   02557304
|       textorg =  0xD0157240
|       textsize = 00001428
|       dataorg =  0xF02D3528
|       datasize = 00000164
|
| LOADER SECTION
|       faddr =  0xD0157240
|       fptr =   0x0000038C
|       ver =    1
|       #syms =  8
|       #reloc = 15
|       impLen = 33
|       #impId = 2
|       impOff = 0x00000194
|       strLen = 83
|       strOff = 437


------------------------------------------------
| examining /usr/lib/libsvld.a(shr.o)
| LD
|       nextOff =  0x00000034
|       fpOrfd =   02557160
|       textorg =  0xD03200B0
|       textsize = 00102697
|       dataorg =  0xF02D16B0
|       datasize = 00004336
|
| LOADER SECTION
|       faddr =  0xD03200B0
|       fptr =   0x00017800
|       ver =    1
|       #syms =  69
|       #reloc = 371
|       impLen = 30
|       #impId = 2
|       impOff = 0x000017FC
|       strLen = 271
|       strOff = 6170


svldFindTCandADSymbols: Dump Symbol Tables
svldFindTCandADSymbols: End Dump Symbol Tables
svldFindTCandADSymbols: Find imports for adjustment

svldFindTCandADSymbols: ? ? ? -
TCbuf[     0]:  0x20004E68       -1<- (  7) _stdbuf

<1251 symbols OMITTED:  None of my symbols occur in this table -- DAK>
. . .

_svldUpdateAllTCandADSymbols:
Total # of collisions = 0
Total # of probes = 0

_svld_main: Dump Symbol Tables
_svld_main: End Dump Symbol Tables
Relocation Info --- /usr/lib/libc.a(shr.o)
  DEFER: f017a1a4 -> 0008708c  __crypt
  DEFER: f017a1a8 -> 0008708c  __setkey
  DEFER: f017a1ac -> 0008708c  __encrypt
Relocation Info --- /usr/lib/libsvld.a(shr.o)
  DEFER: f02d26cc -> 0008708c  main
  DEFER: f02d26d4 -> 0008708c  _svldBogusFN
  DEFER: f02d26d8 -> ffffffff  _svldBogusData

_svld_main: Build the dl objects.
dlopenObject( /usr/lib/libsvld.a ):
        loading '/usr/lib/libsvld.a'
        Entry point at 0xf02d16b0
        loader info at 0x20004e28
        next dependant at 0x00000000
dlopenObject( /usr/lib/libsvld.a ):
        loading '/usr/lib/libsvld.a'
        Entry point at 0xf02d3528
        loader info at 0x20016648
        next dependant at 0x00000001
dlopenObject( /usr/lib/libc.a ):
        loading '/usr/lib/libc.a'
        Entry point at 0xf0149088
        loader info at 0x200166d8
        next dependant at 0x00000002
dlopenObject( main ):
        loading 'main'
        Entry point at 0x20000a08
        loader info at 0x20016768
        next dependant at 0x00000003
dlopenSetMainObject(): main application starts at 0x00000004
_svld_main: Processing complete - returning to caller
loadquery(L_GETINFO,0x200167c8,4096)
Error was: Permission denied
Could not load program dlopen()
Could not load library []
System error - error data is: .
dlclose() on main
  terminating main
  terminating /usr/lib/libc.a
Comparing _fini and '_exit'
Comparing _fini and '_load'
Comparing _fini and '_ud23'
  terminating /usr/lib/libsvld.a
  terminating /usr/lib/libsvld.a



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]