This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


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

shared lib problem on PPC (was: Re: glibc 2.1.92 tst-getdate failure on linuxppc)


On Sun, 20 Aug 2000, Ulrich Drepper wrote:
> Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:
> > Uhm, so _all_ of these fail on other platforms too? I'm asking cause
> > apache no longer starts up on glibc-cvs with this in the logs:
>
> With which version of glibc, which date?

Current development CVS as of yesterday. It fails because this testcase fails:

testshareddata.c:
#include <assert.h>
#include <dlfcn.h>
#include <errno.h>
#include <error.h>
#include <mcheck.h>
#include <stdio.h>
#include <stdlib.h>
 
typedef struct { void *next; } strct;
 
int main ()
{
   void *sohandle;
   strct *testdat;
   int ret;
 
   sohandle = dlopen("./shareddata.so", RTLD_NOW | RTLD_GLOBAL);
 
   testdat = dlsym(sohandle, "testdat");
   testdat->next = -1;
 
   ret = dlclose(sohandle);
 
   sohandle = dlopen("./shareddata.so", RTLD_NOW | RTLD_GLOBAL);
 
   testdat = dlsym(sohandle, "testdat");
   if (testdat->next == -1) abort();
 
   ret = dlclose(sohandle);
 
   return 0;
} 

and this is the shared object:

shareddata.c:
struct testdat {
   void *next;
} testdat;

Compile and run with:
  gcc -shared -O2 -fpic shareddata.c -o shareddata.so
  gcc -O2 -ldl testshareddata.c -o testshareddata
  ./testshareddata

This testcase aborts on PPC and apache uses a similar sequence during start, 
it tests testdat->next and doesn't correctly register the module if it is !=0.

Appended the readelf output for shareddata.so.

Franz.
ELF Header:
  Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, big endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           PowerPC
  Version:                           0x1
  Entry point address:               0x6d8
  Start of program headers:          52 (bytes into file)
  Start of section headers:          4316 (bytes into file)
  Flags:                             0x0
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         3
  Size of section headers:           40 (bytes)
  Number of section headers:         32
  Section header string table index: 29

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00       0   0 0
  [ 1] .hash             HASH            00000094 000094 000148 04   A   2   0 4
  [ 2] .dynsym           DYNSYM          000001dc 0001dc 0002b0 10   A   3  1d 4
  [ 3] .dynstr           STRTAB          0000048c 00048c 0000cf 00   A   0   0 1
  [ 4] .gnu.version      VERSYM          0000055c 00055c 000056 02   A   2   0 2
  [ 5] .gnu.version_r    VERNEED         000005b4 0005b4 000030 00   A   3   1 4
  [ 6] .rela.data        RELA            000005e4 0005e4 000018 0c   A   2   d 4
  [ 7] .rela.fixup       RELA            000005fc 0005fc 000018 0c   A   2   0 4
  [ 8] .rela.got2        RELA            00000614 000614 00006c 0c   A   2   f 4
  [ 9] .rela.plt         RELA            00000680 000680 000030 0c   A   2  17 4
  [10] .init             PROGBITS        000006b0 0006b0 000028 00  AX   0   0 4
  [11] .text             PROGBITS        000006d8 0006d8 0001e0 00  AX   0   0 4
  [12] .fini             PROGBITS        000008b8 0008b8 000020 00  AX   0   0 4
  [13] .data             PROGBITS        000108d8 0008d8 00000c 00  WA   0   0 4
  [14] .eh_frame         PROGBITS        000108e4 0008e4 000004 00  WA   0   0 4
  [15] .got2             PROGBITS        000108e8 0008e8 000024 00  WA   0   0 1
  [16] .ctors            PROGBITS        0001090c 00090c 000008 00  WA   0   0 4
  [17] .dtors            PROGBITS        00010914 000914 000008 00  WA   0   0 4
  [18] .got              PROGBITS        0001091c 00091c 000010 04  WA   0   0 4
  [19] .sdata2           PROGBITS        0001092c 00092c 000000 00   A   0   0 4
  [20] .dynamic          DYNAMIC         0001092c 00092c 000098 08  WA   3   0 4
  [21] .sdata            PROGBITS        000109c4 0009c4 000000 00  WA   0   0 4
  [22] .sbss             NOBITS          000109c4 0009c4 000004 00  WA   0   0 4
  [23] .plt              NOBITS          000109c8 0009c4 000078 00 WAX   0   0 4
  [24] .bss              NOBITS          00010a40 0009c4 000018 00  WA   0   0 4
  [25] .stab             PROGBITS        00000000 0009c4 000138 0c      26   0 4
  [26] .stabstr          STRTAB          00000000 000afc 000413 00       0   0 1
  [27] .comment          PROGBITS        00000000 000f0f 0000cd 00       0   0 1
  [28] .rela.stab        RELA            00000000 0015dc 000024 0c       2  19 4
  [29] .shstrtab         STRTAB          00000000 000fdc 0000ff 00       0   0 1
  [30] .symtab           SYMTAB          00000000 001600 000530 10      31  45 4
  [31] .strtab           STRTAB          00000000 001b30 0002cb 00       0   0 1
Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings)
              I (info), L (link order), O (extra OS processing required)
              o (os specific), p (processor specific) x (unknown)

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x00000000 0x00000000 0x008d8 0x008d8 R E 0x10000
  LOAD           0x0008d8 0x000108d8 0x000108d8 0x000ec 0x00180 RWE 0x10000
  DYNAMIC        0x00092c 0x0001092c 0x0001092c 0x00098 0x00098 RW  0x4

 Section to Segment mapping:
  Segment Sections...
   00     .hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.data .rela.fixup .rela.got2 .rela.plt .init .text .fini 
   01     .data .eh_frame .got2 .ctors .dtors .got .dynamic .sbss .plt .bss 
   02     .dynamic 

