This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Remove no longer applicable assertion.
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: David Miller <davem at davemloft dot net>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 6 Apr 2012 05:17:17 -0400
- Subject: Re: [PATCH] Remove no longer applicable assertion.
- References: <20120406.024135.1152835757827172374.davem@davemloft.net>
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; \
} \
}
\
~~~