Re: unaligned access using bash on glibc 2.5

Aurelien Jarno <[email protected]>
Newsgroups gmane.linux.ports.hppa
Message-ID <[email protected]>
On Wed, May 02, 2007 at 11:38:51AM +0200, Aurelien Jarno wrote:
> Please find the reduced testcase below. When the value is assigned to
> __libc_errno, the value of r19 has been overrided by the call to free().
> 

And a smaller one:


extern __thread int __libc_errno __attribute__ ((tls_model ("initial-exec")));
extern void free (void *__ptr) __attribute__ ((__nothrow__));

void test(int *p)
{
  free (p);
  __libc_errno = 25;
}

00000000 <test>:
test():
   0:   6b c2 3f d9     stw rp,-14(sp)
   4:   6f c4 00 80     stw,ma r4,40(sp)
   8:   e8 40 00 00     b,l 10 <test+0x10>,rp
                        8: R_PARISC_PCREL17F    free
   c:   6b d3 3f c1     stw r19,-20(sp)
  10:   2a 60 00 00     addil L%0,r19,r1
                        10: R_PARISC_LTOFF_TP21L        __libc_errno
  14:   48 3c 00 00     ldw 0(r1),ret0
                        14: R_PARISC_LTOFF_TP14R        __libc_errno
  18:   34 15 00 32     ldi 19,r21
  1c:   03 60 08 b4     mfctl tr3,r20
  20:   0b 94 0a 14     add,l r20,ret0,r20
  24:   0e 95 12 80     stw r21,0(r20)
  28:   4b c2 3f 59     ldw -54(sp),rp
  2c:   e8 40 c0 00     bv r0(rp)
  30:   4f c4 3f 81     ldw,mb -40(sp),r4



-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.