Open Source Support Tools
 
Search Item
 
Summary
  Mail Thread
Title: [PATCH] S/390: Fix socket and mcount 64 bit asms
Project: glibc
Item Last Modified: Tue Sep 23 10:17:53 PDT 2008
Tags:  
 
 
MailThread add andreas apply asm attached bit boundary bugs fix fixes glibc instruction leads martin+schwidefsky patch pointer stack wrong
Details
[PATCH] S/390: Fix socket and mcount 64 bit asms
3 Messages Collapse AllExpand All
Andreas Krebbel to libc-alpha22 Sep 2008 13:15:04 GMT
Hello,

the attached patch fixes two asm snippets in the S/390 code. Although
in the 64 bit directory the 32 bit add instruction is used to subtract
from the stack pointer in r15. This is wrong an leads to especially
nasty bugs whenever crossing a 4GB boundary with the stack pointer.

Please apply if you think it is ok.

Bye,

-Andreas-


2008-09-22 Deborah S. Townsend <dstownse@us.ibm.com>

* sysdeps/s390/s390-64/s390x-mcount.S: Replace ahi with aghi.
* sysdeps/unix/sysv/linux/s390/s390-64/socket.S: Likewise.


Index: sysdeps/s390/s390-64/s390x-mcount.S
===================================================================
--- sysdeps/s390/s390-64/s390x-mcount.S.orig 2005-05-26 16:30:45.000000000 +0200
+++ sysdeps/s390/s390-64/s390x-mcount.S 2008-09-22 14:54:23.000000000 +0200
@@ -64,7 +64,7 @@ C_LABEL(_mcount)
/* Pop the saved registers. Please note that `mcount' has no
return value. */
lmg %r14,%r5,160(%r15)
- ahi %r15,224
+ aghi %r15,224
br %r14
ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(_mcount))

Index: sysdeps/unix/sysv/linux/s390/s390-64/socket.S
===================================================================
--- sysdeps/unix/sysv/linux/s390/s390-64/socket.S.orig 2005-12-20 07:55:02.000000000 +0100
+++ sysdeps/unix/sysv/linux/s390/s390-64/socket.S 2008-09-22 14:55:53.000000000 +0200
@@ -61,7 +61,7 @@ ENTRY(__socket)
cfi_offset (%r6,-112)
lgr %r1,%r15
lg %r0,8(%r15) /* Load eos. */
- ahi %r15,-208 /* Buy stack space. */
+ aghi %r15,-208 /* Buy stack space. */
cfi_adjust_cfa_offset (208)
stg %r1,0(%r15) /* Store back chain. */
stg %r0,8(%r15) /* Store eos. */



Ulrich Drepper to Andreas Krebbel23 Sep 2008 17:17:53 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Applied.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkjZJMEACgkQ2ijCOnn/RHRdxgCeLNVqXoSlagtkj2QvZEdyGFRo
OvoAoKne860qUqDlCihN5Kya8Z8lOOpY
=whKO
-----END PGP SIGNATURE-----



Martin Schwidefsky to Andreas Krebbel23 Sep 2008 16:20:26 GMT
On Mon, 2008-09-22 at 15:15 +0200, Andreas Krebbel wrote:
> the attached patch fixes two asm snippets in the S/390 code. Although
> in the 64 bit directory the 32 bit add instruction is used to subtract
> from the stack pointer in r15. This is wrong an leads to especially
> nasty bugs whenever crossing a 4GB boundary with the stack pointer.

That is a nasty one!

> Please apply if you think it is ok.

The fix is correct.

--
blue skies,
Martin.

"Reality continues to ruin my life." - Calvin.