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 v2][BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC


On Fri, Jun 20, 2014 at 06:21:29PM +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-20 05:46:45.000000000 +0100
> +++ glibc-fsf-trunk-quilt/sysdeps/arm/dl-machine.h	2014-06-20 07:08:08.301787149 +0100
> @@ -452,7 +452,10 @@ elf_machine_rel (struct link_map *map, c
>  	    else
>  # endif
>  	      {
> -		value = sym->st_value + td->argument.value;
> +		if (ELF32_R_SYM (reloc->r_info) == STN_UNDEF)
> +		  value = td->argument.value;
> +		else
> +		  value = sym->st_value;

Is this logic correct in general, i.e. is the immediate addend always
(semantically) zero for symbolic relocations? Or is it legal to have a
symbolic relocation with an offset, e.g. if a module accesses x[42];
in __thread int x[50]; but no other elements and the compiler wants to
generate a relocation referencing x[42] without the need for applying
an additional offset to the address of x[0] at runtime as part of the
referencing code?

Rich


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