This is the mail archive of the glibc-bugs@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]
Other format: [Raw text]

[Bug libc/639] New: VDSO with 1 LOAD entry fails on PPC32


First it seems that glibc is expecting a (fairly normal) DSO image including 
two (2) LOAD entries in the program header. The current powerpc64 kernel vdso 
images (both 32- and 64-bit) only contain one (1) LOAD entry:

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x00100000 0x00100000 0x00e10 0x00e10 R E 
0x10000
  DYNAMIC        0x000d98 0x00100d98 0x00100d98 0x00078 0x00078 R   0x4
  GNU_EH_FRAME   0x000000 0x00000000 0x00000000 0x00000 0x00000     0x4

This caused problems for the code in libc/elf/rtld.c that attempts to 
extract l_map_start/l_map_end for the vdso:

              else if (ph->p_type == PT_LOAD)
                {
                  if (! l->l_addr)
                    l->l_addr = ph->p_vaddr;
                  else if (ph->p_vaddr + ph->p_memsz >= l->l_map_end)
                    l->l_map_end = ph->p_vaddr + ph->p_memsz;
                  else if ((ph->p_flags & PF_X)
                           && ph->p_vaddr + ph->p_memsz >= l->l_text_end)
                    l->l_text_end = ph->p_vaddr + ph->p_memsz;
                }

This code will set l_addr but not l_map_end or l_text_end because it 
grabbed the p_vaddr from the 1st and only LOAD entry then continue the 
loop looking for the 2nd LOAD entry (which is not there!). On PPC32 this 
causes the "assert (mapend > mapstart)" in __elf_preferred_address to 
fail.

-- 
           Summary: VDSO with 1 LOAD entry fails on PPC32
           Product: glibc
           Version: 2.3.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: gotom at debian dot or dot jp
        ReportedBy: sjmunroe at us dot ibm dot com
                CC: glibc-bugs at sources dot redhat dot com,sjmunroe at us
                    dot ibm dot com
 GCC build triplet: linux--powerpc64
  GCC host triplet: linux--powerpc64
GCC target triplet: linux--powerpc


http://sources.redhat.com/bugzilla/show_bug.cgi?id=639

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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