Re: [PATCH v3] xtensa: ldso: coalesce dl_mprotect address ranges
Bernhard Reutner-Fischer <[email protected]>
| Newsgroups | gmane.comp.lib.uclibc.general |
|---|---|
| Message-ID | <CAC1BbcRBZ3me8zqX5oyDG_damCWhyRE5wU2VkQ-x_6+mQKTnAQ@mail.gmail.com> |
On 10 January 2015 at 02:42, Max Filippov <[email protected]> wrote: > This noticeably lowers the number of mprotect calls at program startup, > e.g. for busybox: 7 calls vs 1835 calls. > > Signed-off-by: Max Filippov <[email protected]> > --- > Changes v2->v3: > - coalesce address ranges that overlap in any way, not only at the end of > the existing range. > > Changes v1->v2: > - initialize prev_got_start and prev_got_end in INIT_GOT as well. > > ldso/ldso/xtensa/dl-startup.h | 20 +++++++++++++++++++- > ldso/ldso/xtensa/dl-sysdep.h | 24 +++++++++++++++++++++++- > 2 files changed, 42 insertions(+), 2 deletions(-) > > diff --git a/ldso/ldso/xtensa/dl-startup.h b/ldso/ldso/xtensa/dl-startup.h > index b135a4c..0c28d5e 100644 > --- a/ldso/ldso/xtensa/dl-startup.h > +++ b/ldso/ldso/xtensa/dl-startup.h > @@ -83,6 +83,7 @@ do { \ > unsigned long l_addr = tpnt->loadaddr; \ > Elf32_Word relative_count; \ > unsigned long rel_addr; \ > + Elf32_Addr prev_got_start = 0, prev_got_end = 0; \ The whole file could need a touch-up WRT ElfW macros, see include/link.h Applied, thanks!