mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Peter Korsgaard <jacmet@sunsite.dk>
Cc: linux-kernel@vger.kernel.org, sam@ravnborg.org,
	dhowells@redhat.com, andi@firstfloor.org,
	"Kirill A. Shutemov" <k.shutemov@gmail.com>
Subject: Re: [PATCH v2] export linux/a.out.h
Date: Mon, 16 Jun 2008 13:01:03 +0100	[thread overview]
Message-ID: <1213617663.26255.708.camel@pmac.infradead.org> (raw)
In-Reply-To: <1213604973-7073-1-git-send-email-jacmet@sunsite.dk>

On Mon, 2008-06-16 at 10:29 +0200, Peter Korsgaard wrote:
> Export linux/a.out.h like we do for asm/a.out.h as some applications needs
> it (E.G. valgrind). One minor complication is that the content is protected
> by an CONFIG_ARCH_SUPPORTS_AOUT ifdef, so get rid of it.

There was a _reason_ for that ifdef, although on reflection probably not
a particularly good one. But unless we remove the reason for that ifdef,
your patch will break compilation on architectures which don't have
<asm/a.out.h>.

We should get rid of CONFIG_ARCH_SUPPORTS_AOUT entirely. The only
remaining users of it are fs/exec.c, which uses it entirely redundantly:
	#if defined(__alpha__) && defined(CONFIG_ARCH_SUPPORTS_AOUT)

...and (indirectly, by virtue of being the only other file that includes
<linux/a.out.h> when ARCH_SUPPORTS_AOUT might be unset) fs/binfmt_elf.c,
which still has unnecessary references to 'struct exec' even though Andi
removed the support for a.out interpreters a few months ago. That can
just go away.

Please see  git.infradead.org/users/dwmw2/aout-2.6.git

David Woodhouse (6):
      Include <asm/a.out.h> in fs/exec.c only for Alpha.
      Remove last traces of a.out support from ELF loader.
      Remove #ifdef CONFIG_ARCH_SUPPORTS_AOUT from <linux/a.out.h>
      Export <linux/a.out.h> to userspace again.
      Remove redundant CONFIG_ARCH_SUPPORTS_AOUT
      Remove references to now-defunct CONFIG_ARCH_SUPPORTS_AOUT from defconfigs

The first four are shown below, as a single combined patch.

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 0fa95b1..d48ff5f 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -16,7 +16,6 @@
 #include <linux/time.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
-#include <linux/a.out.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
 #include <linux/binfmts.h>
@@ -548,7 +547,6 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
 	struct {
 		struct elfhdr elf_ex;
 		struct elfhdr interp_elf_ex;
-  		struct exec interp_ex;
 	} *loc;
 
 	loc = kmalloc(sizeof(*loc), GFP_KERNEL);
@@ -680,7 +678,6 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
 			}
 
 			/* Get the exec headers */
-			loc->interp_ex = *((struct exec *)bprm->buf);
 			loc->interp_elf_ex = *((struct elfhdr *)bprm->buf);
 			break;
 		}
diff --git a/fs/exec.c b/fs/exec.c
index 9448f1b..da94a6f 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -26,7 +26,6 @@
 #include <linux/file.h>
 #include <linux/fdtable.h>
 #include <linux/mman.h>
-#include <linux/a.out.h>
 #include <linux/stat.h>
 #include <linux/fcntl.h>
 #include <linux/smp_lock.h>
@@ -61,6 +60,11 @@
 #include <linux/kmod.h>
 #endif
 
+#ifdef __alpha__
+/* for /sbin/loader handling in search_binary_handler() */
+#include <linux/a.out.h>
+#endif
+
 int core_uses_pid;
 char core_pattern[CORENAME_MAX_SIZE] = "core";
 int suid_dumpable = 0;
