This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Regarding "Inconsistency detected by ld.so"


Hi All,

I'm currently facing one problem with respect to load a PPC32 Bit binary
(linked against custom linker script), there is no issue with compilation
and linking but facing below trouble in loading the binary. Please find the
complete details as mentioned below.

root@localhost:/root/test> ./testsample
/Inconsistency detected by ld.so: dl-open.c: 593: _dl_open: Assertion
`_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed!
/
In code we have dlopen call as like below.

fd = dlopen(libpath, RTLD_NOW | RTLD_LOCAL)

GDB Debug:
================

(gdb)
(gdb)
(gdb)  set stop-on-solib-events 1
(gdb) run
Starting program: /root/test/testsample
Stopped due to shared library event
(gdb) info shared
>From        To          Syms Read   Shared Object Library
0x0ffc1f00  0x0ffd9e20  Yes (*)     /lib/ld.so.1
(*): Shared library is missing debugging information.
(gdb) c
Continuing.
Stopped due to shared library event
(gdb) info shared
>From        To          Syms Read   Shared Object Library
0x0ffc1f00  0x0ffd9e20  Yes (*)     /lib/ld.so.1
0x2290fe20  0x22913200  Yes (*)     /usr/lib/libtestsampleloader.1.0.1.so
0x0fe5f160  0x0ff6d2a0  Yes (*)     /lib/libc.so.6
0x0fe20b80  0x0fe21fe0  Yes (*)     /lib/libdl.so.2
(*): Shared library is missing debugging information.
(gdb)
>From        To          Syms Read   Shared Object Library
0x0ffc1f00  0x0ffd9e20  Yes (*)     /lib/ld.so.1
0x2290fe20  0x22913200  Yes (*)     /usr/lib/libtestsampleloader.1.0.1.so
0x0fe5f160  0x0ff6d2a0  Yes (*)     /lib/libc.so.6
0x0fe20b80  0x0fe21fe0  Yes (*)     /lib/libdl.so.2
(*): Shared library is missing debugging information.
(gdb) c
Continuing.
Begin testsample Session (pid 3744).
Inconsistency detected by ld.so: dl-open.c: 593: _dl_open: Assertion
`_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed!

Program exited with code 0177.
(gdb) backtrace
No stack.
(gdb) info shared
>From        To          Syms Read   Shared Object Library
0x0ffc1f00  0x0ffd9e20  Yes (*)     /lib/ld.so.1
(*): Shared library is missing debugging information.
(gdb) info all
The program has no registers now.
(gdb) quit

===================

This problem is happening only after include the below test section:
PHDR {
 <snip>
 tststart PT_LOAD;
}
SECTIONS {

  TSTSTART = 0x0f850000;
  .tststart TSTSTART : AT (TSTSTART)
  {
     *(.tststart)
  } :tststart
}

======================

Program Header Information:

Elf file type is EXEC (Executable file)
Entry point 0x250005c0
There are 9 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  PHDR           0x000034 0x25000034 0x25000034 0x00120 0x00120 R   0x4
  INTERP         0x000154 0x25000154 0x25000154 0x0000d 0x0000d R   0x1
      [Requesting program interpreter: /lib/ld.so.1]
  LOAD           0x000000 0x25000000 0x25000000 0x00af4 0x00af4 R E 0x10000
  LOAD           0x000af4 0x25010af4 0x25010af4 0x00134 0x0013c RW  0x10000
  DYNAMIC        0x000b10 0x25010b10 0x25010b10 0x00110 0x00110 RW  0x4
  NOTE           0x000a94 0x25000a94 0x25000a94 0x00020 0x00020 R   0x4
  GNU_EH_FRAME   0x000ab4 0x25000ab4 0x25000ab4 0x00014 0x00014 R   0x4
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4
  GNU_EH_FRAME   0x000000 0x00000000 0x00000000 0x00000 0x00000 R   0x4

 Section to Segment mapping:
  Segment Sections...
   00
   01     .interp
   02     .interp .hash .dynsym .dynstr .gnu.version .gnu.version_r
.rela.dyn .rela.plt .init .text .fini .rodata .note.ABI-tag .eh_frame_hdr
.eh_frame
   03     .ctors .dtors .jcr .got2 .dynamic .got .plt .data .bss
   04     .dynamic .got .plt
   05     .note.ABI-tag
   06     .eh_frame_hdr
   07
   08
File command output:
ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.34, with unknown
capability 0x41000000 = 0x13676e75, with unknown capability 0x10000 =
0xb0401, not stripped


Few Points:

- Running on 32 Bit multicore processor (processes is affined to one core)
- Compiled & Linked code for powerpc 32 Bit.
- powerpc-wrs-linux-gnu-gcc - 4.4.1
- GNU ld 2.19.51.20090709

Any suggestions or pointer will be helpful to continue my investigation. 

Thanks in Advance.




--
View this message in context: http://sourceware-org.1504.n7.nabble.com/Regarding-Inconsistency-detected-by-ld-so-tp227752.html
Sent from the Sourceware - binutils list mailing list archive at Nabble.com.


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