From patchwork Tue Jun 17 14:57:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 32037 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f72.google.com (mail-qg0-f72.google.com [209.85.192.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 779422100C for ; Tue, 17 Jun 2014 15:00:03 +0000 (UTC) Received: by mail-qg0-f72.google.com with SMTP id q107sf125816qgd.3 for ; Tue, 17 Jun 2014 08:00:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:in-reply-to:references:cc:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=DsjRWTLjWjsxnXOUx0cnIYrpJwwcAK95bQr4EdVw9so=; b=YuqviwlhdtQWo7/+Mpy+Ki5rgVCi+C9m91vzdbKwyhBV3oIVO7z6TzKaJBJzj7oeZ/ y9QjaGiqWauKFSeQcrQSfgXM0DkvHqiujN7lcZhf5LDL9gDC1dQRtmkszHj2NskHuUpa QgHrOq2Jkia1NEWX1/mjipqxes1Nh6eFrHEv4PWq+/JWyMDk8hiqwVNKTE8azYsk1waE +7QnVdk+DcZ0PEigtF44AsEqRQIrPGBq4I2Quxxazf8HO+A5f08OdtW9GCErDbjBTBj+ J9aa8igC+QDCFsE/ZeMuK71oHhvQfr5NztYS7I4id7p575GT+umyojqtNCwLHIT/tibu egEw== X-Gm-Message-State: ALoCoQmyeJlc/GX3gUZFFK8D4BBg+NN83s2ZBt4I4f6C0mvxhO0CZ6E0TYtO7G0G8oPKFFEGHmir X-Received: by 10.236.165.230 with SMTP id e66mr110212yhl.6.1403017203190; Tue, 17 Jun 2014 08:00:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.89.203 with SMTP id v69ls4796696qgd.6.gmail; Tue, 17 Jun 2014 08:00:03 -0700 (PDT) X-Received: by 10.53.8.162 with SMTP id dl2mr18610192vdd.24.1403017203041; Tue, 17 Jun 2014 08:00:03 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id yi11si5561372vdb.1.2014.06.17.08.00.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Jun 2014 08:00:03 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id id10so6522053vcb.16 for ; Tue, 17 Jun 2014 08:00:03 -0700 (PDT) X-Received: by 10.52.88.44 with SMTP id bd12mr656260vdb.86.1403017202968; Tue, 17 Jun 2014 08:00:02 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp215784vcb; Tue, 17 Jun 2014 08:00:02 -0700 (PDT) X-Received: by 10.224.136.129 with SMTP id r1mr36494388qat.60.1403017202140; Tue, 17 Jun 2014 08:00:02 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id t4si5796457qaj.111.2014.06.17.08.00.01 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Jun 2014 08:00:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:51152 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwurh-00017n-FR for patch@linaro.org; Tue, 17 Jun 2014 11:00:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwuoy-0005hT-84 for qemu-devel@nongnu.org; Tue, 17 Jun 2014 10:57:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wwuos-0004Qk-Au for qemu-devel@nongnu.org; Tue, 17 Jun 2014 10:57:12 -0400 Received: from [2001:4b98:dc0:45:216:3eff:fe3d:166f] (port=33145 helo=afflict.kos.to) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwuos-0004P3-4u for qemu-devel@nongnu.org; Tue, 17 Jun 2014 10:57:06 -0400 Received: from afflict.kos.to (afflict [92.243.29.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id 10C2326595; Tue, 17 Jun 2014 16:57:04 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 17 Jun 2014 17:57:00 +0300 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2001:4b98:dc0:45:216:3eff:fe3d:166f Cc: peter.maydell@linaro.org, Craig Heffner Subject: [Qemu-devel] [PULL v2 17/17] User mode support for Linux ELF files with no section header X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Craig Heffner In user mode Linux, Qemu currently refuses to load ELF files that do not contain section headers (ehdr->e_shentsize == 0). Since section headers are not required in order to load an ELF file, simply removing the e_shentsize check in elf_check_ehdr() allows ELF binaries with no section headers to be run properly in user mode: Signed-off-by: Craig Heffner Signed-off-by: Riku Voipio --- linux-user/elfload.c | 1 - 1 file changed, 1 deletion(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index c123244..1248eda 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1292,7 +1292,6 @@ static bool elf_check_ehdr(struct elfhdr *ehdr) return (elf_check_arch(ehdr->e_machine) && ehdr->e_ehsize == sizeof(struct elfhdr) && ehdr->e_phentsize == sizeof(struct elf_phdr) - && ehdr->e_shentsize == sizeof(struct elf_shdr) && (ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN)); }