This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB 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 sim/9064] ARMulator hangs running executable with wrong ABI


http://sourceware.org/bugzilla/show_bug.cgi?id=9064

--- Comment #3 from Nick Clifton <nickc at redhat dot com> 2011-11-07 14:54:02 UTC ---
Hi Flash,

As it happens this is not an unsupported syscall problem but rather the absence
of a run time loader.  If you trace the execution of simple-arm.out you will
find that it gets as far as the first branch instruction in _start:

    8390:    ebffffef     bl    8354 <_init+0x34>

This should branch to some function, (I am guessing  __libc_start_main), whose
address has been put into the PLT, but since the simulator does not include a
loader, it has not been initialised:

  00008334 <.plt>:
  [...]
    8354:    e28fc600     add    ip, pc, #0, 12

So the sim goes off emulating uninitialised PLT entries until eventually it
ends up branch to address 0, and from there off into uninitialised memory.

Mike is correct - the ARM simulator cannot handle ARM linux binaries, nor
should it be expected to.  If however, you would like the simulator to stop,
and not go on for ever, eating up memory and CPU cycles, then you might like to
search for these lines in sim/arm/armemu.c:

  #if 0 /* Enable this for a helpful bit of debugging when tracing is needed. 
*/
      fprintf (stderr, "pc: %x, instr: %x\n", pc & ~1, instr);
      if (instr == 0)
    abort ();
  #endif

Change the "#if 0" to "#if 1", rebuild the sim (and gdb if you use that) and
off you go.

Cheers
  Nick

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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