https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82518

--- Comment #13 from Nick Clifton <nickc at redhat dot com> ---
Hi Aldy,


> pc: 8ca4, instr: e1c520fc
> pc: 4, instr: ea00089b
> 
> I took a peek at the executable being run with "/my-arm-build/objdudump -D
> the-executable.exe", and I see we are failing in 
> initialise_monitor_handles(). 
> This suggests we're failing during the start-up code:

>     8ca4:       e1c520fc        strd    r2, [r5, #12]
> 
> It seems that last store is corrupting things and making us jump to a PC of
> 4???

Address 4 is the "undefined instruction" vector.  If the simulator thinks
that the instruction is illegal/unknown then it will branch to address 4
and start executing from there.  (Or else it loads the value stored at 
address 4 and starts executing from that address.  I forget which).

So, this basically means that the simulator does not like that STRD 
instruction. :-(  Looking at the code in Handle_Store_Double() in 
sim/arm/armemu.c, I think that the reason is probably because the address
for the store is not double word aligned.  Which leads me to wonder,
what value is stored in r5 when the STRD instruction is being executed ?




> Am I running the simulator correctly?

Yes.

>  Does it require a special flag for
> cortex-a9?  

No.

> Is the cortex-a9 CPU even handled by the simulator?

Yes.

> Should I run the dejagnu tests with -mcpu=xxxx or whatever, or is the
> --with-cpu=cortex-a9 configury flag enough?

Be paranoid - add the option. :-)


> Does the arm newlib/libgloss/whatever code have instructions that aren't
> handled by the GDB simulator?

No.  Well not in the assembler parts of it.  The possible exception to this
are the memory manipulation functions (memcpy, strlen ,etc) in newlib/libc/
sys/arm/ which tend to be very tightly coded, and will often be updated to 
take advantage of new instructions as they are added to the ISA.

Of course the C parts of these libraries might use unsupported instructions
if gcc generates them.  But if you have configured gcc correctly (and I think
that you have) then this should not be an issue.

Cheers
  Nick

Reply via email to