From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7891) id 51856385694E; Tue, 29 Aug 2023 04:33:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 51856385694E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1693283585; bh=kwh8Rnmmcj6ts7TFR9PF0GV0Gpigblbh5kBBlnNV2NQ=; h=From:To:Subject:Date:From; b=Skd+5ahje5b9cnHt0OZR7oAZdhDKhHWsKasSmRoWm3LhSmJBip5yJrVaj3spoVi8Z p495RkFukd7m/cdjzYvgOPivVw+kXn03GwG1ywSYIZiSFlBIJdpT/ZmO+EK2mc7g31 6EWLRpwbdZDnAjUoRgVabE7OI8uduHEedOzuqy+8= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Yinyu Cai To: glibc-cvs@sourceware.org Subject: [glibc] LoongArch: Remove support code for old linker in start.S X-Act-Checkin: glibc X-Git-Author: Xi Ruoyao X-Git-Refname: refs/heads/master X-Git-Oldrev: e757412c3e8a59cd93230414800250b38aeddf6c X-Git-Newrev: aac842d0edbe53a150ab57a4f776cb50294b6388 Message-Id: <20230829043305.51856385694E@sourceware.org> Date: Tue, 29 Aug 2023 04:33:05 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=aac842d0edbe53a150ab57a4f776cb50294b6388 commit aac842d0edbe53a150ab57a4f776cb50294b6388 Author: Xi Ruoyao Date: Sun Aug 27 00:36:50 2023 +0800 LoongArch: Remove support code for old linker in start.S We are requiring Binutils >= 2.41, so la.pcrel always works here. Signed-off-by: Xi Ruoyao Diff: --- sysdeps/loongarch/start.S | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/sysdeps/loongarch/start.S b/sysdeps/loongarch/start.S index e9d82033b7..bf6bfc9ea4 100644 --- a/sysdeps/loongarch/start.S +++ b/sysdeps/loongarch/start.S @@ -60,20 +60,7 @@ ENTRY (ENTRY_POINT) cfi_undefined (1) or a5, a0, zero /* rtld_fini */ -#if ENABLE_STATIC_PIE -/* For static PIE, the GOT cannot be used in _start because the GOT entries are - offsets instead of real addresses before __libc_start_main. - __libc_start_main and/or main may be not local, so we rely on the linker to - produce PLT entries for them. GNU ld >= 2.40 supports this. */ -# define LA la.pcrel -#else -/* Old GNU ld (< 2.40) cannot handle PC relative address against a non-local - function correctly. We deem these old linkers failing to support static PIE - and load the addresses from GOT. */ -# define LA la.got -#endif - - LA a0, t0, main + la.pcrel a0, t0, main REG_L a1, sp, 0 ADDI a2, sp, SZREG @@ -84,9 +71,9 @@ ENTRY (ENTRY_POINT) move a4, zero /* used to be fini */ or a6, sp, zero /* stack_end */ - LA ra, t0, __libc_start_main + la.pcrel ra, t0, __libc_start_main jirl ra, ra, 0 - LA ra, t0, abort + la.pcrel ra, t0, abort jirl ra, ra, 0 END (ENTRY_POINT)