From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 12459C433FE for ; Sun, 9 Oct 2022 19:37:48 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AFE9184ED2; Sun, 9 Oct 2022 21:37:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="Ih4fIf46"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4F67284ED3; Sun, 9 Oct 2022 21:37:43 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8FE4084D7A for ; Sun, 9 Oct 2022 21:37:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 412EAB80B02; Sun, 9 Oct 2022 19:37:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF2DDC433C1; Sun, 9 Oct 2022 19:37:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665344258; bh=HEAl3XQk+DIaHNggS9PHaadr5Rv/KRr09UlPSFT34Ag=; h=From:To:Subject:Date:From; b=Ih4fIf46F0lxOde0w+28l/FbRLDqijzi3rGj6PfDPdTHd3CwDF+XwnWwchG6rjFsn ohj49ypKcZiC3CZ3vy6+LYjyRyw8OeXFMEhV1qUZrVCwbwIhqjYUdMIWDz8wQJkGUq EO4HqjiZYYaLMzHP1mSAx6FXhknkSs1SXMLJhZYPxgU/ZMcT4FisbWyfCa4vdSZRCr xneyYgDysQQXmahNzMkyRYkbSmg0ZPKAcT3wEG79/TVz0LId02VT06BKyiGxM/15xf O4BLzd2xUqMuE0jr7U3ahL6w1PZTtQq1NxDDAbAbmtzzH8J1Yzi1TLtVRDJyNOxjQt iFbNqpWxups0w== Received: by pali.im (Postfix) id 1AA667C1; Sun, 9 Oct 2022 21:37:36 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: u-boot@lists.denx.de, maemo-leste@lists.dyne.org Subject: [PATCH] Nokia RX-51: Fix compilation with non-zero CONFIG_SYS_TEXT_BASE Date: Sun, 9 Oct 2022 21:37:13 +0200 Message-Id: <20221009193713.12765-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean For some unknown reason GNU assembler version 2.31.1 (arm-linux-gnueabi-as from Debian Buster) cannot compile following code from located in file board/nokia/rx51/lowlevel_init.S: kernoffs: .word KERNEL_OFFSET - (. - CONFIG_SYS_TEXT_BASE) when CONFIG_SYS_TEXT_BASE is set to 0x80008000. It throws strange compile error which is even without line number: AS board/nokia/rx51/lowlevel_init.o {standard input}: Assembler messages: {standard input}: Error: attempt to get value of unresolved symbol `L0' make[2]: *** [scripts/Makefile.build:293: board/nokia/rx51/lowlevel_init.o] Error 1 I have no idea about this error and my experiments showed that ARM GNU assembler is happy with negation of that number. So changing code to: kernoffs: .word . - CONFIG_SYS_TEXT_BASE - KERNEL_OFFSET and then replacing mathematical addition by substraction of "kernoffs" value (so calculation of address does not change) compiles assembler file without any error now. There should be not any functional change. Signed-off-by: Pali Rohár --- Btw, is somebody understanding that compile error message? Is there (or was there) some real issue in the code, so assembler refuse to compile it? Or have I triggered bug in GNU assembler? --- board/nokia/rx51/lowlevel_init.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/nokia/rx51/lowlevel_init.S b/board/nokia/rx51/lowlevel_init.S index 1cf8f8d8b2f7..4b66e0a86140 100644 --- a/board/nokia/rx51/lowlevel_init.S +++ b/board/nokia/rx51/lowlevel_init.S @@ -7,7 +7,7 @@ #include kernoffs: /* offset of kernel image from this address */ - .word KERNEL_OFFSET - (. - CONFIG_SYS_TEXT_BASE) + .word . - CONFIG_SYS_TEXT_BASE - KERNEL_OFFSET kernaddr: /* address of kernel after copying */ .word KERNEL_ADDRESS @@ -49,7 +49,7 @@ save_boot_params: /* r0 - start of kernel before */ adr r0, kernoffs /* r0 - current address of kernoffs section */ ldr r1, kernoffs /* r1 - offset of kernel image from kernoffs section */ - add r0, r0, r1 + sub r0, r0, r1 /* r3 - start of kernel after */ ldr r3, kernaddr -- 2.20.1