Possible bug in dl-elf.c on m68k.

Groleo Marius groleo at gmail.com
Thu Mar 19 15:57:29 UTC 2009


On Thu, Mar 19, 2009 at 5:50 PM, Groleo Marius <groleo at gmail.com> wrote:
> Hi,
>
> I'm currently having trouble getting uClibc 0.9.30.1 to work on m68k/m5485
> processor. It gets stuck when trying to load the first shared library,
> libgcc_s.so.
> In my attempt to debug the problem I added only _dl_dprintf calls.
> All the debug lines are prefixed by filename and line.
>
> I tried to watch the trace of any parameter used in any _dl_mmap call.
> I identified these parameters as being(sorry for the long list):
>    minvma, maxvma, libaddr, status, piclibc, mmap protection flags,
>        tryaddr, piclib2map, ppnt->p_vaddr, dynamic_addr, lib_loadaddr.
>
> The first mapping is done here[ldso/ldso/dl-elf.c:468
> libaddr=status'0x80016000']
> requesting 0xe000 bytes. The second mapping is tried
> here[ldso/ldso/dl-elf.c:586 status'0xffffffff']
> but fails. The reason why I *think* it fails is overlapping memory areas.
> Here, ldso/ldso/dl-elf.c:563 tryaddr'0x80023000' the address where a mapping
> is needed is 0x80023000, but if you add 0x80016000(the first mapping) with
> 0xE000 you get 0x80024000, which overlaps over the second solicited
> address(0x80023000).
>
> Is this the intended behaviour?
>
> Attached you will find the debug.log and the patch for ldso/ldso/dl-elf.c
>
> Many thanks.

Forgot the readelf output:

mariusn ~ > m68k-unknown-linux-uclibc-readelf -l ./libgcc_s.so.2

Elf file type is DYN (Shared object file)
Entry point 0x20d4
There are 5 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x00000000 0x00000000 0x0b108 0x0b108 R E 0x2000
  LOAD           0x00b108 0x0000d108 0x0000d108 0x00264 0x003b8 RW  0x2000
  DYNAMIC        0x00b11c 0x0000d11c 0x0000d11c 0x000d0 0x000d0 RW  0x4
  GNU_EH_FRAME   0x00a59c 0x0000a59c 0x0000a59c 0x001cc 0x001cc R   0x4
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4

 Section to Segment mapping:
  Segment Sections...
   00     .hash .dynsym .dynstr .gnu.version .gnu.version_d .rela.dyn
.rela.plt .init .plt .text .fini .rodata .eh_frame_hdr .eh_frame
   01     .ctors .dtors .jcr .dynamic .got .data .bss
   02     .dynamic
   03     .eh_frame_hdr
   04


-- 
Regards, Groleo!


More information about the uClibc mailing list