From patchwork Mon Dec 23 16:19:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 22732 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BF35020540 for ; Mon, 23 Dec 2013 16:20:03 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id hz1sf15833880pad.4 for ; Mon, 23 Dec 2013 08:20:03 -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=oInMehbGwo+w85zHbgDLJUvuxqLSrMyN5uPtHY5xNN0=; b=G8qfgndayE7ALz5G/hutY1eiKbF0U2CPuE5ckhnTR9FgaL9DnFWJbSA50JY8pDomzW mlJiim8KTNvH9TqoCvUSqpsoK7JfytcmCv8GIu0UlY1Vsfa3STRpkeXNZDDZGqP+tFcD TjXt6If4U6Sznqp5+CbtIObqbJR0TNZWyCeCWsPJujsCAozKs9CzDqHEq2fDJ/E6IE+Q D/wl9TlnVyRmkLR254iC71URxF4tGZqDHlNOCkgUddK60Bzpj2F+oO2oIatz6O/BlmA2 KS8i+XmuDzQHHk36qwGlGsRy0p59ELx78sz0PpYRfOgompbLDeY3d910GaZs6LTfAECS uGdg== X-Gm-Message-State: ALoCoQkxKvTWyCdy60XOWQ20yByBeIgmx1vXWE22Y5JXRD+lm0jaSYvXQ/gF9C2bfI43r+oxrWH/ X-Received: by 10.66.187.129 with SMTP id fs1mr1535822pac.45.1387815603059; Mon, 23 Dec 2013 08:20:03 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.73.40 with SMTP id i8ls1553031qev.12.gmail; Mon, 23 Dec 2013 08:20:02 -0800 (PST) X-Received: by 10.53.1.231 with SMTP id bj7mr95724vdd.55.1387815602688; Mon, 23 Dec 2013 08:20:02 -0800 (PST) Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43]) by mx.google.com with ESMTPS id fr13si4994892vec.49.2013.12.23.08.20.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Dec 2013 08:20:02 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.43 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.43; Received: by mail-vb0-f43.google.com with SMTP id p6so2853285vbe.2 for ; Mon, 23 Dec 2013 08:20:02 -0800 (PST) X-Received: by 10.58.146.5 with SMTP id sy5mr135549veb.43.1387815602595; Mon, 23 Dec 2013 08:20:02 -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 ey3csp238390ved; Mon, 23 Dec 2013 08:20:02 -0800 (PST) X-Received: by 10.14.2.73 with SMTP id 49mr22716329eee.15.1387815600671; Mon, 23 Dec 2013 08:20:00 -0800 (PST) Received: from mail-ea0-f180.google.com (mail-ea0-f180.google.com [209.85.215.180]) by mx.google.com with ESMTPS id e2si20771277eeg.9.2013.12.23.08.19.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Dec 2013 08:20:00 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.180 is neither permitted nor denied by best guess record for domain of taras.kondratiuk@linaro.org) client-ip=209.85.215.180; Received: by mail-ea0-f180.google.com with SMTP id f15so2440763eak.39 for ; Mon, 23 Dec 2013 08:19:59 -0800 (PST) X-Received: by 10.15.54.72 with SMTP id s48mr22261611eew.3.1387815599241; Mon, 23 Dec 2013 08:19:59 -0800 (PST) Received: from condor-x220.synapse.com ([195.238.93.36]) by mx.google.com with ESMTPSA id 1sm46940687eeg.4.2013.12.23.08.19.57 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Dec 2013 08:19:58 -0800 (PST) From: Taras Kondratiuk To: Jon Medhurst , Russell King , Ben Dooks , 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 5/5] ARM: kprobes-test: Workaround GAS .align bug Date: Mon, 23 Dec 2013 18:19:39 +0200 Message-Id: <1387815579-15677-6-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1387815579-15677-1-git-send-email-taras.kondratiuk@linaro.org> References: <1387815579-15677-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.212.43 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 96e3dbc..162828e 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" \