Message ID | mvmlfxefbqq.fsf@suse.de |
---|---|
State | Committed |
Commit | 484b7af3ccb782ccb3491b541a68de9c5d6f063b |
Headers |
Received: (qmail 23680 invoked by alias); 4 Jul 2019 08:24:49 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 23671 invoked by uid 89); 4 Jul 2019 08:24:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.suse.de From: Andreas Schwab <schwab@suse.de> To: libc-alpha@sourceware.org Subject: [PATCH] riscv: restore ABI compatibility (bug 24484) X-Yow: Ask me the DIFFERENCE between PHIL SILVERS and ALEXANDER HAIG!! Date: Thu, 04 Jul 2019 10:24:45 +0200 Message-ID: <mvmlfxefbqq.fsf@suse.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain |
Commit Message
Andreas Schwab
July 4, 2019, 8:24 a.m. UTC
The contents of the dynamic section are part of the ABI, thus DL_RO_DYN_SECTION cannot be changed. [BZ #24484] * sysdeps/riscv/ldsodefs.h (DL_RO_DYN_SECTION): Define. --- sysdeps/riscv/ldsodefs.h | 5 +++++ 1 file changed, 5 insertions(+)
Comments
* Andreas Schwab: > The contents of the dynamic section are part of the ABI, thus > DL_RO_DYN_SECTION cannot be changed. > > [BZ #24484] > * sysdeps/riscv/ldsodefs.h (DL_RO_DYN_SECTION): Define. > --- > sysdeps/riscv/ldsodefs.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/sysdeps/riscv/ldsodefs.h b/sysdeps/riscv/ldsodefs.h > index 5ec607e867..d7531b707a 100644 > --- a/sysdeps/riscv/ldsodefs.h > +++ b/sysdeps/riscv/ldsodefs.h > @@ -38,6 +38,11 @@ struct La_riscv_retval; > struct La_riscv_retval *, \ > const char *); > > +/* Although the RISC-V ABI does not specify that the dynamic section has > + to be read-only, it needs to be kept for ABI compatibility. */ > + > +#define DL_RO_DYN_SECTION 1 Perhaps indicate somewhere that “a read-only dynamic section is not relocated by the loader” or something like that, so that someone not familiar with the MIPS mechanism understands the ABI difference? I agree that restoring the #define is probably necessary at this point. 8-( Thanks, Florian
On Thu, Jul 4, 2019 at 4:24 PM Andreas Schwab <schwab@suse.de> wrote: > The contents of the dynamic section are part of the ABI, thus > DL_RO_DYN_SECTION cannot be changed. > > [BZ #24484] > * sysdeps/riscv/ldsodefs.h (DL_RO_DYN_SECTION): Define. This is OK with me, though I'm not a glibc maintainer. Jim
On Jul 04 2019, Florian Weimer <fweimer@redhat.com> wrote: > Perhaps indicate somewhere that “a read-only dynamic section is not > relocated by the loader” or something like that, so that someone not > familiar with the MIPS mechanism understands the ABI difference? I think we should make DL_RO_DYN_SECTION the default for new ports, like everyone else does. Andreas.
On Thu, Jul 4, 2019 at 4:28 PM Florian Weimer <fweimer@redhat.com> wrote: > Perhaps indicate somewhere that “a read-only dynamic section is not > relocated by the loader” or something like that, so that someone not > familiar with the MIPS mechanism understands the ABI difference? You could point at the D_PTR macro definition in sysdeps/generic/ldsodefs.h. Or if you want a user code example there is https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libphobos/libdruntime/gcc/sections/elf_shared.d;h=7f9036bf5052861960f8a1d4a20838437c5c519c;hb=HEAD#l758 Jim
On 04/07/2019 09:37, Andreas Schwab wrote: > On Jul 04 2019, Florian Weimer <fweimer@redhat.com> wrote: > >> Perhaps indicate somewhere that “a read-only dynamic section is not >> relocated by the loader” or something like that, so that someone not >> familiar with the MIPS mechanism understands the ABI difference? > > I think we should make DL_RO_DYN_SECTION the default for new ports, like > everyone else does. then DT_DEBUG does not work. there is some mips hack to make it work. i suspect the debug abi is broken on riscv now.
On Jul 04 2019, Szabolcs Nagy <Szabolcs.Nagy@arm.com> wrote: > On 04/07/2019 09:37, Andreas Schwab wrote: >> On Jul 04 2019, Florian Weimer <fweimer@redhat.com> wrote: >> >>> Perhaps indicate somewhere that “a read-only dynamic section is not >>> relocated by the loader” or something like that, so that someone not >>> familiar with the MIPS mechanism understands the ABI difference? >> >> I think we should make DL_RO_DYN_SECTION the default for new ports, like >> everyone else does. > > then DT_DEBUG does not work. In which way? > i suspect the debug abi is broken on riscv now. I don't think so. Andreas.
On 04/07/2019 13:31, Andreas Schwab wrote: > On Jul 04 2019, Szabolcs Nagy <Szabolcs.Nagy@arm.com> wrote: > >> On 04/07/2019 09:37, Andreas Schwab wrote: >>> On Jul 04 2019, Florian Weimer <fweimer@redhat.com> wrote: >>> >>>> Perhaps indicate somewhere that “a read-only dynamic section is not >>>> relocated by the loader” or something like that, so that someone not >>>> familiar with the MIPS mechanism understands the ABI difference? >>> >>> I think we should make DL_RO_DYN_SECTION the default for new ports, like >>> everyone else does. >> >> then DT_DEBUG does not work. > > In which way? so is .dynamic actually mapped readonly? or is this DL_RO_DYN_SECTION just about the 'relocated DT_ entries' abi? if it's ro then ldso cannot set DT_DEBUG that the debugger looks at. i think on mips the debugger looks at a different tag that has an indirection. >> i suspect the debug abi is broken on riscv now. > > I don't think so. > > Andreas. >
On Jul 04 2019, Szabolcs Nagy <Szabolcs.Nagy@arm.com> wrote: > On 04/07/2019 13:31, Andreas Schwab wrote: >> On Jul 04 2019, Szabolcs Nagy <Szabolcs.Nagy@arm.com> wrote: >> >>> On 04/07/2019 09:37, Andreas Schwab wrote: >>>> On Jul 04 2019, Florian Weimer <fweimer@redhat.com> wrote: >>>> >>>>> Perhaps indicate somewhere that “a read-only dynamic section is not >>>>> relocated by the loader” or something like that, so that someone not >>>>> familiar with the MIPS mechanism understands the ABI difference? >>>> >>>> I think we should make DL_RO_DYN_SECTION the default for new ports, like >>>> everyone else does. >>> >>> then DT_DEBUG does not work. >> >> In which way? > > so is .dynamic actually mapped readonly? No. You would have to reorganize the segments to be able to do that. > or is this DL_RO_DYN_SECTION just about the 'relocated DT_ entries' abi? Yes. Andreas.
On Thu, 04 Jul 2019 01:24:45 PDT (-0700), schwab@suse.de wrote: > The contents of the dynamic section are part of the ABI, thus > DL_RO_DYN_SECTION cannot be changed. > > [BZ #24484] > * sysdeps/riscv/ldsodefs.h (DL_RO_DYN_SECTION): Define. > --- > sysdeps/riscv/ldsodefs.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/sysdeps/riscv/ldsodefs.h b/sysdeps/riscv/ldsodefs.h > index 5ec607e867..d7531b707a 100644 > --- a/sysdeps/riscv/ldsodefs.h > +++ b/sysdeps/riscv/ldsodefs.h > @@ -38,6 +38,11 @@ struct La_riscv_retval; > struct La_riscv_retval *, \ > const char *); > > +/* Although the RISC-V ABI does not specify that the dynamic section has > + to be read-only, it needs to be kept for ABI compatibility. */ > + > +#define DL_RO_DYN_SECTION 1 > + > #include_next <ldsodefs.h> > > #endif Sorry, I thought I'd committed this already. You're welcome to commit, my email is still a mess. Thanks for picking this up!
diff --git a/sysdeps/riscv/ldsodefs.h b/sysdeps/riscv/ldsodefs.h index 5ec607e867..d7531b707a 100644 --- a/sysdeps/riscv/ldsodefs.h +++ b/sysdeps/riscv/ldsodefs.h @@ -38,6 +38,11 @@ struct La_riscv_retval; struct La_riscv_retval *, \ const char *); +/* Although the RISC-V ABI does not specify that the dynamic section has + to be read-only, it needs to be kept for ABI compatibility. */ + +#define DL_RO_DYN_SECTION 1 + #include_next <ldsodefs.h> #endif