@@ -1155,7 +1159,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
 {
 	int try,retval;
 	struct linux_binfmt *fmt;
-#if defined(__alpha__) && defined(CONFIG_ARCH_SUPPORTS_AOUT)
+#ifdef __alpha__
 	/* handle /sbin/loader.. */
 	{
 	    struct exec * eh = (struct exec *) bprm->buf;
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 93b9885..b6fbb25 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -166,6 +166,9 @@ unifdef-y += acct.h
 unifdef-y += adb.h
 unifdef-y += adfs_fs.h
 unifdef-y += agpgart.h
+ifeq ($(wildcard include/asm-$(SRCARCH)/a.out.h),include/asm-$(SRCARCH)/a.out.h)
+unifdef-y += a.out.h
+endif
 unifdef-y += apm_bios.h
 unifdef-y += atalk.h
 unifdef-y += atmdev.h
diff --git a/include/linux/a.out.h b/include/linux/a.out.h
index 208f4e8..e86dfca 100644
--- a/include/linux/a.out.h
+++ b/include/linux/a.out.h
@@ -1,8 +1,6 @@
 #ifndef __A_OUT_GNU_H__
 #define __A_OUT_GNU_H__
 
-#ifdef CONFIG_ARCH_SUPPORTS_AOUT
-
 #define __GNU_EXEC_MACROS__
 
 #ifndef __STRUCT_EXEC_OVERRIDE__
@@ -277,10 +275,4 @@ struct relocation_info
 #endif /* no N_RELOCATION_INFO_DECLARED.  */
 
 #endif /*__ASSEMBLY__ */
-#else /* CONFIG_ARCH_SUPPORTS_AOUT */
-#ifndef __ASSEMBLY__
-struct exec {
-};
-#endif
-#endif /* CONFIG_ARCH_SUPPORTS_AOUT */
 #endif /* __A_OUT_GNU_H__ */

-- 
dwmw2


  reply	other threads:[~2008-06-16 12:01 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-15 21:07 [PATCH] " Peter Korsgaard
2008-06-15 21:32 ` David Woodhouse
2008-06-16  8:29   ` [PATCH v2] " Peter Korsgaard
2008-06-16 12:01     ` David Woodhouse [this message]
2008-06-16 12:17       ` Adrian Bunk
2008-06-16 12:26         ` David Woodhouse
2008-06-17  8:42           ` architectures with ARCH_SUPPORTS_AOUT but no binfmt_aout Adrian Bunk
2008-06-17  9:46             ` David Woodhouse
2008-06-17 10:11               ` Adrian Bunk
2008-06-17 10:18                 ` David Woodhouse
2008-06-17 10:24                   ` Adrian Bunk
2008-06-17 11:28                 ` David Woodhouse
2008-06-17 12:23                   ` Sam Ravnborg
2008-06-17 12:29                     ` David Woodhouse
2008-06-17 12:37                       ` Sam Ravnborg
2008-06-17 12:54                         ` David Woodhouse
2008-06-22  9:49                   ` Adrian Bunk
2008-06-22 11:40                     ` David Woodhouse
2008-06-22 23:53                       ` David McCullough
2008-06-24 11:46                       ` Adrian Bunk
2008-06-27 16:27                         ` Jeff Dike
2008-06-27 21:12               ` [2.6 patch] remove unused asm/a.out.h files Adrian Bunk
2008-09-05 16:27               ` [PATCH 1/2] Remove redundant CONFIG_ARCH_SUPPORTS_AOUT David Woodhouse
2008-09-05 16:28                 ` Kyle McMartin
2008-09-05 17:17                   ` [PATCH 3/2] Remove asm/a.out.h files for all architectures without a.out support David Woodhouse
2008-09-05 17:17                   ` [PATCH 1/2] Remove redundant CONFIG_ARCH_SUPPORTS_AOUT David Woodhouse
2008-09-05 16:27               ` [PATCH 2/2] Introduce HAVE_AOUT symbol to remove hard-coded arch list for BINFMT_AOUT David Woodhouse
2008-06-17 11:28             ` architectures with ARCH_SUPPORTS_AOUT but no binfmt_aout Matthew Wilcox
2008-06-24  4:15             ` Paul Mundt
2008-06-16 13:48         ` [PATCH v2] export linux/a.out.h David Howells
2008-06-16 15:47           ` David Woodhouse
2008-06-16 12:20       ` Peter Korsgaard
2008-06-16 11:11         ` [PATCH 1/4] Include <asm/a.out.h> in fs/exec.c only for Alpha David Woodhouse
2008-06-16 11:18         ` [PATCH 2/4] Remove last traces of a.out support from ELF loader David Woodhouse
2008-06-16 11:18         ` [PATCH 3/4] Remove #ifdef CONFIG_ARCH_SUPPORTS_AOUT from <linux/a.out.h> David Woodhouse
2008-06-16 11:24         ` [PATCH 4/4] Export <linux/a.out.h> to userspace again David Woodhouse
2008-06-16 13:22         ` [PATCH v2] export linux/a.out.h David Woodhouse
2008-06-16 14:40       ` Andi Kleen
2008-06-16 15:15         ` David Woodhouse
2008-06-15 22:33 ` [PATCH] " Arjan van de Ven
2008-06-16  7:03   ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1213617663.26255.708.camel@pmac.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=andi@firstfloor.org \
    --cc=dhowells@redhat.com \
    --cc=jacmet@sunsite.dk \
    --cc=k.shutemov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®