Dynamic segment at offset 0x92c contains 19 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000c (INIT)                       0x6b0
 0x0000000d (FINI)                       0x8b8
 0x00000004 (HASH)                       0x94
 0x00000005 (STRTAB)                     0x48c
 0x00000006 (SYMTAB)                     0x1dc
 0x0000000a (STRSZ)                      185 (bytes)
 0x0000000b (SYMENT)                     16 (bytes)
 0x00000003 (PLTGOT)                     0x109c8
 0x00000002 (PLTRELSZ)                   48 (bytes)
 0x00000014 (PLTREL)                     RELA
 0x00000017 (JMPREL)                     0x680
 0x00000007 (RELA)                       0x5e4
 0x00000008 (RELASZ)                     204 (bytes)
 0x00000009 (RELAENT)                    12 (bytes)
 0x6ffffffe (VERNEED)                    0x5b4
 0x6fffffff (VERNEEDNUM)                 1
 0x6ffffff0 (VERSYM)                     0x55c
 0x00000000 (NULL)                       0x0

Relocation section '.rela.data' at offset 0x5e4 contains 2 entries:
  Offset    Info  Type            Symbol's Value  Symbol's Name          Addend
  000108d8  00016 R_PPC_RELATIVE                                         000108d8
  000108dc  00016 R_PPC_RELATIVE                                         00010918

Relocation section '.rela.fixup' at offset 0x5fc contains 2 entries:
  Offset    Info  Type            Symbol's Value  Symbol's Name          Addend
  00000000  00000 R_PPC_NONE                                             00000000
  00000000  00000 R_PPC_NONE                                             00000000

Relocation section '.rela.got2' at offset 0x614 contains 9 entries:
  Offset    Info  Type            Symbol's Value  Symbol's Name          Addend
  000108e8  00016 R_PPC_RELATIVE                                         000108e0
  000108ec  02501 R_PPC_ADDR32          00000000  __cxa_finalize            + 0
  000108f0  00016 R_PPC_RELATIVE                                         000108d8
  000108f4  00016 R_PPC_RELATIVE                                         000108dc
  000108f8  02101 R_PPC_ADDR32          00000000  __deregister_frame_info   + 0
  000108fc  00016 R_PPC_RELATIVE                                         000108e4
  00010900  01e01 R_PPC_ADDR32          00000000  __register_frame_info     + 0
  00010904  00016 R_PPC_RELATIVE                                         00010a40
  00010908  00016 R_PPC_RELATIVE                                         00010910

Relocation section '.rela.plt' at offset 0x680 contains 4 entries:
  Offset    Info  Type            Symbol's Value  Symbol's Name          Addend
  00010a10  01e15 R_PPC_JMP_SLOT        00000000  __register_frame_info     + 0
  00010a18  02115 R_PPC_JMP_SLOT        00000000  __deregister_frame_info   + 0
  00010a20  02515 R_PPC_JMP_SLOT        00000000  __cxa_finalize            + 0
  00010a28  02a15 R_PPC_JMP_SLOT        000008ac  __gmon_start__            + 0

Relocation section '.rela.stab' at offset 0x15dc contains 3 entries:
  Offset    Info  Type            Symbol's Value  Symbol's Name          Addend
  00000014  00016 R_PPC_RELATIVE                                         00000828
  00000020  00016 R_PPC_RELATIVE                                         00000828
  00000134  00016 R_PPC_RELATIVE                                         00000828

