bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/16846] New: LTO mismatched TLS reference


From: lukasz.kwestarz at luxoo dot pl
Subject: [Bug ld/16846] New: LTO mismatched TLS reference
Date: Tue, 15 Apr 2014 23:53:28 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=16846

            Bug ID: 16846
           Summary: LTO mismatched TLS reference
           Product: binutils
           Version: 2.25 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: lukasz.kwestarz at luxoo dot pl

address@hidden:/build$ cat foo.c
__thread int foo;
address@hidden:/build$ cat bar.c
extern __thread int foo;

int bar() 
{
    return foo;
}
address@hidden:/build$ cat main.c
extern int bar();

int main () 
{
   return bar();
}

gcc -c foo.c
gcc -flto -c bar.c

gcc -flto main.c -o main bar.o foo.o <- no error

gcc -flto main.c -o main foo.o bar.o
/usr/bin/ld: foo: TLS definition in foo.o section .tbss mismatches non-TLS
reference in bar.o (symbol from plugin)
bar.o (symbol from plugin): could not read symbols: Bad value
collect2: ld returned 1 exit status

I think problem is caused by missing or clause for new symbol in this code from
elflink.c:

  /* Plugin symbol type isn't currently set.  Stop bogus errors.  */
  if (oldbfd != NULL && (oldbfd->flags & BFD_PLUGIN) != 0)
    *type_change_ok = TRUE;

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

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