From patchwork Fri Jan 31 18:33:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 23987 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f70.google.com (mail-pb0-f70.google.com [209.85.160.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 71184202FA for ; Fri, 31 Jan 2014 18:33:17 +0000 (UTC) Received: by mail-pb0-f70.google.com with SMTP id rq2sf11180853pbb.1 for ; Fri, 31 Jan 2014 10:33:16 -0800 (PST) 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:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=T8vJFOis2tsvuCllK8Mj+9U1TEQmpjaptyanCiEoi5s=; b=kRrE4xPjTfL9Aiy6TRqUYj5GdmhtvCxe3Z+EFcndcqP9lb9+NJdcQwS5PZJQKHeH/c v5pqvaiAFn195PnkMUhgENgLhM9r7F6ssQLU6pUT1zjUIFiA/9IoyFHAXJaq6QMoHXEB D1ZICuT2qFI7NK0hIYY6QeV/Qiws20bFnHufiULa5ltWKmawoEWIb9uo1i3/cR1dBm9H 7sQsYDw7EF+Rd5SGhxHHGx0VyEzPnujqxjQ37sGQsJFLcAkf4i+NmerEfA79ro4qVrKc rHBI9vrpHmouBmjc2elGJiTgXUhuPyzs7Qnx3Kkp7WS5GTlUtAbep2RBtPN+Co2RXaHH QfBA== X-Gm-Message-State: ALoCoQlQm5Ei55QROAOeGcFxtAwRBhb2U0TY8jSDvYJV/EGbCVL4dP5f6yiGoNe13Yh87XVgEqEH X-Received: by 10.66.26.132 with SMTP id l4mr8060040pag.2.1391193196751; Fri, 31 Jan 2014 10:33:16 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.37.135 with SMTP id r7ls1196577qgr.25.gmail; Fri, 31 Jan 2014 10:33:16 -0800 (PST) X-Received: by 10.58.169.7 with SMTP id aa7mr7419957vec.24.1391193196584; Fri, 31 Jan 2014 10:33:16 -0800 (PST) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx.google.com with ESMTPS id dp3si3809334vcb.21.2014.01.31.10.33.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Jan 2014 10:33:16 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.44; Received: by mail-vb0-f44.google.com with SMTP id f12so3151702vbg.17 for ; Fri, 31 Jan 2014 10:33:16 -0800 (PST) X-Received: by 10.52.84.102 with SMTP id x6mr285544vdy.49.1391193196506; Fri, 31 Jan 2014 10:33:16 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp117184vcz; Fri, 31 Jan 2014 10:33:16 -0800 (PST) X-Received: by 10.140.16.144 with SMTP id 16mr32091585qgb.54.1391193196022; Fri, 31 Jan 2014 10:33:16 -0800 (PST) Received: from mail-qc0-f180.google.com (mail-qc0-f180.google.com [209.85.216.180]) by mx.google.com with ESMTPS id ep5si3641180qcb.99.2014.01.31.10.33.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Jan 2014 10:33:16 -0800 (PST) Received-SPF: neutral (google.com: 209.85.216.180 is neither permitted nor denied by best guess record for domain of dave.long@linaro.org) client-ip=209.85.216.180; Received: by mail-qc0-f180.google.com with SMTP id i17so7490750qcy.25 for ; Fri, 31 Jan 2014 10:33:15 -0800 (PST) X-Received: by 10.140.23.209 with SMTP id 75mr31803804qgp.94.1391193195809; Fri, 31 Jan 2014 10:33:15 -0800 (PST) Received: from localhost.localdomain (c-76-24-48-141.hsd1.nh.comcast.net. [76.24.48.141]) by mx.google.com with ESMTPSA id s2sm29284270qat.1.2014.01.31.10.33.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Jan 2014 10:33:15 -0800 (PST) From: David Long To: linux-arm-kernel@lists.infradead.org Cc: Rusty Russell , James Hogan , Andi Kleen , Paul Gortmaker , Andrew Morton , linux-kernel@vger.kernel.org Subject: [PATCH] Detect section mismatches in thumb relocations Date: Fri, 31 Jan 2014 13:33:13 -0500 Message-Id: <1391193193-28572-1-git-send-email-dave.long@linaro.org> X-Mailer: git-send-email 1.8.1.2 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: dave.long@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: "David A. Long" Add processing for normally encountered thumb relocation types so that section mismatches will be detected. Signed-off-by: David A. Long --- scripts/mod/modpost.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 1785576..9e6c996 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1498,6 +1498,16 @@ static int addend_386_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r) #define R_ARM_JUMP24 29 #endif +#ifndef R_ARM_THM_CALL +#define R_ARM_THM_CALL 10 +#endif +#ifndef R_ARM_THM_JUMP24 +#define R_ARM_THM_JUMP24 30 +#endif +#ifndef R_ARM_THM_JUMP19 +#define R_ARM_THM_JUMP19 51 +#endif + static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r) { unsigned int r_typ = ELF_R_TYPE(r->r_info); @@ -1511,6 +1521,9 @@ static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r) case R_ARM_PC24: case R_ARM_CALL: case R_ARM_JUMP24: + case R_ARM_THM_CALL: + case R_ARM_THM_JUMP24: + case R_ARM_THM_JUMP19: /* From ARM ABI: ((S + A) | T) - P */ r->r_addend = (int)(long)(elf->hdr + sechdr->sh_offset +