Symbol table '.dynsym' contains 43 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000094     0 SECTION LOCAL  DEFAULT    1 
     2: 000001dc     0 SECTION LOCAL  DEFAULT    2 
     3: 0000048c     0 SECTION LOCAL  DEFAULT    3 
     4: 0000055c     0 SECTION LOCAL  DEFAULT    4 
     5: 000005b4     0 SECTION LOCAL  DEFAULT    5 
     6: 000005e4     0 SECTION LOCAL  DEFAULT    6 
     7: 000005fc     0 SECTION LOCAL  DEFAULT    7 
     8: 00000614     0 SECTION LOCAL  DEFAULT    8 
     9: 00000680     0 SECTION LOCAL  DEFAULT    9 
    10: 000006b0     0 SECTION LOCAL  DEFAULT   10 
    11: 000006d8     0 SECTION LOCAL  DEFAULT   11 
    12: 000008b8     0 SECTION LOCAL  DEFAULT   12 
    13: 000108d8     0 SECTION LOCAL  DEFAULT   13 
    14: 000108e4     0 SECTION LOCAL  DEFAULT   14 
    15: 000108e8     0 SECTION LOCAL  DEFAULT   15 
    16: 0001090c     0 SECTION LOCAL  DEFAULT   16 
    17: 00010914     0 SECTION LOCAL  DEFAULT   17 
    18: 0001091c     0 SECTION LOCAL  DEFAULT   18 
    19: 0001092c     0 SECTION LOCAL  DEFAULT   19 
    20: 0001092c     0 SECTION LOCAL  DEFAULT   20 
    21: 000109c4     0 SECTION LOCAL  DEFAULT   21 
    22: 000109c4     0 SECTION LOCAL  DEFAULT   22 
    23: 000109c8     0 SECTION LOCAL  DEFAULT   23 
    24: 00010a40     0 SECTION LOCAL  DEFAULT   24 
    25: 00000000     0 SECTION LOCAL  DEFAULT   25 
    26: 00000000     0 SECTION LOCAL  DEFAULT   26 
    27: 00000000     0 SECTION LOCAL  DEFAULT   27 
    28: 00000000     0 SECTION LOCAL  DEFAULT   28 
    29: 0001092c     0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC
    30: 00000000   156 FUNC    WEAK   DEFAULT  UND __register_frame_info@GLIBC_2.0 (2)
    31: 000109c4     4 OBJECT  GLOBAL DEFAULT   22 testdat
    32: 000006b0     0 FUNC    GLOBAL DEFAULT   10 _init
    33: 00000000   236 FUNC    WEAK   DEFAULT  UND __deregister_frame_info@GLIBC_2.0 (2)
    34: 000189c4     0 OBJECT  GLOBAL DEFAULT   21 _SDA_BASE_
    35: 000109c4     0 OBJECT  GLOBAL DEFAULT  ABS __bss_start
    36: 000008b8     0 FUNC    GLOBAL DEFAULT   12 _fini
    37: 00000000   224 FUNC    WEAK   DEFAULT  UND __cxa_finalize@GLIBC_2.1.3 (3)
    38: 000109c4     0 OBJECT  GLOBAL DEFAULT  ABS _edata
    39: 00010920     0 OBJECT  GLOBAL DEFAULT  ABS _GLOBAL_OFFSET_TABLE_
    40: 00010a58     0 OBJECT  GLOBAL DEFAULT  ABS _end
    41: 0001892c     0 OBJECT  GLOBAL DEFAULT   19 _SDA2_BASE_
    42: 000008ac     0 FUNC    WEAK   DEFAULT   11 __gmon_start__

