This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Remove no longer applicable assertion.


On Fri, Apr 6, 2012 at 2:41 AM, David Miller <davem@davemloft.net> wrote:
>
> As mentioned by Carlos earlier.
>
> 2012-04-05 ?David S. Miller ?<davem@davemloft.net>
>
> ? ? ? ?* elf/dynamic-link.h (_ELF_DYNAMIC_DO_RELOC): Remove no longer
> ? ? ? ?relevant assertion.
>
> diff --git a/elf/dynamic-link.h b/elf/dynamic-link.h
> index 310ad5e..da88124 100644
> --- a/elf/dynamic-link.h
> +++ b/elf/dynamic-link.h
> @@ -293,7 +293,6 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
> ? ? ? ?else ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
> ? ? ? ? ?{ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \
> ? ? ? ? ? ?/* Combine processing the sections. ?*/ ? ? ? ? ? ? ? ? ? ? ? ? ? \
> - ? ? ? ? ? assert (ranges[0].start + ranges[0].size == start); ? ? ? ? ? ? ? \
> ? ? ? ? ? ?ranges[0].size += (map)->l_info[DT_PLTRELSZ]->d_un.d_val; ? ? ? ? \
> ? ? ? ? ?} ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \
> ? ? ? } ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\

Would the following be more optimal?

~~~
We assume either:
(a) |--DT_REL--|--DT_JMPREL--|
or
(b) |--DT_REL----------------|
               |--DT_JMPREL--|

We remap (b) into (a) during relocation processing.

Given that we always work with (a) the conditions under which we will
merge regions becomes simpler.

We will merge the lazy processed region with the non-lazy region if
it's during startup (because we don't support lazy during startup) or
if lazy is off.
~~~

diff --git a/elf/dynamic-link.h b/elf/dynamic-link.h
index 310ad5e..5492c0e 100644
--- a/elf/dynamic-link.h
+++ b/elf/dynamic-link.h
@@ -278,13 +278,7 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
                                                                              \
        if (__builtin_expect (ranges[0].size, 1))                             \
          ranges[0].size = (start - ranges[0].start);                         \
-       if (! ELF_DURING_STARTUP                                              \
-           && ((do_lazy)                                                     \
-               /* This test does not only detect whether the relocation      \
-                  sections are in the right order, it also checks whether    \
-                  there is a DT_REL/DT_RELA section.  */                     \
-               || __builtin_expect (ranges[0].start + ranges[0].size         \
-                                    != start, 0)))                           \
+       if (! ELF_DURING_STARTUP && do_lazy)                                  \
          {                                                                   \
            ranges[1].start = start;                                          \
            ranges[1].size = (map)->l_info[DT_PLTRELSZ]->d_un.d_val;          \
@@ -293,7 +287,6 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
        else                                                                  \
          {                                                                   \
            /* Combine processing the sections.  */                           \
-           assert (ranges[0].start + ranges[0].size == start);               \
            ranges[0].size += (map)->l_info[DT_PLTRELSZ]->d_un.d_val;         \
          }                                                                   \
       }
               \
~~~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]