From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by sourceware.org (Postfix) with ESMTPS id 1250C385828E for ; Sun, 16 Oct 2022 10:20:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1250C385828E 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 ams.source.kernel.org (Postfix) with ESMTPS id 7C3BAB809E3; Sun, 16 Oct 2022 10:20:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9FFAC433D6; Sun, 16 Oct 2022 10:20:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665915650; bh=1lW5Hxeg2t15j8Jxbvl5u9zZvsfF3Q5DXkWYCQWPOsc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=G4sIZoGpRDAAPjvzUjG1kvQEZUwP3G8H/MjcL0GZbiZbbsK01opJSslXe+hKr0I8G MK0gs4z65FPxQuQCW8LrIpuVc2TEH3UyKoTgVVzY02uEywi3G768+zAhNx8+ezgjXb KMFfdH89iYFGQOUmD+lESzL+FpvVxoTz9tsfoVFFhMofKEEPMf2OzTEf2SURWuW/m8 RiJLbXv8tfnOmf+7CcTp9UfPN/nGF+Jeedx5zhnZXFt7vffPG+ulH0qLL/yqd9D+30 ohz2PaxTaRvkM4944cyHsv1aSvYCtF/39/qcwT3s+s4+c11QITg6UYJkqJP5OzqLgS eW7pHQPTmZ59w== Received: by pali.im (Postfix) id B4F39A3A; Sun, 16 Oct 2022 12:20:46 +0200 (CEST) Date: Sun, 16 Oct 2022 12:20:46 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Nick Clifton Cc: Richard Biener , gcc@gcc.gnu.org, binutils@sourceware.org Subject: Re: Error: attempt to get value of unresolved symbol `L0' Message-ID: <20221016102046.3xiamrza6n73npiy@pali> References: <20221010171809.oqecrrdguv5hcta2@pali> <20221011074309.ojqoxwsosm6v7ozc@pali> <20221011105714.r5x7x4x5xsi7o7pz@pali> <5d886f55-0efa-0d0c-8edc-26cfe5cd4d09@redhat.com> <20221011170755.zkugr3ag27jghpcm@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221011170755.zkugr3ag27jghpcm@pali> User-Agent: NeoMutt/20180716 X-Spam-Status: No, score=-3.3 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: On Tuesday 11 October 2022 19:07:55 Pali Rohár wrote: > On Tuesday 11 October 2022 15:33:59 Nick Clifton wrote: > > Hi Pali, Hi Richard, > > > > > Having file name and line number would be also useful as it took me > > > some time to figure out where is the issue... > > > > Right - I have tried a little harder and come up with a follow up patch. > > This is now checked in, and given an input file that looks like this: > > > > % cat t.s > > kernoff: > > .set KERNEL_OFFSET, 0x40000 > > .set CONFIG_SYS_TEXT_BASE, 0x80008000 > > .word 44 > > .word KERNEL_OFFSET - (. - CONFIG_SYS_TEXT_BASE) > > .word - (. - 0x80008000) > > .word 0x40000 - (. - 0x0) > > > > The assembler now produces the following output: > > > > t.s: Assembler messages: > > t.s:5: Error: expression is too complex to be resolved or converted into relocations > > t.s:6: Error: expression is too complex to be resolved or converted into relocations > > > > Note - some targets do support applying multiple relocations to a > > single address, but even then there can be expressions that cannot > > be resolved this way. That is why the error message refers to > > "converted into relocations" rather than just "converted into a > > relocation". > > > > Cheers > > Nick > > > > Nice! > > Anyway, what should I use in code? > > .word . - CONFIG_SYS_TEXT_BASE - KERNEL_OFFSET > > or > > .word CONFIG_SYS_TEXT_BASE + KERNEL_OFFSET - . > > And can you guarantee that one of those form would work also in future > gcc/binutils versions, and it is not something version specific or > undocumented? Hello Nick, could you clarify which option should I use? And could you extend documentation about Dot symbol usage, what is supported, what not, to make it clear? https://sourceware.org/binutils/docs/as/Dot.html