From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by sourceware.org (Postfix) with ESMTPS id 51B823857734 for ; Thu, 13 Jul 2023 05:40:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 51B823857734 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-oi1-x235.google.com with SMTP id 5614622812f47-38e04d1b2b4so318072b6e.3 for ; Wed, 12 Jul 2023 22:40:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689226839; x=1691818839; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZDVWgtb0fF0XOPzLBzZlL8zawbcPI+6cFwDiPPbXhYg=; b=Kux5lAT+Wzsr0A9qTIbNZgEuBq/6Ix+84E2THhVGCQbrojKUXyAvb+FkohN9RmU5d/ JQj8L6fMfR0MwFJwR/TiV0qJdPDHgkpLNIrFZonL5E46QzDCdjznQ52nAFbKWy59PSDr r98AAGDyKC8CcfgGqrNG9ACK3SGGfy9Zpt399yc8aWNcUpyhLd6MV6NAcP5mlxeUJYaB NvRukO85BbedmRy44iLzKIYyClbsMq60UoMSvrASFePGV+hxm3blmMy0Xel6kpthjbZV /QGuz2awfC48/H9+Etj5ot3mCC3YzkISjKlKOc31vkKv/ohm5JUfEmgGHo3jsDuKu1HC Q9mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689226839; x=1691818839; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZDVWgtb0fF0XOPzLBzZlL8zawbcPI+6cFwDiPPbXhYg=; b=IIFf7NpEwzVzyZFkG8LzT6fcecwollBLTA6hMVf3eXukZouLWR5n7kX8MgHqaB6u/K b5bNhWd6p+hV/54dV8tpGova9wggCry8RmWpnwv9MLh7u2BfPpvH7h5eMer+R2RT067y 1rRShllLPdXFFGgmuxUxXjafLLq5vUnrx6THLmILYuJ2BlR49oAeRL6EqCZC1UbY+u/w ucnhsIGJx1QgJBzV+vdzH1aqdZo4TzjNok0x6FQl1phsc9khYH3ZWMQlepY0OT7/O1uS 1YTBsG2vVwOh/GyG03qesy9nWrDEZmpTL/MMY0TRvI0kOfPm6Q42lF+pYWesFZTWxr7T KWuQ== X-Gm-Message-State: ABy/qLZo181BP3COMIAKFPbV5zkJaAHSznUbpWJXNMzGXVcPThuRY8pA chsMQpzPBF0B2/16mhOSjX+C+zxNCj7dQbHEVqg= X-Google-Smtp-Source: APBJJlEFkNJRSozk1pOrF9gRdrWQ0Qy+3xljnh2OuqXxDu8bjkwkN9vC+EpuM4WMC9swYBKh4FqUZCkYK9whQ+1CHvo= X-Received: by 2002:a05:6358:9184:b0:125:a552:4389 with SMTP id j4-20020a056358918400b00125a5524389mr1208320rwa.22.1689226839157; Wed, 12 Jul 2023 22:40:39 -0700 (PDT) MIME-Version: 1.0 References: <20230630064559.2282365-1-yunqiang.su@cipunited.com> In-Reply-To: <20230630064559.2282365-1-yunqiang.su@cipunited.com> From: YunQiang Su Date: Thu, 13 Jul 2023 13:40:27 +0800 Message-ID: Subject: Re: [PATCH] MIPS: N64, mark .interp as INITIAL_READONLY_SECTIONS To: YunQiang Su , Nick Clifton Cc: binutils@sourceware.org, macro@orcam.me.uk Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: YunQiang Su =E4=BA=8E2023=E5=B9=B46=E6=9C=8830= =E6=97=A5=E5=91=A8=E4=BA=94 14:46=E5=86=99=E9=81=93=EF=BC=9A > > In ld/emulparams/elf64bmip-defs.sh, there is no .interp, which make > the .interp section appears after some other less important sections. > > Let's add it, and mark it as INITIAL_READONLY_SECTIONS, just like > O32/N32 do. > > This changes fixes ld/pr23658-2. > ping > ld/ChangeLog: > * emulparams/elf64bmip-defs.sh: mark .interp as > INITIAL_READONLY_SECTIONS. > * testsuite/ld-mips-elf/pie-n64.d: adjust addresses. > --- > ld/emulparams/elf64bmip-defs.sh | 6 +++++- > ld/testsuite/ld-mips-elf/pie-n64.d | 12 ++++++------ > 2 files changed, 11 insertions(+), 7 deletions(-) > > diff --git a/ld/emulparams/elf64bmip-defs.sh b/ld/emulparams/elf64bmip-de= fs.sh > index 4165f51e9e5..19d782d8e7a 100644 > --- a/ld/emulparams/elf64bmip-defs.sh > +++ b/ld/emulparams/elf64bmip-defs.sh > @@ -1,6 +1,10 @@ > source_sh ${srcdir}/emulparams/elf32bmipn32-defs.sh > COMMONPAGESIZE=3D"CONSTANT (COMMONPAGESIZE)" > -INITIAL_READONLY_SECTIONS=3D" > +INITIAL_READONLY_SECTIONS=3D > +if test -z "${CREATE_SHLIB}"; then > + INITIAL_READONLY_SECTIONS=3D".interp ${RELOCATING-0} : { *(.inte= rp) }" > +fi > +INITIAL_READONLY_SECTIONS=3D"${INITIAL_READONLY_SECTIONS} > .MIPS.abiflags ${RELOCATING-0} : { *(.MIPS.abiflags) } > .MIPS.xhash ${RELOCATING-0} : { *(.MIPS.xhash) } > .MIPS.options : { *(.MIPS.options) } > diff --git a/ld/testsuite/ld-mips-elf/pie-n64.d b/ld/testsuite/ld-mips-el= f/pie-n64.d > index bf7c6b2272a..1fda2512c8e 100644 > --- a/ld/testsuite/ld-mips-elf/pie-n64.d > +++ b/ld/testsuite/ld-mips-elf/pie-n64.d > @@ -2,16 +2,16 @@ > #ld: -pie > #readelf: -d > > -Dynamic section at offset 0x208 contains 17 entries: > +Dynamic section at offset 0x220 contains 17 entries: > Tag * Type * Name/Value > - 0x0+00000004 \(HASH\) * 0x368 > - 0x0+00000005 \(STRTAB\) * 0x3c8 > - 0x0+00000006 \(SYMTAB\) * 0x380 > + 0x0+00000004 \(HASH\) * 0x380 > + 0x0+00000005 \(STRTAB\) * 0x3e0 > + 0x0+00000006 \(SYMTAB\) * 0x398 > 0x0+0000000a \(STRSZ\) * 28 \(bytes\) > 0x0+0000000b \(SYMENT\) * 24 \(bytes\) > - 0x0+70000035 \(MIPS_RLD_MAP_REL\) * 0x101c8 > + 0x0+70000035 \(MIPS_RLD_MAP_REL\) * 0x101a0 > 0x0+00000015 \(DEBUG\) * 0x0 > - 0x0+00000003 \(PLTGOT\) * 0x10430 > + 0x0+00000003 \(PLTGOT\) * 0x10420 > 0x0+70000001 \(MIPS_RLD_VERSION\) * 1 > 0x0+70000005 \(MIPS_FLAGS\) * NOTPOT > 0x0+70000006 \(MIPS_BASE_ADDRESS\) * 0x0 > -- > 2.30.2 > --=20 YunQiang Su