https://bugs.llvm.org/show_bug.cgi?id=40652

            Bug ID: 40652
           Summary: regression: unable to link thread local variable
                    expected R_X86_64_PLT32 or R_X86_64_GOTPCRELX after
                    R_X86_64_TLSLD
           Product: lld
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: ELF
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

Created attachment 21446
  --> https://bugs.llvm.org/attachment.cgi?id=21446&action=edit
test.ll

Zig frontend code:

threadlocal var x: i32 = 1234;
pub fn main() void {
    x += 1;
}


With LLVM 7.0.0 and LLD 7.0.0, works correctly. With LLVM 8.0.0rc2 and LLD
8.0.0rc2, gives this error:

ld.lld: error: test:(.rodata+0xED): expected R_X86_64_PLT32 or
R_X86_64_GOTPCRELX after R_X86_64_TLSLD

Repro:

clang-8 -o test test.ll -nostdlib memcpy.c -fuse-ld=lld

memcpy.c:
void *memcpy(char *dest, char *src, unsigned n) {
    for (unsigned i = 0; i < n; i += 1) {
        dest[i] = src[i];
    }
    return dest;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to