From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 0C98D3858C20 for ; Tue, 11 Oct 2022 10:37:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0C98D3858C20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665484627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZmCJmV11BkGXldsv1noU9GLCNI0pKCyfPRiopuIXv2Q=; b=fDe9q5XRNi6jJi70PaBvUfUz0B+CS1rNxc4NyjSJ72ZZBpwPK4pXEUY5Hx6wQa9shvvz8v F1uVVD+x6s8dS018IaKUZehVpAs6dfs9GlFo/eFDfPTFj+01wBukCakkiWs6alFQeTTTGQ WQIgRalFSW/TIj1Km6sYBeMUDh2hQFA= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-215-za0co1X-Oq20rFKELVunZg-1; Tue, 11 Oct 2022 06:37:06 -0400 X-MC-Unique: za0co1X-Oq20rFKELVunZg-1 Received: by mail-wm1-f69.google.com with SMTP id k21-20020a7bc415000000b003b4fac53006so3592284wmi.3 for ; Tue, 11 Oct 2022 03:37:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:from:content-language :references:cc:to:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZmCJmV11BkGXldsv1noU9GLCNI0pKCyfPRiopuIXv2Q=; b=Wyj6hRQ5Y/d0rNVXmJ8MWEeSFZUVM1xOjBxkhWgSp/v8WZJQyntawph6ZSYgg6lFtT nmXt7RWX1G+xusf1obj0PhpfFmvnRm3nMO2fd5XWz1rKzH2/UHaXMgbjJ/3ZGBHUE1g6 BvOE8741iZdlvpfpiULDGFBuhoZ5lNeyuGKY6HA0+APpZagyEnUBFkK+CDf55Ls7OtiI 3D+ZxIX9gyN/FbHRRJx75b2FylWY1/r6kbwtcPiiXQlr5nrWnHFvNEG3XyDna+7Fu8Ta 5OJSUSo8KuV+HB9EqN6Y6NgCxDcB0f4Lv1yTng9gMBcAl8ojybwCKvLiKYqKRzEsWTp1 2DQQ== X-Gm-Message-State: ACrzQf16crCmDSvyu3aR1cbSumzAnK4a+Ru/ElBtMDiBheAcaBVOogAH QgH0AFfO/ep2mRh8oET25p7XY87xXb9mNu0OK5gJDKYh77o4dNBmD09K+lxVpXUv/Rn4Qoi1mX6 y1XXnDsg= X-Received: by 2002:a5d:58d6:0:b0:22e:7318:4e8f with SMTP id o22-20020a5d58d6000000b0022e73184e8fmr14852564wrf.578.1665484625303; Tue, 11 Oct 2022 03:37:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4OSueTkDW1vF8VqVV4MmHRTVOE7F68tP0O2h6BXilUufk2Zd7AsKo+ESLICjrVN1kVmOFnyg== X-Received: by 2002:a5d:58d6:0:b0:22e:7318:4e8f with SMTP id o22-20020a5d58d6000000b0022e73184e8fmr14852549wrf.578.1665484625113; Tue, 11 Oct 2022 03:37:05 -0700 (PDT) Received: from [192.168.1.18] (adsl-164-85.freeuk.com. [80.168.164.85]) by smtp.gmail.com with ESMTPSA id q18-20020a05600c2e5200b003c65c9a36dfsm5448822wmf.48.2022.10.11.03.37.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Oct 2022 03:37:04 -0700 (PDT) Message-ID: Date: Tue, 11 Oct 2022 11:37:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 To: =?UTF-8?Q?Pali_Roh=c3=a1r?= , Richard Biener Cc: gcc@gcc.gnu.org, binutils@sourceware.org References: <20221010171809.oqecrrdguv5hcta2@pali> <20221011074309.ojqoxwsosm6v7ozc@pali> From: Nick Clifton Subject: Re: Error: attempt to get value of unresolved symbol `L0' In-Reply-To: <20221011074309.ojqoxwsosm6v7ozc@pali> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-GB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,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: Hi Pali, Hi Richard, > Interesting... Another test case which is working fine: > > kernoffs: > .word 0x40000 - (. - 0x0) This works because this expression can be converted into an instruction and a relocation in the object file: % as t.s -o t.o % objdump -dr t.o Disassembly of section .text: 00000000 : 0: 0003fffc .word 0x0003fffc 0: R_ARM_REL32 *ABS* Which shows that when this object file is linked the word at offset 0 inside the .text section should be converted into an absolute value of (pc - 0x4000), where pc is the address of the word. This instruction however: .word - (. - 0x80008000) Cannot be converted since the linker would need to compute ((pc - 0x800800) * -1) which cannot be expressed by a single relocation. Similarly: .word KERNEL_OFFSET - (. - CONFIG_SYS_TEXT_BASE) Cannot be expressed by a single value, modified by a single relocation, even when the KERNEL_OFFSET and CONFIG_SYS_TEXT_BASE values are known at assembly time. A clever assembler might be able to rearrange the expression, assuming that overflow is unimportant, but gas does not do that. But just for reference the following would work: .word KERNEL_OFFSET + CONFIG_SYS_TEXT_BASE - . I agree however that this message: t.s: Error: attempt to get value of unresolved symbol `L0' is unhelpful. So I am going to check in a patch to change it to: t.s: Error: expression is too complex to be resolved I looked into providing a file name and line number with the error message, but this would involve reworking a lot of the assembler's internal expression parser. Cheers Nick