From: "Wang, Yanzhang" <yanzhang.wang@intel.com>
To: Palmer Dabbelt <palmer@dabbelt.com>,
"libc-alpha@sourceware.org" <libc-alpha@sourceware.org>
Cc: "libc-alpha@sourceware.org" <libc-alpha@sourceware.org>
Subject: RE: [PATCH] RISC-V: Enable static-pie.
Date: Sun, 13 Aug 2023 12:20:05 +0000 [thread overview]
Message-ID: <IA1PR11MB64666505A9583172D323D8EBF216A@IA1PR11MB6466.namprd11.prod.outlook.com> (raw)
In-Reply-To: <mhng-4886a75d-aa8c-4223-9f24-809061e19d39@palmer-ri-x1c9a>
Hi Palmer,
I have tested the commit(542b110585) with this patch. The results like below,
Summary of test results:
189 FAIL
4328 PASS
101 UNSUPPORTED
16 XFAIL
2 XPASS
And the commit(542b110585)'s results like below,
Summary of test results:
189 FAIL
4326 PASS
101 UNSUPPORTED
16 XFAIL
2 XPASS
The binutils's commit is 2db20b97f1d and gcc's commit is bf36656a14a.
I use the command make check-glibc-linux in riscv-gnu-toolchain. Not sure is
that acceptable.
Thanks,
Yanzhang
> -----Original Message-----
> From: Palmer Dabbelt <palmer@dabbelt.com>
> Sent: Friday, August 11, 2023 9:58 AM
> To: libc-alpha@sourceware.org; Wang, Yanzhang <yanzhang.wang@intel.com>
> Cc: libc-alpha@sourceware.org
> Subject: Re: [PATCH] RISC-V: Enable static-pie.
>
> On Thu, 10 Aug 2023 16:33:48 PDT (-0700), libc-alpha@sourceware.org wrote:
> > From: Yanzhang Wang <yanzhang.wang@intel.com>
> >
> > This patch referents the commit 374cef3 to add static-pie support. And
> > because the dummy link map is used when relocating ourselves, so need
> > not to set __global_pointer$ at this time.
>
> Do you have test results? IIRC the only reason we didn't enable this when
> submitting the original port was because we didn't have time to test it.
> If it's passing a reasonable amount of the tests it's fine with me, but we
> need to at least look because there could be lurking issues.
>
> > ---
> > sysdeps/riscv/configure | 2 ++
> > sysdeps/riscv/configure.ac | 3 +++
> > sysdeps/riscv/dl-machine.h | 2 +-
> > 3 files changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/sysdeps/riscv/configure b/sysdeps/riscv/configure index
> > 2372225a26..340163779f 100644
> > --- a/sysdeps/riscv/configure
> > +++ b/sysdeps/riscv/configure
> > @@ -29,3 +29,5 @@ fi
> > $as_echo "$libc_cv_riscv_r_align" >&6; } config_vars="$config_vars
> > riscv-r-align = $libc_cv_riscv_r_align"
> > +
> > +$as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h
> > diff --git a/sysdeps/riscv/configure.ac b/sysdeps/riscv/configure.ac
> > index dbcc216689..36da2b5396 100644
> > --- a/sysdeps/riscv/configure.ac
> > +++ b/sysdeps/riscv/configure.ac
> > @@ -16,3 +16,6 @@ EOF
> > fi
> > rm -rf conftest.*])
> > LIBC_CONFIG_VAR([riscv-r-align], [$libc_cv_riscv_r_align])
> > +
> > +dnl Static PIE is supported.
> > +AC_DEFINE(SUPPORT_STATIC_PIE)
> > diff --git a/sysdeps/riscv/dl-machine.h b/sysdeps/riscv/dl-machine.h
> > index c0c9bd93ad..ad875c0828 100644
> > --- a/sysdeps/riscv/dl-machine.h
> > +++ b/sysdeps/riscv/dl-machine.h
> > @@ -323,7 +323,7 @@ elf_machine_runtime_setup (struct link_map *l, struct
> r_scope_elem *scope[],
> > gotplt[1] = (ElfW(Addr)) l;
> > }
> >
> > - if (l->l_type == lt_executable)
> > + if (l->l_type == lt_executable && l->l_scope != NULL)
> > {
> > /* The __global_pointer$ may not be defined by the linker if the
> > $gp register does not be used to access the global variable
next prev parent reply other threads:[~2023-08-13 12:20 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-10 23:33 yanzhang.wang
2023-08-11 1:57 ` Palmer Dabbelt
2023-08-13 12:20 ` Wang, Yanzhang [this message]
2023-08-15 11:46 ` Adhemerval Zanella Netto
2023-09-09 3:17 ` Wang, Yanzhang
2023-09-09 3:30 ` Palmer Dabbelt
2023-09-09 6:54 ` Wang, Yanzhang
2023-09-11 14:14 ` Palmer Dabbelt
2023-09-11 13:34 ` Darius Rad
2023-09-11 17:28 ` DJ Delorie
2023-09-11 16:17 ` Adhemerval Zanella Netto
2023-09-20 13:36 ` Palmer Dabbelt
2023-09-21 13:47 ` Wang, Yanzhang
2023-10-17 8:28 ` Wang, Yanzhang
2023-10-17 13:42 ` Adhemerval Zanella Netto
2023-10-24 5:59 ` Wang, Yanzhang
2023-10-24 11:39 ` Adhemerval Zanella Netto
2023-10-26 3:30 ` Wang, Yanzhang
2023-08-14 13:12 ` Carlos O'Donell
2023-08-15 1:48 ` Wang, Yanzhang
2023-08-15 1:44 ` [PATCH v2] " yanzhang.wang
2023-12-17 13:16 ` Wang, Yanzhang
2023-12-19 17:44 ` Adhemerval Zanella Netto
2024-01-02 11:02 ` Wang, Yanzhang
2024-01-02 10:54 ` [PATCH v3] " yanzhang.wang
2024-01-02 18:30 ` Adhemerval Zanella Netto
2024-01-17 12:23 ` Andreas Schwab
2024-01-29 12:46 ` Andreas Schwab
2024-02-01 12:39 ` Wang, Yanzhang
2024-02-01 12:53 ` Andreas Schwab
2024-05-21 11:13 ` Maciej W. Rozycki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=IA1PR11MB64666505A9583172D323D8EBF216A@IA1PR11MB6466.namprd11.prod.outlook.com \
--to=yanzhang.wang@intel.com \
--cc=libc-alpha@sourceware.org \
--cc=palmer@dabbelt.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).