This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC
- From: Rich Felker <dalias at libc dot org>
- To: "Maciej W. Rozycki" <macro at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 19 Jun 2014 22:40:58 -0400
- Subject: Re: [PATCH][BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 1 dot 10 dot 1406192226490 dot 3924 at tp dot orcam dot me dot uk>
On Thu, Jun 19, 2014 at 11:29:44PM +0100, Maciej W. Rozycki wrote:
> Index: glibc-fsf-trunk-quilt/sysdeps/arm/dl-machine.h
> ===================================================================
> --- glibc-fsf-trunk-quilt.orig/sysdeps/arm/dl-machine.h 2014-06-19 22:24:23.731968218 +0100
> +++ glibc-fsf-trunk-quilt/sysdeps/arm/dl-machine.h 2014-06-19 22:25:06.741661376 +0100
> @@ -452,7 +452,10 @@ elf_machine_rel (struct link_map *map, c
> else
> # endif
> {
> - value = sym->st_value + td->argument.value;
> + if (td->argument.value & 0x80000000)
> + value = sym->st_value;
> + else
> + value = td->argument.value;
Can you explain why sym->st_value is completely ignored in the else
case? My understanding is that (aside from the high-bit-set condition
you found) td->argument.value is semantically an addend; I certainly
don't see any way it could already contain the desired symbol value
(offset).
Rich