This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib 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]

atexit in newlib


I am stepping through newlib for arm and my code
crashes at newlib function "atexit". here is the dump
code I have, at address 328, I got ffff in r1, then
the program crashed at 33c.
looks like the pointer is not initialized or something
wrong with it, I tried newlib 1.10.0 instead of 1.9.0,
still doesn't work, anyone has suggestions?
  thanks!
Mark

00000314 <atexit>:
     314:       e1a0c00d        mov     ip, sp
     318:       e92dd830        stmdb   sp!, {r4, r5,
fp, ip, lr, pc}
        _VOID _EXFUN ((*fn), (_VOID)))
{
  register struct _atexit *p;

  if ((p = _REENT->_atexit) == NULL)
     31c:       e59f506c        ldr     r5, [pc, #6c] 
 ; 390 <atexit+0x7c>
     320:       e5953000        ldr     r3, [r5]
     324:       e24cb004        sub     fp, ip, #4    
 ; 0x4
     328:       e5931148        ldr     r1, [r3, #328]
     32c:       e1a04000        mov     r4, r0
     330:       e3510000        cmp     r1, #0  ; 0x0
    _REENT->_atexit = p = &_REENT->_atexit0;
     334:       02831f53        addeq   r1, r3, #332  
 ; 0x14c
     338:       05831148        streq   r1, [r3, #328]
  if (p->_ind >= _ATEXIT_SIZE)
     33c:       e5913004        ldr     r3, [r1, #4]
     340:       e353001f        cmp     r3, #31 ; 0x1f
     344:       da00000a        ble     374
<atexit+0x60>
    {
      if ((p = (struct _atexit *) malloc (sizeof *p))
== NULL)

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com


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