* [PATCH] [RESEND] fs/binfmt_elf.c changes vs 2.4.5-pre3
@ 2001-05-18 12:35 Paul Mackerras
0 siblings, 0 replies; only message in thread
From: Paul Mackerras @ 2001-05-18 12:35 UTC (permalink / raw)
To: Linus Torvalds; +Cc: cort, benh, linux-kernel
Linus,
This patch against 2.4.5-pre3 makes 3 changes to fs/binfmt_elf.c:
1. It fixes the csp calculation so that it actually achieves the 16
byte final alignment that the comment claims. Previously the csp
calculation didn't take the AT_NULL entry into account. If you
look at the current fs/binfmt_elf.c there is a "sp -= 2" that is
not reflected in the csp calculation, unlike all the other
decrements of sp.
2. It allows each architecture to add extra aux table entries by
defining DLINFO_ARCH_ITEMS and ARCH_DLINFO in <asm/elf.h>. We need
this on PowerPC to add entries for the cache line size, and to add
entries for compatibility with older broken glibc's.
3. It removes the extra 16 bytes that were left free for PowerPC - in
the past we had to move the auxiliary table up to cope with broken
glibc's (now we cope by adding special AT_IGNORE entries using the
ARCH_DLINFO macro).
Please apply this to your tree.
Thanks,
Paul.
diff -Nru a/fs/binfmt_elf.c b/fs/binfmt_elf.c
--- a/fs/binfmt_elf.c Wed May 16 18:45:10 2001
+++ b/fs/binfmt_elf.c Wed May 16 18:45:10 2001
@@ -135,12 +135,13 @@
/*
* 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)(u_platform)) - 16UL);
+ sp = (elf_addr_t *)(~15UL & (unsigned long)(u_platform));
csp = sp;
- csp -= DLINFO_ITEMS*2 + (k_platform ? 2 : 0);
+ csp -= (1+DLINFO_ITEMS)*2 + (k_platform ? 2 : 0);
+#ifdef DLINFO_ARCH_ITEMS
+ csp -= DLINFO_ARCH_ITEMS*2;
+#endif
csp -= envc+1;
csp -= argc+1;
csp -= (!ibcs ? 3 : 1); /* argc itself */
@@ -174,6 +175,13 @@
NEW_AUX_ENT(10, AT_EUID, (elf_addr_t) current->euid);
NEW_AUX_ENT(11, AT_GID, (elf_addr_t) current->gid);
NEW_AUX_ENT(12, AT_EGID, (elf_addr_t) current->egid);
+#ifdef ARCH_DLINFO
+ /*
+ * ARCH_DLINFO must come last so platform specific code can enforce
+ * special alignment requirements on the AUXV if necessary (eg. PPC).
+ */
+ ARCH_DLINFO;
+#endif
#undef NEW_AUX_ENT
sp -= envc+1;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-05-18 12:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-18 12:35 [PATCH] [RESEND] fs/binfmt_elf.c changes vs 2.4.5-pre3 Paul Mackerras
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®