This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] S/390: Fix socket and mcount 64 bit asms
- From: "Andreas Krebbel" <krebbel at linux dot vnet dot ibm dot com>
- To: libc-alpha at sources dot redhat dot com
- Cc: dstownse at us dot ibm dot com, schwidefsky at de dot ibm dot com
- Date: Mon, 22 Sep 2008 15:15:04 +0200
- Subject: [PATCH] S/390: Fix socket and mcount 64 bit asms
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. */