From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by sourceware.org (Postfix) with ESMTPS id 50F2B3858430 for ; Mon, 10 Oct 2022 17:18:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 50F2B3858430 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=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 dfw.source.kernel.org (Postfix) with ESMTPS id 4120360FB1; Mon, 10 Oct 2022 17:18:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 813D6C433C1; Mon, 10 Oct 2022 17:18:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665422292; bh=CfKBNWo9HSr0qj5Nl1gePIdrMbFr2/it0+qzDlWENWY=; h=Date:From:To:Subject:From; b=VNOM9sIpO+Kb0FYFkWeffDHPC7tPAVJuPUBaE76lBf/+jRHVXD4HxYSoEjWL/peF7 CJWoMx6koxMGdTezEQqPn0jbkwOmaMouvFxwSyyPZ4zoJkGkXH/O/Kia25iTFCys4R 7Ld2XSF1I9zv4qI5DAAzRMUnbEviYREMfpl4uZt4qpRLjLJ+L2haetKVO5Etqf4So2 5c+DrhSLg9mnawThv7ZTpAODD7t0nAa280jw60HRRNR7eiXezKKT0YG6VmgNvuQcdR BFGk3t15wy6j5OweSsjKcg2YetwXSXb3jygg47Y9hQzq9fmP8KdbRDDdux2oumDyNI jZI97k2xmWt9Q== Received: by pali.im (Postfix) id 70D557F9; Mon, 10 Oct 2022 19:18:09 +0200 (CEST) Date: Mon, 10 Oct 2022 19:18:09 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: gcc@gcc.gnu.org, binutils@sourceware.org Subject: Error: attempt to get value of unresolved symbol `L0' Message-ID: <20221010171809.oqecrrdguv5hcta2@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20180716 X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello! During development and debugging of U-Boot bootloader I got strange error from ARM GNU assembler, which looks like a bug in binutils or gcc. Below is simplified code which can trigger it: $ cat test.S kernoffs: .word KERNEL_OFFSET - (. - CONFIG_SYS_TEXT_BASE) $ arm-linux-gnueabi-gcc -DKERNEL_OFFSET=0x40000 -DCONFIG_SYS_TEXT_BASE=0x80008000 -pipe -c test.S {standard input}: Assembler messages: {standard input}: Error: attempt to get value of unresolved symbol `L0' I do not use any L0 symbol in the code, so error message seems to be incorrect. And also I do not think that there is issue in that simple assembler code. On the other hand, if I declare negated value then compilation passes without any error/warning. Code is: kernoffs: .word . - CONFIG_SYS_TEXT_BASE - KERNEL_OFFSET It is quite strange that negated value can be compiled by gcc/as without issue here. I was told that I should report this issue, so I'm sending email to binutils and gcc mailing list. Do you have any idea where is the issue? It is a bug in gcc / as or is there some syntax / semantic error in that simple example? Just for the record I'm using standard ARM cross compiler available on Debian 10 Buster system. Here are version information: $ arm-linux-gnueabi-gcc -v Using built-in specs. COLLECT_GCC=arm-linux-gnueabi-gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/arm-linux-gnueabi/8/lto-wrapper Target: arm-linux-gnueabi Configured with: ../src/configure -v --with-pkgversion='Debian 8.3.0-2' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-multiarch --disable-sjlj-exceptions --with-arch=armv5te --with-float=soft --disable-werror --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=arm-linux-gnueabi --program-prefix=arm-linux-gnueabi- --includedir=/usr/arm-linux-gnueabi/include Thread model: posix gcc version 8.3.0 (Debian 8.3.0-2) $ arm-linux-gnueabi-as --version GNU assembler (GNU Binutils for Debian) 2.31.1 Copyright (C) 2018 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or later. This program has absolutely no warranty. This assembler was configured for a target of `arm-linux-gnueabi'.