Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752315AbbKPOed (ORCPT ); Mon, 16 Nov 2015 09:34:33 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:49787 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751732AbbKPOea (ORCPT ); Mon, 16 Nov 2015 09:34:30 -0500 Date: Mon, 16 Nov 2015 14:34:27 +0000 From: "Maciej W. Rozycki" To: CC: Ralf Baechle , Matthew Fortune , Daniel Sanders , Leonid Yegoshin , Subject: [RFC PATCH 1/4] ELF: Add platform-specific AT_FLAGS initialisation support In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [10.100.200.62] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2283 Lines: 56 Signed-off-by: Maciej W. Rozycki --- linux-elf-at-flags.diff Index: linux-sfr-test/fs/binfmt_elf.c =================================================================== --- linux-sfr-test.orig/fs/binfmt_elf.c 2015-09-08 15:24:00.927208000 +0100 +++ linux-sfr-test/fs/binfmt_elf.c 2015-09-08 15:26:10.318310000 +0100 @@ -72,6 +72,10 @@ static int elf_core_dump(struct coredump #define ELF_MIN_ALIGN PAGE_SIZE #endif +#ifndef ELF_FLAGS +#define ELF_FLAGS 0 +#endif + #ifndef ELF_CORE_EFLAGS #define ELF_CORE_EFLAGS 0 #endif @@ -238,7 +242,7 @@ create_elf_tables(struct linux_binprm *b NEW_AUX_ENT(AT_PHENT, sizeof(struct elf_phdr)); NEW_AUX_ENT(AT_PHNUM, exec->e_phnum); NEW_AUX_ENT(AT_BASE, interp_load_addr); - NEW_AUX_ENT(AT_FLAGS, 0); + NEW_AUX_ENT(AT_FLAGS, ELF_FLAGS); NEW_AUX_ENT(AT_ENTRY, exec->e_entry); NEW_AUX_ENT(AT_UID, from_kuid_munged(cred->user_ns, cred->uid)); NEW_AUX_ENT(AT_EUID, from_kuid_munged(cred->user_ns, cred->euid)); Index: linux-sfr-test/fs/binfmt_elf_fdpic.c =================================================================== --- linux-sfr-test.orig/fs/binfmt_elf_fdpic.c 2015-09-08 15:24:00.950209000 +0100 +++ linux-sfr-test/fs/binfmt_elf_fdpic.c 2015-09-08 15:29:25.860980000 +0100 @@ -80,6 +80,10 @@ static int elf_fdpic_map_file_by_direct_ static int elf_fdpic_core_dump(struct coredump_params *cprm); #endif +#ifndef ELF_FLAGS +#define ELF_FLAGS 0 +#endif + static struct linux_binfmt elf_fdpic_format = { .module = THIS_MODULE, .load_binary = load_elf_fdpic_binary, @@ -616,7 +620,7 @@ static int create_elf_fdpic_tables(struc NEW_AUX_ENT(AT_PHENT, sizeof(struct elf_phdr)); NEW_AUX_ENT(AT_PHNUM, exec_params->hdr.e_phnum); NEW_AUX_ENT(AT_BASE, interp_params->elfhdr_addr); - NEW_AUX_ENT(AT_FLAGS, 0); + NEW_AUX_ENT(AT_FLAGS, ELF_FLAGS); NEW_AUX_ENT(AT_ENTRY, exec_params->entry_addr); NEW_AUX_ENT(AT_UID, (elf_addr_t) from_kuid_munged(cred->user_ns, cred->uid)); NEW_AUX_ENT(AT_EUID, (elf_addr_t) from_kuid_munged(cred->user_ns, cred->euid)); -- 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/