From patchwork Fri Jan 10 17:58:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 23112 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DEEA0216DB for ; Fri, 10 Jan 2014 17:58:49 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wm4sf16950974obc.11 for ; Fri, 10 Jan 2014 09:58:49 -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:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=K9bGKr8oOBu/T2vhjimjaWNidax8yKi+m9gPnccatlk=; b=hCHsyUmL8gOVCwyenXY6RtD1LzRY7koNW1VwTKtOcOgFFBE7T3nn2J0TcBNvKoLwhC r0UUDGL9bltFNeEYJPardZS+QoF9y4ycxS3ezNAZSuYdSggTUvZyVqtzXpeItoj/byr1 Sj9mXhZo2vODYEpPd0T7JdchW8DVNvizFjm9PV4mfVLxBc7I1h9O9rpn60MmRSuBrAji e1AGTkwZAfTznDUBqdxoCdj8XmFpxEmzFmii4DhpaVPPygxa+843XtH1qhX2aUSIvkEo pw7OB67He4JhjrZynhKXGKFf8f7YsRFfX1UsrIk4PfYZ/jzthznoGkpL6oO1wjPLpbOZ Pn+A== X-Gm-Message-State: ALoCoQmbFhdVc9TVnB5ia7pFlyXoyU5gDUjYyvwAnTZE/tgK9c6UcnXTuBFsdO5SGJPm7ieCqq94 X-Received: by 10.182.186.105 with SMTP id fj9mr4038366obc.5.1389376729001; Fri, 10 Jan 2014 09:58:49 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.41.66 with SMTP id d2ls1632440qel.10.gmail; Fri, 10 Jan 2014 09:58:48 -0800 (PST) X-Received: by 10.58.133.193 with SMTP id pe1mr1368525veb.58.1389376728926; Fri, 10 Jan 2014 09:58:48 -0800 (PST) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id sz9si5392866vdc.6.2014.01.10.09.58.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Jan 2014 09:58:48 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id db12so3691106veb.36 for ; Fri, 10 Jan 2014 09:58:48 -0800 (PST) X-Received: by 10.58.134.40 with SMTP id ph8mr1238838veb.61.1389376728805; Fri, 10 Jan 2014 09:58:48 -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.59.13.131 with SMTP id ey3csp106519ved; Fri, 10 Jan 2014 09:58:48 -0800 (PST) X-Received: by 10.180.187.36 with SMTP id fp4mr3933895wic.9.1389376725426; Fri, 10 Jan 2014 09:58:45 -0800 (PST) Received: from mail-ea0-f172.google.com (mail-ea0-f172.google.com [209.85.215.172]) by mx.google.com with ESMTPS id i1si11432340eev.152.2014.01.10.09.58.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Jan 2014 09:58:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.172 is neither permitted nor denied by best guess record for domain of taras.kondratiuk@linaro.org) client-ip=209.85.215.172; Received: by mail-ea0-f172.google.com with SMTP id q10so1833654ead.17 for ; Fri, 10 Jan 2014 09:58:45 -0800 (PST) X-Received: by 10.14.215.68 with SMTP id d44mr3054253eep.90.1389376723324; Fri, 10 Jan 2014 09:58:43 -0800 (PST) Received: from condor-x220.synapse.com ([195.238.93.36]) by mx.google.com with ESMTPSA id p45sm16407719eeg.1.2014.01.10.09.58.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Jan 2014 09:58:42 -0800 (PST) From: Taras Kondratiuk To: Russell King , Ben Dooks , Jon Medhurst , linux-arm-kernel@lists.infradead.org Cc: patches@linaro.org, linaro-networking@linaro.org, linaro-kernel@lists.linaro.org, Taras Kondratiuk , linux-kernel@vger.kernel.org Subject: [PATCH v2 5/5] ARM: kprobes-test: Workaround GAS .align bug Date: Fri, 10 Jan 2014 19:58:26 +0200 Message-Id: <1389376706-30051-6-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1389376706-30051-1-git-send-email-taras.kondratiuk@linaro.org> References: <1389376706-30051-1-git-send-email-taras.kondratiuk@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: taras.kondratiuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.177 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: , By default if no fill symbol is given to .align directive in a code section it fills gap with NOPs. If previous fragment is not instruction-aligned, additional pre-alignment is done by zero bytes before NOPs. These zero bytes are marked as data by special symbol $d in symbol table. Unfortunately GAS assumes that there is only code in the code section so it "puts back" code symbol $a at the end of this pre-alignment. So if there is some data after alignment it will be interpreted as code and will be swapped back to LE for BE8 system during a final linking. If explicit fill value is given to .align, the NOP-padding code is skipped and symbol table does not get messed-up. So the workaround for this issue: Use explicit fill value if data should be aligned in the code section. Acked-by: Jon Medhurst Signed-off-by: Taras Kondratiuk --- arch/arm/kernel/kprobes-test.c | 2 +- arch/arm/kernel/kprobes-test.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/kernel/kprobes-test.c b/arch/arm/kernel/kprobes-test.c index 0850c72..d2c2174 100644 --- a/arch/arm/kernel/kprobes-test.c +++ b/arch/arm/kernel/kprobes-test.c @@ -113,7 +113,7 @@ * @ start of inline data... * .ascii "mov r0, r7" @ text title for test case * .byte 0 - * .align 2 + * .align 2, 0 * * @ TEST_ARG_REG * .byte ARG_TYPE_REG diff --git a/arch/arm/kernel/kprobes-test.h b/arch/arm/kernel/kprobes-test.h index e28a869..eecc90a 100644 --- a/arch/arm/kernel/kprobes-test.h +++ b/arch/arm/kernel/kprobes-test.h @@ -115,7 +115,7 @@ struct test_arg_end { /* multiple strings to be concatenated. */ \ ".ascii "#title" \n\t" \ ".byte 0 \n\t" \ - ".align 2 \n\t" + ".align 2, 0 \n\t" #define TEST_ARG_REG(reg, val) \ ".byte "__stringify(ARG_TYPE_REG)" \n\t" \