Symbol table '.symtab' contains 83 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000094     0 SECTION LOCAL  DEFAULT    1 
     2: 000001dc     0 SECTION LOCAL  DEFAULT    2 
     3: 0000048c     0 SECTION LOCAL  DEFAULT    3 
     4: 0000055c     0 SECTION LOCAL  DEFAULT    4 
     5: 000005b4     0 SECTION LOCAL  DEFAULT    5 
     6: 000005e4     0 SECTION LOCAL  DEFAULT    6 
     7: 000005fc     0 SECTION LOCAL  DEFAULT    7 
     8: 00000614     0 SECTION LOCAL  DEFAULT    8 
     9: 00000680     0 SECTION LOCAL  DEFAULT    9 
    10: 000006b0     0 SECTION LOCAL  DEFAULT   10 
    11: 000006d8     0 SECTION LOCAL  DEFAULT   11 
    12: 000008b8     0 SECTION LOCAL  DEFAULT   12 
    13: 000108d8     0 SECTION LOCAL  DEFAULT   13 
    14: 000108e4     0 SECTION LOCAL  DEFAULT   14 
    15: 000108e8     0 SECTION LOCAL  DEFAULT   15 
    16: 0001090c     0 SECTION LOCAL  DEFAULT   16 
    17: 00010914     0 SECTION LOCAL  DEFAULT   17 
    18: 0001091c     0 SECTION LOCAL  DEFAULT   18 
    19: 0001092c     0 SECTION LOCAL  DEFAULT   19 
    20: 0001092c     0 SECTION LOCAL  DEFAULT   20 
    21: 000109c4     0 SECTION LOCAL  DEFAULT   21 
    22: 000109c4     0 SECTION LOCAL  DEFAULT   22 
    23: 000109c8     0 SECTION LOCAL  DEFAULT   23 
    24: 00010a40     0 SECTION LOCAL  DEFAULT   24 
    25: 00000000     0 SECTION LOCAL  DEFAULT   25 
    26: 00000000     0 SECTION LOCAL  DEFAULT   26 
    27: 00000000     0 SECTION LOCAL  DEFAULT   27 
    28: 00000000     0 SECTION LOCAL  DEFAULT   28 
    29: 00000000     0 SECTION LOCAL  DEFAULT   29 
    30: 00000000     0 SECTION LOCAL  DEFAULT   30 
    31: 00000000     0 SECTION LOCAL  DEFAULT   31 
    32: 00000000     0 FILE    LOCAL  DEFAULT  ABS /cvsx/rawhide/BUILD/glibc-2.1.92/build-ppc-linux/csu/crti.S
    33: 00000000     0 FILE    LOCAL  DEFAULT  ABS /cvsx/rawhide/BUILD/glibc-2.1.92/build-ppc-linux/csu/defs.h
    34: 00000000     0 FILE    LOCAL  DEFAULT  ABS initfini.c
    35: 00000000     0 FILE    LOCAL  DEFAULT  ABS /cvsx/rawhide/BUILD/glibc-2.1.92/build-ppc-linux/csu/crti.S
    36: 00000000     0 FILE    LOCAL  DEFAULT  ABS /cvsx/rawhide/BUILD/glibc-2.1.92/build-ppc-linux/config.h
    37: 00000000     0 FILE    LOCAL  DEFAULT  ABS /cvsx/rawhide/BUILD/glibc-2.1.92/build-ppc-linux/csu/crti.S
    38: 000006d8     0 NOTYPE  LOCAL  DEFAULT   11 gcc2_compiled.
    39: 00000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff.c
    40: 000006d8     0 NOTYPE  LOCAL  DEFAULT   11 gcc2_compiled.
    41: 000108dc     0 OBJECT  LOCAL  DEFAULT   13 p.0
    42: 00010914     0 OBJECT  LOCAL  DEFAULT   17 __DTOR_LIST__
    43: 000108e0     0 OBJECT  LOCAL  DEFAULT   13 completed.1
    44: 000108e4     0 OBJECT  LOCAL  DEFAULT   14 __EH_FRAME_BEGIN__
    45: 000006dc     0 FUNC    LOCAL  DEFAULT   11 __do_global_dtors_aux
    46: 000007a0     0 FUNC    LOCAL  DEFAULT   11 fini_dummy
    47: 00010a40    24 NOTYPE  LOCAL  DEFAULT   24 object.2
    48: 000007c0     0 FUNC    LOCAL  DEFAULT   11 frame_dummy
    49: 0000080c     0 FUNC    LOCAL  DEFAULT   11 init_dummy
    50: 000108e4     0 OBJECT  LOCAL  DEFAULT   13 force_to_data
    51: 0001090c     0 OBJECT  LOCAL  DEFAULT   16 __CTOR_LIST__
    52: 00000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff.c
    53: 00000828     0 NOTYPE  LOCAL  DEFAULT   11 gcc2_compiled.
    54: 00010910     0 OBJECT  LOCAL  DEFAULT   16 __CTOR_END__
    55: 0000082c     0 FUNC    LOCAL  DEFAULT   11 __do_global_ctors_aux
    56: 00000890     0 FUNC    LOCAL  DEFAULT   11 init_dummy
    57: 000108e4     0 OBJECT  LOCAL  DEFAULT   13 force_to_data
    58: 00010918     0 OBJECT  LOCAL  DEFAULT   17 __DTOR_END__
    59: 000108e4     0 OBJECT  LOCAL  DEFAULT   14 __FRAME_END__
    60: 00000000     0 FILE    LOCAL  DEFAULT  ABS /cvsx/rawhide/BUILD/glibc-2.1.92/build-ppc-linux/csu/crtn.S
    61: 00000000     0 FILE    LOCAL  DEFAULT  ABS /cvsx/rawhide/BUILD/glibc-2.1.92/build-ppc-linux/csu/defs.h
    62: 00000000     0 FILE    LOCAL  DEFAULT  ABS initfini.c
    63: 00000000     0 FILE    LOCAL  DEFAULT  ABS /cvsx/rawhide/BUILD/glibc-2.1.92/build-ppc-linux/csu/crtn.S
    64: 00000000     0 FILE    LOCAL  DEFAULT  ABS /cvsx/rawhide/BUILD/glibc-2.1.92/build-ppc-linux/config.h
    65: 00000000     0 FILE    LOCAL  DEFAULT  ABS /cvsx/rawhide/BUILD/glibc-2.1.92/build-ppc-linux/csu/crtn.S
    66: 000008ac     0 NOTYPE  LOCAL  DEFAULT   11 gcc2_compiled.
    67: 00000000     0 FILE    LOCAL  DEFAULT  ABS shareddata.c
    68: 000108d8     0 OBJECT  LOCAL  HIDDEN   13 __dso_handle
    69: 0001092c     0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC
    70: 00000000   156 FUNC    WEAK   DEFAULT  UND __register_frame_info@@GLIBC_2.0
    71: 000109c4     4 OBJECT  GLOBAL DEFAULT   22 testdat
    72: 000006b0     0 FUNC    GLOBAL DEFAULT   10 _init
    73: 00000000   236 FUNC    WEAK   DEFAULT  UND __deregister_frame_info@@GLIBC_2.0
    74: 000189c4     0 OBJECT  GLOBAL DEFAULT   21 _SDA_BASE_
    75: 000109c4     0 OBJECT  GLOBAL DEFAULT  ABS __bss_start
    76: 000008b8     0 FUNC    GLOBAL DEFAULT   12 _fini
    77: 00000000   224 FUNC    WEAK   DEFAULT  UND __cxa_finalize@@GLIBC_2.1.3
    78: 000109c4     0 OBJECT  GLOBAL DEFAULT  ABS _edata
    79: 00010920     0 OBJECT  GLOBAL DEFAULT  ABS _GLOBAL_OFFSET_TABLE_
    80: 00010a58     0 OBJECT  GLOBAL DEFAULT  ABS _end
    81: 0001892c     0 OBJECT  GLOBAL DEFAULT   19 _SDA2_BASE_
    82: 000008ac     0 FUNC    WEAK   DEFAULT   11 __gmon_start__

