From patchwork Mon Mar 16 09:31:44 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshinori Sato X-Patchwork-Id: 131780 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 6985C4B3588D for ; Mon, 16 Mar 2026 09:33:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6985C4B3588D Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=nifty.com header.i=@nifty.com header.a=rsa-sha256 header.s=default-1th84yt82rvi header.b=Z+sb1f5O X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mta-sp-w04.mail.nifty.com (mta-sp-w04.mail.nifty.com [106.153.228.36]) by sourceware.org (Postfix) with ESMTPS id 543464BC8976 for ; Mon, 16 Mar 2026 09:31:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 543464BC8976 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=nifty.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nifty.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 543464BC8976 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=106.153.228.36 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773653518; cv=none; b=El1RNM+YXxZv7BPzOD6cOVRgEcpeXPXACyrH9Fdfd70V1u68xz/i6vZ0D93duaGn/xiBwGkjzLUdsyc+lDkY4szCVDBm1k0jla4ojcpJDPWJkw5z2/gQLCFa3aL20GXyBvz8opeRnyvciVDkPwu8he5oUPbmx0zdNdhyP7k0Y9E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773653518; c=relaxed/simple; bh=0nKFRc5ph9BZ92rhYd6XUZxkhy8RtBxhvNKQ3yAkZjQ=; h=From:To:Subject:Date:Message-ID:MIME-Version:DKIM-Signature; b=ACMbAAVyn07DU1oS9XCVqKr/T6rFsg6OSTKEmGJuQYJ59xw950R4SS8FzLwW5vqyUTdjswrFaQ2XmVlkDSE2lgshSqQ4QLHbWOrJSwZ4zFXwuPA7oOkx+gerC/gk7NU4qxHgfbP1HCAIY6rW0ESVNBMtZ8u6NCPJR3XnTWzT/e4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 543464BC8976 Received: from mta-snd-w09.mail.nifty.com by mta-sp-w04.mail.nifty.com with ESMTP id <20260316093156636.XMPB.123589.mta-snd-w09.mail.nifty.com@nifty.com>; Mon, 16 Mar 2026 18:31:56 +0900 Received: from sakura.ysato.name by mta-snd-w09.mail.nifty.com with ESMTP id <20260316093156577.KRMR.116672.sakura.ysato.name@nifty.com>; Mon, 16 Mar 2026 18:31:56 +0900 Received: from SIOS1075.constellations.internal (ZM005235.ppp.dion.ne.jp [222.8.5.235]) by sakura.ysato.name (Postfix) with ESMTPSA id 41D061C02BC; Mon, 16 Mar 2026 18:31:56 +0900 (JST) From: Yoshinori Sato To: binutils@sourceware.org Cc: Yoshinori Sato Subject: [RFC PATCH v2 3/4] RX: ld rx-linux target FDPIC support Date: Mon, 16 Mar 2026 18:31:44 +0900 Message-ID: <20260316093151.360635-4-yoshinori.sato@nifty.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260316093151.360635-1-yoshinori.sato@nifty.com> References: <20260316093151.360635-1-yoshinori.sato@nifty.com> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=default-1th84yt82rvi; t=1773653516; bh=LGNNIFxLG0CLtHHQYJIo+JXIMnsMUHC59eU2ne6YqeY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Z+sb1f5OO9odtfrI4TBP1VW9MtrCiRpBm5ezdi8ZLzc+MSOnsYonhpKZcPQPLkd9vTVZvXwj vijQGmdYnTaWotwevQoR2jXeYbnDh775UDTm/a2CgxBuSmonJgD7WWRdqsFg968coa75MnuP7Z AIu0sU7n/I3SpnGRVjmPEy1/xvgEHYHyFjAnaJLCci8usP1yL+jW5y0Wo+M7e49dD9pkTpdd7A YTlw5BikZEcXhpnr6tbDrtNt6pLNSmm8+XhELANNyL/k5XDVb+SE5V9X57QaIkGsN0AdX207p2 NPELIwvXc3sM8vozOrUbFwBOOql+CcMnh3pX3KfAuYnmn9TQ== X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, SPF_PASS, TXREP, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org * emulparams/elf32rx_linux.sh: Add FDPIC sections. Signed-off-by: Yoshinori Sato --- ld/emulparams/elf32rx_linux.sh | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/ld/emulparams/elf32rx_linux.sh b/ld/emulparams/elf32rx_linux.sh index 3abe4165d56..aded467de7b 100644 --- a/ld/emulparams/elf32rx_linux.sh +++ b/ld/emulparams/elf32rx_linux.sh @@ -4,14 +4,26 @@ OUTPUT_FORMAT="elf32-rx-linux" # See also `include/elf/rx.h' TEXT_START_ADDR=0x10000000 ARCH=rx -ENTRY=start -EMBEDDED=yes +ENTRY=_start TEMPLATE_NAME=elf EXTRA_EM_FILE=rxlinux ELFSIZE=32 -MAXPAGESIZE=256 +MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" +COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)" +GENERATE_SHLIB_SCRIPT=yes +GENERATE_PIE_SCRIPT=yes +# mul #1, r0 +NOP=0x76100100 +NO_SMALL_DATA=yes -STACK_ADDR="(DEFINED(__stack) ? __stack : 0xbffffffc)" -STACK_SENTINEL="LONG(0xdeaddead)" -# We do not need .stack for shared library. -test -n "$CREATE_SHLIB" && unset STACK_ADDR +GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got) *(.got.funcdesc) *(.got.plt) } }" +OTHER_GOT_RELOC_SECTIONS=" + .rela.got.funcdesc ${RELOCATING-0} : { *(.rela.got.funcdesc) } +" +OTHER_READONLY_SECTIONS=" + .rofixup : { + ${RELOCATING+__ROFIXUP_LIST__ = .;} + *(.rofixup) + ${RELOCATING+__ROFIXUP_END__ = .;} + } +"