From patchwork Fri Sep 26 11:53:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jon Medhurst \(Tixy\)" X-Patchwork-Id: 37960 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 98F7B20F2E for ; Fri, 26 Sep 2014 11:55:39 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id gi9sf2190273lab.10 for ; Fri, 26 Sep 2014 04:55:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:subject:from:to:date :in-reply-to:references:mime-version:cc:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=1W2DjtyOtxjpw2cwSpmeU6vGQzEddWQirP9kRGftM54=; b=OT/ESQMM0EK+CGSXvn4lSzt4F84b8981cA9xQPimhb2Bj96uyVUd1te+y/u+qmblUi PbOHqqUdl6sdo+FZ/eo38UOnWMz1oiOs7xAp6cqwOSJ+OmxjfdLBXwjKkX0B8vjpn87j ZBWj2A6zqbJjInnP8j7emCccrfOKgKjCI+1GW3hPZKVxYmpwAixY71Jdd0bWg1lcLm2P CFyNmRAWaUB8dvCJPLzJmGzMMlTthYGI2D7o6GF4hEtWnKWuxw/1GypPbIg9Og6LHv4o d78Jz0YdwkuKe1BJKZ1HcrvMFWYtMJb4+RqLVfsGCT49rHSPOvXS/dyANbq+y7vUcZv0 a0Lg== X-Gm-Message-State: ALoCoQnZAFkGiXcZskRz0rzbs0QS10ODpz2vx9zXax72vABquwt15UsBCy9dXpjwtrQ8KcHgsvYK X-Received: by 10.152.2.97 with SMTP id 1mr544106lat.6.1411732538133; Fri, 26 Sep 2014 04:55:38 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.132 with SMTP id ay4ls372780lab.46.gmail; Fri, 26 Sep 2014 04:55:37 -0700 (PDT) X-Received: by 10.112.142.104 with SMTP id rv8mr18163806lbb.59.1411732537904; Fri, 26 Sep 2014 04:55:37 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) by mx.google.com with ESMTPS id dl3si6929389lbc.35.2014.09.26.04.55.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Sep 2014 04:55:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id gb8so4789017lab.16 for ; Fri, 26 Sep 2014 04:55:37 -0700 (PDT) X-Received: by 10.152.204.231 with SMTP id lb7mr19616547lac.44.1411732537804; Fri, 26 Sep 2014 04:55:37 -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.112.130.169 with SMTP id of9csp47094lbb; Fri, 26 Sep 2014 04:55:37 -0700 (PDT) X-Received: by 10.68.209.194 with SMTP id mo2mr30699430pbc.80.1411732536252; Fri, 26 Sep 2014 04:55:36 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id fn9si8871715pdb.160.2014.09.26.04.55.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Sep 2014 04:55:36 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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 1XXU5y-0005JO-BR; Fri, 26 Sep 2014 11:53:54 +0000 Received: from smarthost01c.mail.zen.net.uk ([212.23.1.5]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XXU5u-0005G7-Fw for linux-arm-kernel@lists.infradead.org; Fri, 26 Sep 2014 11:53:51 +0000 Received: from [82.69.122.217] (helo=linaro1) by smarthost01c.mail.zen.net.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XXU5W-0005Q5-Oh; Fri, 26 Sep 2014 11:53:26 +0000 Message-ID: <1411732406.1529.20.camel@linaro1.home> Subject: Re: Kprobes build failure From: "Jon Medhurst (Tixy)" To: Russell King - ARM Linux Date: Fri, 26 Sep 2014 12:53:26 +0100 In-Reply-To: <1411725443.1529.10.camel@linaro1.home> References: <20140925233720.GG5182@n2100.arm.linux.org.uk> <1411725443.1529.10.camel@linaro1.home> X-Mailer: Evolution 3.12.2-1+b1 Mime-Version: 1.0 X-Originating-smarthost01c-IP: [82.69.122.217] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140926_045350_707703_012E3908 X-CRM114-Status: GOOD ( 20.48 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [212.23.1.5 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [212.23.1.5 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: tixy@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.215.43 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 On Fri, 2014-09-26 at 10:57 +0100, Jon Medhurst (Tixy) wrote: > On Fri, 2014-09-26 at 00:37 +0100, Russell King - ARM Linux wrote: > > So, Olof's kbuild found this while building my rc5 based for-next tree: > > > > arm.allmodconfig: > > /tmp/ccoT403o.s:21439: Error: bad immediate value for offset (4168) > > /tmp/ccoT403o.s:21440: Error: bad immediate value for offset (4176) > > /tmp/ccoT403o.s:21475: Error: bad immediate value for offset (4260) > > /tmp/ccoT403o.s:21476: Error: bad immediate value for offset (4260) > > /tmp/ccoT403o.s:23566: Error: bad immediate value for offset (4132) > > /tmp/ccoT403o.s:23567: Error: bad immediate value for offset (4148) > > /tmp/ccoT403o.s:23606: Error: bad immediate value for offset (4236) > > /tmp/ccoT403o.s:23607: Error: bad immediate value for offset (4248) > > > > which, when looking at the logs, appears to be: > > > > /tmp/ccoT403o.s:47583: Error: bad immediate value for offset (5464) > > make[3]: *** [arch/arm/kernel/kprobes-test-arm.o] Error 1 > > make[3]: Target `__build' not remade because of errors. > > make[2]: *** [arch/arm/kernel] Error 2 > > > > Any ideas? > > Sounds vaguely familiar as a problem I hit before. Google finds someone > else hitting similar problem [1] and the symptoms and cause match my > memories of the old kprobe issue. > > Where can I find a clue of to the config and compiler used in Olof's > build, so I can have a go at reproducing and debugging? I've now reproduced this and the cause _is_ the problem mentioned at the bottom of this email because the following diff fixes the issue (now need to try and think of a nicer and more robust fix...) > > [1] https://lkml.org/lkml/2012/9/24/223 > > The relevant explanation of the above post copied below... > > ------------------------------------------------------------------------ > > The compiler uses a pretty dumb heuristic to guess the size of asms: > 4 * (number of ; or \n in the string) > > Directives that the compiler can't predict the size of are not safe if > they output into any segment that the compiler uses. .fill/.skip are > obvious candidates, but macro expansions, .rept, .irp etc. can cause > these problems too. > > For example: > > void g(int); > void f(void) > { > g(0xd00dfeed); > asm(".skip 0x1000"); > } > If you try building this with gcc -marm -Os for example: > > /tmp/ccXYm1uP.s: Assembler messages: > /tmp/ccXYm1uP.s:21: Error: bad immediate value for offset (4100) > > ...because the assembler assumes that it can dump a literal at the end > of the function and reference it from the g() callsite. > > ------------------------------------------------------------------------ > > diff --git a/arch/arm/kernel/kprobes-test.h b/arch/arm/kernel/kprobes-test.h index eecc90a..783072d 100644 --- a/arch/arm/kernel/kprobes-test.h +++ b/arch/arm/kernel/kprobes-test.h @@ -113,7 +113,7 @@ struct test_arg_end { "bl __kprobes_test_case_start \n\t" \ /* don't use .asciz here as 'title' may be */ \ /* multiple strings to be concatenated. */ \ - ".ascii "#title" \n\t" \ + ".ascii "#title";;;;;;;;;;;;;;;;;;;; \n\t" \ ".byte 0 \n\t" \ ".align 2, 0 \n\t"