Skip to content

Commit

Permalink
sparc64: Fix handling of R_SPARC_TLS_LE_* relocations.
Browse files Browse the repository at this point in the history
  • Loading branch information
David S. Miller authored and Andreas Schwab committed Mar 18, 2010
1 parent a4889ed commit 07a2235
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2010-03-09 David S. Miller <davem@davemloft.net>

* sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Handling
of R_SPARC_TLS_LE_* needs to use 32-bit loads and stores, not
64-bit ones.

2009-10-27 Aurelien Jarno <aurelien@aurel32.net>

[BZ #10855]
Expand Down
10 changes: 6 additions & 4 deletions sysdeps/sparc/sparc64/dl-machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -623,11 +623,13 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
value = sym->st_value - sym_map->l_tls_offset
+ reloc->r_addend;
if (r_type == R_SPARC_TLS_LE_HIX22)
*reloc_addr = (*reloc_addr & 0xffc00000)
| (((~value) >> 10) & 0x3fffff);
*(unsigned int *)reloc_addr =
((*(unsigned int *)reloc_addr & 0xffc00000)
| (((~value) >> 10) & 0x3fffff));
else
*reloc_addr = (*reloc_addr & 0xffffe000) | (value & 0x3ff)
| 0x1c00;
*(unsigned int *)reloc_addr =
((*(unsigned int *)reloc_addr & 0xffffe000) | (value & 0x3ff)
| 0x1c00);
}
break;
# endif
Expand Down

0 comments on commit 07a2235

Please sign in to comment.