bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/4918] New: ___tls_get_addr call requires @PLT even without -fpic


From: hjl at lucon dot org
Subject: [Bug ld/4918] New: ___tls_get_addr call requires @PLT even without -fpic
Date: 13 Aug 2007 17:06:02 -0000

On Linux/x86 and Linux/x86-64, I got

address@hidden tls-5]$ cat x.c
#include <stdio.h>

__thread int foo __attribute__((tls_model("global-dynamic"))) = 100;

int
main ()
{
  printf ("foo: %d\n", foo);
  return 0;
}
address@hidden tls-5]$ gcc  -o x x.c
/usr/local/bin/ld: BFD (Linux/GNU Binutils) 2.18.50.0.1.20070811 assertion fail
/net/gnu-13/export/linux/src/binutils/binutils/bfd/elf64-x86-64.c:2568
address@hidden tls-5]$ ./x
foo: 100

The assert comes from

                  /* GD->LE transition.
                     .byte 0x66; leaq address@hidden(%rip), %rdi
                     .word 0x6666; rex64; call address@hidden
                     Change it into:
                     movq %fs:0, %rax
                     leaq address@hidden(%rax), %rax */
                  BFD_ASSERT (rel->r_offset >= 4);
                  for (i = 0; i < 4; i++)
                    BFD_ASSERT (bfd_get_8 (input_bfd,
                                           contents + rel->r_offset - 4 + i)   
                             == tlsgd[i]);
                  BFD_ASSERT (rel->r_offset + 12 <= input_section->size);
                  for (i = 0; i < 4; i++)
                    BFD_ASSERT (bfd_get_8 (input_bfd,
                                           contents + rel->r_offset + 4 + i)
                                == tlsgd[i+4]);                  BFD_ASSERT (rel
+ 1 < relend);
                  BFD_ASSERT (ELF64_R_TYPE (rel[1].r_info) == R_X86_64_PLT32);

Why is R_X86_64_PLT32 required here?

-- 
           Summary: ___tls_get_addr call requires @PLT even without -fpic
           Product: binutils
           Version: 2.19 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: hjl at lucon dot org
                CC: bug-binutils at gnu dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=4918

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]