Histogram for bucket list length (total of 37 buckets):
 Length  Number     % of total  Coverage
      0  24         ( 64.9%)
      1  12         ( 32.4%)     85.7%
      2  1          (  2.7%)    100.0%

Version symbols section '.gnu.version' contains 43 entries:
 Addr: 000000000000055c  Offset: 0x00055c  Link: 2 (.dynsym)
  000:   0 (*local*)       0 (*local*)       0 (*local*)       0 (*local*)    
  004:   0 (*local*)       0 (*local*)       0 (*local*)       0 (*local*)    
  008:   0 (*local*)       0 (*local*)       0 (*local*)       0 (*local*)    
  00c:   0 (*local*)       0 (*local*)       0 (*local*)       0 (*local*)    
  010:   0 (*local*)       0 (*local*)       0 (*local*)       0 (*local*)    
  014:   0 (*local*)       0 (*local*)       0 (*local*)       0 (*local*)    
  018:   0 (*local*)       0 (*local*)       0 (*local*)       0 (*local*)    
  01c:   0 (*local*)       1 (*global*)      2 (GLIBC_2.0)     1 (*global*)   
  020:   1 (*global*)      2 (GLIBC_2.0)     1 (*global*)      1 (*global*)   
  024:   1 (*global*)      3 (GLIBC_2.1.3)   1 (*global*)      1 (*global*)   
  028:   1 (*global*)      1 (*global*)      1 (*global*)   

Version needs section '.gnu.version_r' contains 1 entries:
 Addr: 0x00000000000005b4  Offset: 0x0005b4  Link to section: 3 (.dynstr)
  000000: Version: 1  File: libc.so.6  Cnt: 2
  0x0010: Name: GLIBC_2.1.3  Flags: none  Version: 3
  0x0020: Name: GLIBC_2.0  Flags: none  Version: 2

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