[csw-users] 64bit g++ 4.7.2 exception handling ...

Dmitri Shubin sbn at tbricks.com
Thu Mar 21 11:32:37 CET 2013


On 03/21/13 14:06, James Lee wrote:
> $ truss ./a.out 2>&1 | egrep 'open.*(libc|libgcc)'
> open("/opt/XXXX/lib/64/libgcc_s.so.1", O_RDONLY) = 3
> open("/lib/64/libc.so.1", O_RDONLY)             = 3
>
> I'm opening libc second.

Well, same for me:

$ ls /cores
$ truss ./a-4.7 2>&1 | egrep 'open.*(libc|libgcc)'
open("/opt/csw/lib/64/libgcc_s.so.1", O_RDONLY) = 3
open("/lib/64/libc.so.1", O_RDONLY)             = 3
$ ls /cores/
a-4.7.18296
$

I have self-built GCC-4.8 that doesn't have this problem.
Checking libstdc++ there and from /opt/csw/lib/amd64

$ elfdump -d /opt/csw/lib/amd64/libstdc++.so

Dynamic Section:  .dynamic
      index  tag                value
        [0]  POSFLAG_1         0x1                 [ LAZY ]
        [1]  NEEDED            0x26bb7             libm.so.2
        [2]  NEEDED            0x26bca             libc.so.1
        [3]  POSFLAG_1         0x1                 [ LAZY ]
        [4]  NEEDED            0x26c1f             libgcc_s.so.1
        [5]  INIT              0xd71a0
        [6]  FINI              0xd71b0
        [7]  SONAME            0x26ba8             libstdc++.so.6
        [8]  RUNPATH           0x26c47 /opt/csw/lib/$ISALIST:/opt/csw/lib
        [9]  RPATH             0x26c47 /opt/csw/lib/$ISALIST:/opt/csw/lib
       [10]  HASH              0x213b8
       [11]  STRTAB            0x3eac0
       [12]  STRSZ             0x26e6a
       [13]  SYMTAB            0x28980
       [14]  SYMENT            0x18
       [15]  CHECKSUM          0x3572
       [16]  VERDEF            0x65a10
       [17]  VERDEFNUM         0x1b
       [18]  VERNEED           0x65930
       [19]  VERNEEDNUM        0x3
       [20]  RELACOUNT         0x23c
       [21]  PLTRELSZ          0x4098
       [22]  PLTREL            0x7
       [23]  JMPREL            0x777f0
       [24]  RELA              0x67b30
       [25]  RELASZ            0x13d58
       [26]  RELAENT           0x18
       [27]  SYMINFO           0x1d8d8
       [28]  SYMINSZ           0x3ae0
       [29]  SYMINENT          0x4
       [30]  FLAGS             0                   0
       [31]  FLAGS_1           0                   0
       [32]  SUNW_STRPAD       0x200
       [33]  SUNW_LDMACH       0x3e                EM_AMD64
       [34]  PLTGOT            0x10f070
    [35-45]  NULL              0

$ elfdump -d /opt/gcc-4.8/lib/amd64/libstdc++.so

Dynamic Section:  .dynamic
      index  tag                value
        [0]  NEEDED            0x26d9f             libm.so.2
        [1]  NEEDED            0x26dbb             libc.so.1
        [2]  NEEDED            0x26dfb             libgcc_s.so.1
        [3]  INIT              0xd2b40
        [4]  FINI              0xd2b50
        [5]  SONAME            0x26d90             libstdc++.so.6
        [6]  HASH              0x1e0a0
        [7]  STRTAB            0x3b9d0
        [8]  STRSZ             0x27023
        [9]  SYMTAB            0x25710
       [10]  SYMENT            0x18
       [11]  CHECKSUM          0xf96f
       [12]  VERDEF            0x62ad8
       [13]  VERDEFNUM         0x1d
       [14]  VERNEED           0x629f8
       [15]  VERNEEDNUM        0x3
       [16]  RELACOUNT         0x230
       [17]  PLTRELSZ          0x3d68
       [18]  PLTREL            0x7
       [19]  JMPREL            0x74830
       [20]  RELA              0x64c60
       [21]  RELASZ            0x13938
       [22]  RELAENT           0x18
       [23]  FLAGS             0                   0
       [24]  FLAGS_1           0                   0
       [25]  SUNW_STRPAD       0x200
       [26]  SUNW_LDMACH       0x3e                EM_AMD64
       [27]  PLTGOT            0x10b710
    [28-38]  NULL              0

I.e. no LAZY for libm.so.1 and libgcc_s.so.1 and no RPATH/RUNPATH set.


More information about the users mailing list