From 64abae7eed86ba85081eeec454cc1f5bf7c2a8bd Mon Sep 17 00:00:00 2001 From: Mark Seaborn Date: Sat, 21 Feb 2009 20:17:14 +0000 Subject: [PATCH] Redo previous change Previous change broke linking of libpthread.so. Take a different approach to disabling rewriting of R_386_TLS_GD. --- bfd/elf32-nacl.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bfd/elf32-nacl.c b/bfd/elf32-nacl.c index 8f42970..7b69c23 100644 --- a/bfd/elf32-nacl.c +++ b/bfd/elf32-nacl.c @@ -2665,11 +2665,7 @@ elf_i386_relocate_section (bfd *output_bfd, } /* Fall through */ - /* Don't attempt to rewrite General Dynamic code sequences, - because the NaCl assembler will put no-ops into the - middle of the sequence before the call, which we can't - handle yet. */ - /* case R_386_TLS_GD: */ + case R_386_TLS_GD: case R_386_TLS_GOTDESC: case R_386_TLS_DESC_CALL: case R_386_TLS_IE_32: @@ -2696,6 +2692,13 @@ elf_i386_relocate_section (bfd *output_bfd, r_type = R_386_TLS_IE_32; } + /* Don't attempt to rewrite General Dynamic code sequences, + because the NaCl assembler will put no-ops into the + middle of the sequence before the call, which we can't + handle yet. */ + if (ELF32_R_TYPE (rel->r_info) == R_386_TLS_GD) + r_type = R_386_TLS_GD; + if (r_type == R_386_TLS_LE_32) { BFD_ASSERT (! unresolved_reloc); -- 2.11.4.GIT