Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8143)

Unified Diff: binutils/bfd/elf64-x86-64.c

Issue 6025010: [binutils] Fix tls transition check from R_X86_64_GOTTPOFF (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git@master
Patch Set: ready for code review Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: binutils/bfd/elf64-x86-64.c
diff --git a/binutils/bfd/elf64-x86-64.c b/binutils/bfd/elf64-x86-64.c
index b8527e1ab8e82b3aa2b376243a70f2917437e27b..a4d2ecf70c980e06c861a1fc5f3eb1f30548521c 100644
--- a/binutils/bfd/elf64-x86-64.c
+++ b/binutils/bfd/elf64-x86-64.c
@@ -949,6 +949,17 @@ elf64_x86_64_check_tls_transition (bfd *abfd, asection *sec,
"__tls_get_addr", 14) == 0));
case R_X86_64_GOTTPOFF:
+#ifdef ELF64_NACL_C
+ /* Check transition from IE access model:
+ movl foo@gottpoff(%rip), %reg
+ addl foo@gottpoff(%rip), %reg
+ The encoding is similar to x86_64 but with 0x44 REX prefix if writing
+ to %r9d-%r15d or without REX prefix otherwise. We can't distinguish
+ cases with/without the prefix, thus disabling the prefix check :-( */
+
+ if (offset < 2 || (offset + 4) > sec->size)
+ return FALSE;
+#else
/* Check transition from IE access model:
movq foo@gottpoff(%rip), %reg
addq foo@gottpoff(%rip), %reg
@@ -960,6 +971,7 @@ elf64_x86_64_check_tls_transition (bfd *abfd, asection *sec,
val = bfd_get_8 (abfd, contents + offset - 3);
if (val != 0x48 && val != 0x4c)
return FALSE;
+#endif
val = bfd_get_8 (abfd, contents + offset - 2);
if (val != 0x8b && val != 0x03)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698