* Re: [PATCH] elf: Disable some subtests of ifuncmain1, ifuncmain5 for !PIE [not found] <87fseyy3s7.fsf@oldenburg.str.redhat.com> @ 2024-05-09 21:24 ` Sunil Pandey 2024-05-09 21:27 ` H.J. Lu 2024-05-09 21:30 ` Florian Weimer 0 siblings, 2 replies; 4+ messages in thread From: Sunil Pandey @ 2024-05-09 21:24 UTC (permalink / raw) To: Florian Weimer, Hongjiu Lu, Libc-stable Mailing List; +Cc: GNU C Library [-- Attachment #1: Type: text/plain, Size: 2717 bytes --] I would like to backport this patch to release branches(from 2.33 to 2.28) Any comments or objections? --Sunil On Fri, Nov 4, 2022 at 11:27 AM Florian Weimer via Libc-alpha < libc-alpha@sourceware.org> wrote: > Tested on i686-linux-gnu, x86_64-linux-gnu (with glibc defaults on a > toolchain which is not PIE-by-default). Built with build-many-glibcs.py > defaults (so GCC 12 and binutils 2.39). The x86 failures are gone. > > --- > elf/ifuncmain1.c | 13 +++++++++++++ > elf/ifuncmain5.c | 9 +++++++++ > 2 files changed, 22 insertions(+) > > diff --git a/elf/ifuncmain1.c b/elf/ifuncmain1.c > index 747fc02648..6effce3d77 100644 > --- a/elf/ifuncmain1.c > +++ b/elf/ifuncmain1.c > @@ -19,7 +19,14 @@ typedef int (*foo_p) (void); > #endif > > foo_p foo_ptr = foo; > + > +/* Address-significant access to protected symbols is not supported in > + position-dependent mode on several architectures because GCC > + generates relocations that assume that the address is local to the > + main program. */ > +#ifdef __PIE__ > foo_p foo_procted_ptr = foo_protected; > +#endif > > extern foo_p get_foo_p (void); > extern foo_p get_foo_hidden_p (void); > @@ -37,12 +44,16 @@ main (void) > if ((*foo_ptr) () != -1) > abort (); > > +#ifdef __PIE__ > if (foo_procted_ptr != foo_protected) > abort (); > +#endif > if (foo_protected () != 0) > abort (); > +#ifdef __PIE__ > if ((*foo_procted_ptr) () != 0) > abort (); > +#endif > > p = get_foo_p (); > if (p != foo) > @@ -55,8 +66,10 @@ main (void) > abort (); > > p = get_foo_protected_p (); > +#ifdef __PIE__ > if (p != foo_protected) > abort (); > +#endif > if (ret_foo_protected != 0 || (*p) () != ret_foo_protected) > abort (); > > diff --git a/elf/ifuncmain5.c b/elf/ifuncmain5.c > index f398085cb4..6fda768fb6 100644 > --- a/elf/ifuncmain5.c > +++ b/elf/ifuncmain5.c > @@ -14,12 +14,19 @@ get_foo (void) > return foo; > } > > + > +/* Address-significant access to protected symbols is not supported in > + position-dependent mode on several architectures because GCC > + generates relocations that assume that the address is local to the > + main program. */ > +#ifdef __PIE__ > foo_p > __attribute__ ((noinline)) > get_foo_protected (void) > { > return foo_protected; > } > +#endif > > int > main (void) > @@ -30,9 +37,11 @@ main (void) > if ((*p) () != -1) > abort (); > > +#ifdef __PIE__ > p = get_foo_protected (); > if ((*p) () != 0) > abort (); > +#endif > > return 0; > } > > base-commit: 2ff48a4025515e93d722947a9eabb114f4a65b22 > > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] elf: Disable some subtests of ifuncmain1, ifuncmain5 for !PIE 2024-05-09 21:24 ` [PATCH] elf: Disable some subtests of ifuncmain1, ifuncmain5 for !PIE Sunil Pandey @ 2024-05-09 21:27 ` H.J. Lu 2024-05-09 21:30 ` Florian Weimer 1 sibling, 0 replies; 4+ messages in thread From: H.J. Lu @ 2024-05-09 21:27 UTC (permalink / raw) To: Sunil Pandey; +Cc: Florian Weimer, Libc-stable Mailing List, GNU C Library On Thu, May 9, 2024 at 2:25 PM Sunil Pandey <skpgkp2@gmail.com> wrote: > > I would like to backport this patch to release branches(from 2.33 to 2.28) > Any comments or objections? Sounds good to me. Thanks. > --Sunil > > > On Fri, Nov 4, 2022 at 11:27 AM Florian Weimer via Libc-alpha <libc-alpha@sourceware.org> wrote: >> >> Tested on i686-linux-gnu, x86_64-linux-gnu (with glibc defaults on a >> toolchain which is not PIE-by-default). Built with build-many-glibcs.py >> defaults (so GCC 12 and binutils 2.39). The x86 failures are gone. >> >> --- >> elf/ifuncmain1.c | 13 +++++++++++++ >> elf/ifuncmain5.c | 9 +++++++++ >> 2 files changed, 22 insertions(+) >> >> diff --git a/elf/ifuncmain1.c b/elf/ifuncmain1.c >> index 747fc02648..6effce3d77 100644 >> --- a/elf/ifuncmain1.c >> +++ b/elf/ifuncmain1.c >> @@ -19,7 +19,14 @@ typedef int (*foo_p) (void); >> #endif >> >> foo_p foo_ptr = foo; >> + >> +/* Address-significant access to protected symbols is not supported in >> + position-dependent mode on several architectures because GCC >> + generates relocations that assume that the address is local to the >> + main program. */ >> +#ifdef __PIE__ >> foo_p foo_procted_ptr = foo_protected; >> +#endif >> >> extern foo_p get_foo_p (void); >> extern foo_p get_foo_hidden_p (void); >> @@ -37,12 +44,16 @@ main (void) >> if ((*foo_ptr) () != -1) >> abort (); >> >> +#ifdef __PIE__ >> if (foo_procted_ptr != foo_protected) >> abort (); >> +#endif >> if (foo_protected () != 0) >> abort (); >> +#ifdef __PIE__ >> if ((*foo_procted_ptr) () != 0) >> abort (); >> +#endif >> >> p = get_foo_p (); >> if (p != foo) >> @@ -55,8 +66,10 @@ main (void) >> abort (); >> >> p = get_foo_protected_p (); >> +#ifdef __PIE__ >> if (p != foo_protected) >> abort (); >> +#endif >> if (ret_foo_protected != 0 || (*p) () != ret_foo_protected) >> abort (); >> >> diff --git a/elf/ifuncmain5.c b/elf/ifuncmain5.c >> index f398085cb4..6fda768fb6 100644 >> --- a/elf/ifuncmain5.c >> +++ b/elf/ifuncmain5.c >> @@ -14,12 +14,19 @@ get_foo (void) >> return foo; >> } >> >> + >> +/* Address-significant access to protected symbols is not supported in >> + position-dependent mode on several architectures because GCC >> + generates relocations that assume that the address is local to the >> + main program. */ >> +#ifdef __PIE__ >> foo_p >> __attribute__ ((noinline)) >> get_foo_protected (void) >> { >> return foo_protected; >> } >> +#endif >> >> int >> main (void) >> @@ -30,9 +37,11 @@ main (void) >> if ((*p) () != -1) >> abort (); >> >> +#ifdef __PIE__ >> p = get_foo_protected (); >> if ((*p) () != 0) >> abort (); >> +#endif >> >> return 0; >> } >> >> base-commit: 2ff48a4025515e93d722947a9eabb114f4a65b22 >> > > -- H.J. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] elf: Disable some subtests of ifuncmain1, ifuncmain5 for !PIE 2024-05-09 21:24 ` [PATCH] elf: Disable some subtests of ifuncmain1, ifuncmain5 for !PIE Sunil Pandey 2024-05-09 21:27 ` H.J. Lu @ 2024-05-09 21:30 ` Florian Weimer 2024-05-10 1:25 ` Robbe Loes 1 sibling, 1 reply; 4+ messages in thread From: Florian Weimer @ 2024-05-09 21:30 UTC (permalink / raw) To: Sunil Pandey; +Cc: Hongjiu Lu, Libc-stable Mailing List, GNU C Library * Sunil Pandey: > I would like to backport this patch to release branches(from 2.33 to > 2.28) Any comments or objections? Seems reasonable. I stopped at 2.34 recently because that was the earliest release I needed to backport other things to, there's no fundamental reason to backport this further back. Thanks, Florian ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] elf: Disable some subtests of ifuncmain1, ifuncmain5 for !PIE 2024-05-09 21:30 ` Florian Weimer @ 2024-05-10 1:25 ` Robbe Loes 0 siblings, 0 replies; 4+ messages in thread From: Robbe Loes @ 2024-05-10 1:25 UTC (permalink / raw) To: Florian Weimer, Sunil Pandey Cc: Hongjiu Lu, Libc-stable Mailing List, GNU C Library [-- Attachment #1: Type: text/plain, Size: 756 bytes --] That's for real, that's for chose! ________________________________ Van: Florian Weimer <fweimer@redhat.com> Verzonden: donderdag 9 mei 2024 23:30 Aan: Sunil Pandey <skpgkp2@gmail.com> CC: Hongjiu Lu <hjl.tools@gmail.com>; Libc-stable Mailing List <libc-stable@sourceware.org>; GNU C Library <libc-alpha@sourceware.org> Onderwerp: Re: [PATCH] elf: Disable some subtests of ifuncmain1, ifuncmain5 for !PIE * Sunil Pandey: > I would like to backport this patch to release branches(from 2.33 to > 2.28) Any comments or objections? Seems reasonable. I stopped at 2.34 recently because that was the earliest release I needed to backport other things to, there's no fundamental reason to backport this further back. Thanks, Florian ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-05-10 1:25 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <87fseyy3s7.fsf@oldenburg.str.redhat.com> 2024-05-09 21:24 ` [PATCH] elf: Disable some subtests of ifuncmain1, ifuncmain5 for !PIE Sunil Pandey 2024-05-09 21:27 ` H.J. Lu 2024-05-09 21:30 ` Florian Weimer 2024-05-10 1:25 ` Robbe Loes
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).