From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id D72D13858D28 for ; Wed, 18 Jan 2023 05:52:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D72D13858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x42b.google.com with SMTP id w2so9940565pfc.11 for ; Tue, 17 Jan 2023 21:52:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=jjeHqbhCpvpF59SnmsUQYHnl8oHS23MnFYXXYFUqfPA=; b=DyHEn/mNtLipO6RRuAXVNir2qW9UQQNHmarBc+wD5V8xYi9Dv1z7Ape11spPMZM77B 2wEyz1a0oZ1m8Ggbmj0PSHUIciAZ7ws8wc4EC6rSzf0p9T6HFlQqZe2qZwI2ctbwKqjx +HWR7SsR79oPHpE81lMlNX1fqsk7uui0jUKbivRpIu710YJQ+IFkl5IMa0qtTeuiJZEj 35U3yJnB8rS87XfbU1NB8MyVHeCVPkrtYWk/ssLMmSBhxfuUlH9rYsNYh5+37Zbi6P1L dueJBfT+BIGAieIzzRXWSuv8XwTrTfLR64HNU8EPB9e8/rs2yqrz5otwGvO9F7KL7rpH q3Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jjeHqbhCpvpF59SnmsUQYHnl8oHS23MnFYXXYFUqfPA=; b=i8LcXZiLuMdkNrAO/whwXqE8aY3aHNhaVO1RxjhXQpc8IJ0C/hqW06YrRoNy8grjfA uMeUyp/bZg+DX7nJSnTKfUFxPZt13aNZTXn4iW43M30yThioOhw5VoYDxDQpDkxFL3pV Z6OX3fPuUXDxTZTZRxoSzVPE/9dfyCPco7NpDpDwIJoRcBEmGRO+N/JakpG4+WHHQLcI qbgUr8pJPbfk4+iqcfjvsf400YQWvXTJQIMaUcJ1WEBYI5ATqJHGUJHlqJjaWGet/nx6 qAiP5xmKPljas7K5rIHFYLsRKLiopvbs0huiqVnVsTogBFJHfzYo9bZTgdesvdhwqe3Q NGTQ== X-Gm-Message-State: AFqh2kr93hIWmO61huclQuHcVj6KgekQ9rBdYC3g3SlC+DLYlY4FA1xs 8W2vQ1p2Lu2IiIOt4FzeyJFlRiYZqzQ= X-Google-Smtp-Source: AMrXdXsJdjV7GwEPn7cvk/BK+x00CmfteuWtLMwHJ/HQRja2dUppiJ8DPOHGZgT84me6RmV9VijqtA== X-Received: by 2002:a62:6492:0:b0:58d:90ae:495c with SMTP id y140-20020a626492000000b0058d90ae495cmr5784489pfb.11.1674021119701; Tue, 17 Jan 2023 21:51:59 -0800 (PST) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:195b:3277:b45:6442]) by smtp.gmail.com with ESMTPSA id r15-20020aa79ecf000000b0056c2e497b02sm5767694pfq.173.2023.01.17.21.51.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jan 2023 21:51:59 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id C518E1141AA8; Wed, 18 Jan 2023 16:21:56 +1030 (ACDT) Date: Wed, 18 Jan 2023 16:21:56 +1030 From: Alan Modra To: Mark Harmstone Cc: binutils@sourceware.org Subject: Re: Correct ld-pe/aarch64.d test output Message-ID: References: <7a7c6672-63ff-ce28-25c2-0f6867565096@harmstone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7a7c6672-63ff-ce28-25c2-0f6867565096@harmstone.com> X-Spam-Status: No, score=-3027.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham 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 Wed, Jan 18, 2023 at 04:35:49AM +0000, Mark Harmstone wrote: > Thanks Alan, I'll have a look. I've tested it with llvm-mc and lld, and it does match what you've got there. > > The object files were the same, except that llvm-mc doesn't issue relocations for relative jumps within the same file. So it's a linking problem rather than an assembling problem. > > > Is is really a sensible addend with no symbol value confounding? > > Sorry, could you please explain what you mean by this? I'm not sure what "confounding" means in this context. I mean that many older COFF targets install a combination of the symbol value and addend in the insn field, almost as if the insn has been relocated as it would be on final linking, using symbol values as they are in the relocatable object file. So the section contents don't just have the relocation addend if the relocation is against symbols defined in that object. What do existing PE assemblers do in that case? See the comment I added recently to bfd/coffcode.h above CALC_ADDEND, and notice the subtraction of symbol section vma and symbol value in that macro. -- Alan Modra Australia Development Lab, IBM