This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] [RESEND] Flush cache after solving TEXTRELs if arch requires it
- From: "Kirill A. Shutemov" <kirill at shutemov dot name>
- To: libc-alpha at sourceware dot org
- Cc: libc-ports at sourceware dot org
- Date: Tue, 8 Jun 2010 13:55:24 +0300
- Subject: Re: [PATCH] [RESEND] Flush cache after solving TEXTRELs if arch requires it
- References: <AANLkTikx_P70lVrraUujfy_ngyx-AiGdwgADe2Q4dy_0@mail.gmail.com>
On Thu, Jun 3, 2010 at 7:39 PM, Kirill A. Shutemov <kirill@shutemov.name> wrote:
> On ARM instruction and data cache is not coherent, so we have to flush
> cache after solving TEXTRELs to be sure that we run correct code.
>
> This is regression introduced by commit f133c097.
>
> Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
> ---
> 2010-06-02 ÂKirill A. Shutemov <kirill@shutemov.name>
>
> Â Â Â * elf/dl-reloc.c: Flush cache after solving TEXTRELs if arch requires it
Any comments?
This patch fixes random crashes on ARM, if the executable or shared
library has TEXTREL.
> ---
> Âelf/dl-reloc.c | Â Â3 +++
> Â1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
> index 6c00691..01f458f 100644
> --- a/elf/dl-reloc.c
> +++ b/elf/dl-reloc.c
> @@ -307,6 +307,9 @@ _dl_relocate_object (struct link_map *l, struct
> r_scope_elem *scope[],
> Â Â Â Â goto call_error;
> Â Â Â }
>
> +#ifdef CLEAR_CACHE
> + Â Â ÂCLEAR_CACHE (textrels->start, textrels->start + textrels->len);
> +#endif
> Â Â Âtextrels = textrels->next;
> Â Â}
>
> --
> 1.7.0.6
>