From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by sourceware.org (Postfix) with ESMTP id 0159D3858D33 for ; Tue, 6 Feb 2024 19:20:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0159D3858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=orcam.me.uk ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0159D3858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4190:8020::34 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707247217; cv=none; b=wLoo/UdeAW6xfw7YfEpA/yhEtf5ROJpWzGOwApZf2ue4mF7jxIJTXQ+TIlCNbjsBGcFWkjbHG6mBia21jFKEtcW2U9otzzkmrsJSHw3IK1Sjxd2hjMBMDYEaFIgnegyIRU19Z1v07c9H+6dBMFWILNwyI/fFckLUalwIuZ5ViPE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707247217; c=relaxed/simple; bh=XsCXZ2LVZsjo+Nbbblohol4mJdlfz2PCvb5yM398OYg=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=LL6SpOCdrh+szc/mlqRArfjJd1VxRfY5SSz8H4t5vHavOsL3UVuOBc1PuY4brUIppG8RRfa/kPiPGqbFZVMN9zwEbED/mfbCP5pObeNRjz6jdVfrGNizdsCUmVwN2piQBDnsMS6ExyrnShb0sHgyZxgZ2zLZFKEE/AxZfVKVgCc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by angie.orcam.me.uk (Postfix, from userid 500) id 25FD192009C; Tue, 6 Feb 2024 20:20:14 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 1EF3292009B; Tue, 6 Feb 2024 19:20:14 +0000 (GMT) Date: Tue, 6 Feb 2024 19:20:14 +0000 (GMT) From: "Maciej W. Rozycki" To: YunQiang Su cc: Nick Clifton , binutils@sourceware.org, xry111@xry111.site Subject: Re: [PATCH v4] MIPS/Gas: Disallow branch to absolute address for PIC In-Reply-To: <20240206170538.2937169-1-syq@gcc.gnu.org> Message-ID: References: <20240206170538.2937169-1-syq@gcc.gnu.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3488.5 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_INFOUSMEBIZ,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no 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, 7 Feb 2024, YunQiang Su wrote: > The asm code like > b (0) > will generate binary like: > > 00000000 <.text>: > 0: 1000ffff b 0x0 > 0: R_MIPS_PC16 *ABS* > 4: 00000000 nop > If this object is linked into an PIC/PIC dynamic executable, > this branch instruction will jump to a wrong address, with low > 16bit unset. NAK, `mips_pic' may be set to SVR4_PIC and still produce de facto non-PIC code, as per the original SVR4 MIPS ABI (with lazy binding stubs rather than PLT). We continue supporting this mode. Originally NO_PIC was intended for bare metal code only, statically linked only, which was later extended to Linux, etc. with the addition of PLT and copy reloc support. PR31343 has to be sorted in the linker. Maciej