From patchwork Mon Feb 1 13:09:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 60914 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3070872lbb; Mon, 1 Feb 2016 05:16:59 -0800 (PST) X-Received: by 10.98.80.149 with SMTP id g21mr38162366pfj.127.1454332619320; Mon, 01 Feb 2016 05:16:59 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id s137si46332835pfs.11.2016.02.01.05.16.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Feb 2016 05:16:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aQEKh-0005LQ-Q3; Mon, 01 Feb 2016 13:15:55 +0000 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aQEFD-0005va-GX for linux-arm-kernel@lists.infradead.org; Mon, 01 Feb 2016 13:10:19 +0000 Received: by mail-wm0-x22f.google.com with SMTP id p63so70321361wmp.1 for ; Mon, 01 Feb 2016 05:09:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=z67To+qs5azAklcF3Exz2hEu6eSuUHNUH08oPoesVhk=; b=SkUUG8kt5m6yeVwNOrhkZc1USHknEjppETxQZOnU8dhyee1AMgzZGCrlfYfhmcFoxf 9gyNwrnfOpgATS4TFlPzFjYSCOeEriRYXrV02hbXLpTId/sFOIjCPHy1hN60K0LHKMU2 p+VvF7WcWWxiXPVjepczl+eRUzjzp3oU4ncf4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=z67To+qs5azAklcF3Exz2hEu6eSuUHNUH08oPoesVhk=; b=J68gCLdhxZl9nCsn634sCMgw6Kt/hkzjDQTCK9Fg3D+5dA6sL3lZiqW38ADGk0sV1I wmf7Ip9+17gbQtuc5LDPMSy4Ph024OEzvjlR5MjX/eQnx6/Uhinf68dAlxCQcnooBveD sgX1H0LWT52vGxP1laDnWStZmvw9FIHQk7JHsm0BJGw+uK8SNnIVlzzO3ukX5FzPFghk 9VYFnAqRT4RqadFd/bgL8JqoR1dSnHq276vTUwDeS2Z6kt41kjvdUNb7hogiBQaxaM9f C2ezaPiMta2XPifWdvivvKRlmn8eydyuBwSz3lW3/LwPsGYDqUbgT/VG3cOLR2uW1rm2 8UCw== X-Gm-Message-State: AG10YOTZCjTkkpctkF4AY0eLXMlOPxYadJoCiE0GrdSoionAfkbVQUueb4cAkxWThf30rfyz X-Received: by 10.194.104.198 with SMTP id gg6mr21220171wjb.84.1454332192929; Mon, 01 Feb 2016 05:09:52 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id e9sm28992124wja.25.2016.02.01.05.09.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Feb 2016 05:09:52 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will.deacon@arm.com, mark.rutland@arm.com, keescook@chromium.org Subject: [PATCH v5sub2 5/8] scripts/sortextable: add support for ET_DYN binaries Date: Mon, 1 Feb 2016 14:09:35 +0100 Message-Id: <1454332178-4414-6-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454332178-4414-1-git-send-email-ard.biesheuvel@linaro.org> References: <1454332178-4414-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160201_051016_012163_7B5125F5 X-CRM114-Status: GOOD ( 11.95 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:22f listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Add support to scripts/sortextable for handling relocatable (PIE) executables, whose ELF type is ET_DYN, not ET_EXEC. Other than adding support for the new type, no changes are needed. Signed-off-by: Ard Biesheuvel --- scripts/sortextable.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/scripts/sortextable.c b/scripts/sortextable.c index af247c70fb66..19d83647846c 100644 --- a/scripts/sortextable.c +++ b/scripts/sortextable.c @@ -266,9 +266,9 @@ do_file(char const *const fname) break; } /* end switch */ if (memcmp(ELFMAG, ehdr->e_ident, SELFMAG) != 0 - || r2(&ehdr->e_type) != ET_EXEC + || (r2(&ehdr->e_type) != ET_EXEC && r2(&ehdr->e_type) != ET_DYN) || ehdr->e_ident[EI_VERSION] != EV_CURRENT) { - fprintf(stderr, "unrecognized ET_EXEC file %s\n", fname); + fprintf(stderr, "unrecognized ET_EXEC/ET_DYN file %s\n", fname); fail_file(); } @@ -304,7 +304,7 @@ do_file(char const *const fname) if (r2(&ehdr->e_ehsize) != sizeof(Elf32_Ehdr) || r2(&ehdr->e_shentsize) != sizeof(Elf32_Shdr)) { fprintf(stderr, - "unrecognized ET_EXEC file: %s\n", fname); + "unrecognized ET_EXEC/ET_DYN file: %s\n", fname); fail_file(); } do32(ehdr, fname, custom_sort); @@ -314,7 +314,7 @@ do_file(char const *const fname) if (r2(&ghdr->e_ehsize) != sizeof(Elf64_Ehdr) || r2(&ghdr->e_shentsize) != sizeof(Elf64_Shdr)) { fprintf(stderr, - "unrecognized ET_EXEC file: %s\n", fname); + "unrecognized ET_EXEC/ET_DYN file: %s\n", fname); fail_file(); } do64(ghdr, fname, custom_sort);