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

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

Issue 3467009: [binutils] Prevent ld from rewriting tls access sequences with calls (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git
Patch Set: Created 10 years, 3 months 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 | « binutils/bfd/elf32-i386.c ('k') | 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 1434836ca80e7df476d5c629574a1617082a1c21..a82b4afe507b325ce4b1527ffafeb7556fa58830 100644
--- a/binutils/bfd/elf64-x86-64.c
+++ b/binutils/bfd/elf64-x86-64.c
@@ -1082,6 +1082,14 @@ elf64_x86_64_tls_transition (struct bfd_link_info *info, bfd *abfd,
if (from_type == to_type)
return TRUE;
+#ifdef ELF64_NACL_C
+ /* Don't attempt to rewrite code sequences with call in the middle,
+ because the NaCl assembler will put no-ops before the call,
+ which we can't handle yet. */
+ if (from_type == R_X86_64_TLSGD || from_type == R_X86_64_TLSLD)
+ return TRUE;
+#endif
+
/* Check if the transition can be performed. */
if (check
&& ! elf64_x86_64_check_tls_transition (abfd, sec, contents,
« no previous file with comments | « binutils/bfd/elf32-i386.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698