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 xfd@Parnik:/build$ cat foo.c __thread int foo; xfd@Parnik:/build$ cat bar.c extern __thread int foo; int bar() { return foo; } xfd@Parnik:/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. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils