patch-2.1.51 linux/fs/binfmt_elf.c

Next file: linux/fs/dcache.c
Previous file: linux/fs/autofs/inode.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.50/linux/fs/binfmt_elf.c linux/fs/binfmt_elf.c
@@ -115,15 +115,17 @@
 
 	/*
 	 * Force 16 byte _final_ alignment here for generality.
+	 * Leave an extra 16 bytes free so that on the PowerPC we
+	 * can move the aux table up to start on a 16-byte boundary.
 	 */
-	sp = (elf_addr_t *) (~15UL & (unsigned long) p);
+	sp = (elf_addr_t *) ((~15UL & (unsigned long) p) - 16UL);
 	csp = sp;
 	csp -= exec ? DLINFO_ITEMS*2 : 2;
 	csp -= envc+1;
 	csp -= argc+1;
 	csp -= (!ibcs ? 3 : 1);	/* argc itself */
 	if ((unsigned long)csp & 15UL) {
-		sp -= (16UL - ((unsigned long)csp & 15UL)) / sizeof(*sp);
+		sp -= ((unsigned long)csp & 15UL) / sizeof(*sp);
 	}
 
 	/*

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov