Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755155AbYFPMBX (ORCPT ); Mon, 16 Jun 2008 08:01:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751998AbYFPMBJ (ORCPT ); Mon, 16 Jun 2008 08:01:09 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:39241 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754757AbYFPMBI (ORCPT ); Mon, 16 Jun 2008 08:01:08 -0400 Subject: Re: [PATCH v2] export linux/a.out.h From: David Woodhouse To: Peter Korsgaard Cc: linux-kernel@vger.kernel.org, sam@ravnborg.org, dhowells@redhat.com, andi@firstfloor.org, "Kirill A. Shutemov" In-Reply-To: <1213604973-7073-1-git-send-email-jacmet@sunsite.dk> References: <1213565555.26255.522.camel@pmac.infradead.org> <1213604973-7073-1-git-send-email-jacmet@sunsite.dk> Content-Type: text/plain Date: Mon, 16 Jun 2008 13:01:03 +0100 Message-Id: <1213617663.26255.708.camel@pmac.infradead.org> Mime-Version: 1.0 X-Mailer: Evolution 2.22.1 (2.22.1-2.fc9) Content-Transfer-Encoding: 7bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4480 Lines: 140 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 . 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 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 in fs/exec.c only for Alpha. Remove last traces of a.out support from ELF loader. Remove #ifdef CONFIG_ARCH_SUPPORTS_AOUT from Export 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 #include #include -#include #include #include #include @@ -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 #include #include -#include #include #include #include @@ -61,6 +60,11 @@ #include #endif +#ifdef __alpha__ +/* for /sbin/loader handling in search_binary_handler() */ +#include +#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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/