From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 30F283939C2F for ; Tue, 22 Jun 2021 14:35:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 30F283939C2F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 41EF621970; Tue, 22 Jun 2021 14:35:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1624372539; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iFMpz5heir6OJ46Er9fhqAAPAUdlq+I2LXE4cdYFU9U=; b=1gouvZkrL/Pt7yBIQ770/XRx30LyxvtGCDeBHnC+YX9CD1MKQ6pIqm+MS8MITQTFfZoxg/ +yBUyRs8O39ljKXsMrF6+oTbRymy2i+DOUF5d9bmYpHM9IxA5cV3tD7R27eomJYGI9JnSa jPJEN7179ZicCPBpk854jbNuYEw/opQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1624372539; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iFMpz5heir6OJ46Er9fhqAAPAUdlq+I2LXE4cdYFU9U=; b=9C33P+JHcPRHx7/cQ0tPHt4TAjaRbZZYqelrOA2rdxAZTWxhcaZ8NmcSmcp9qMAAgERwdW h7AcIuKS7F6AQwDg== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 3DDECA3B84; Tue, 22 Jun 2021 14:35:39 +0000 (UTC) Received: by wotan.suse.de (Postfix, from userid 10510) id 364556537; Tue, 22 Jun 2021 14:35:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by wotan.suse.de (Postfix) with ESMTP id 34D666299; Tue, 22 Jun 2021 14:35:39 +0000 (UTC) Date: Tue, 22 Jun 2021 14:35:39 +0000 (UTC) From: Michael Matz To: "H.J. Lu" cc: Jan Beulich , Binutils Subject: Re: [PATCH 3/6] x86: harmonize disp with imm handling In-Reply-To: Message-ID: References: <0babbec4-06ae-f980-18a9-20608046891b@suse.com> <34a3a825-8c9f-d52b-9a1d-6cd45e051332@suse.com> <803f03a4-bb6d-5580-b2ff-b1df2d5152f3@suse.com> <9212df8b-01cf-0c0c-45c3-39de3dcf1bd9@suse.com> User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 14:35:41 -0000 Hello, On Tue, 22 Jun 2021, H.J. Lu wrote: > > All in all: I think the assembler should be entirely silent about any of > > these literals modified by assembler operations. > > A 32bit displacement is signed with R_X86_64_32S. For > > mov disp(%rax), %eax > > should linker issue an error if disp == -0xffffffff? The linker doesn't see '-0xffffffff', it sees a bit pattern that it interprets in some way as a single number. When we write down the bit pattern as unsigned hex, it will for instance see (in the above case when the width is 32bit and the assembler did the obvious thing) '1' (i.e. something that the linker can't differentiate from what was produced by the assembler on a simple literal '1' input). There is no unary minus operation on linker input. Ciao, Michael.