[llvm-bugs] [Bug 40652] New: regression: unable to link thread local variable expected R_X86_64_PLT32 or R_X86_64_GOTPCRELX after R_X86_64_TLSLD

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Feb 7 16:19:13 PST 2019


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: unassignedbugs at nondot.org
          Reporter: andrew at ziglang.org
                CC: llvm-bugs at lists.llvm.org, peter.smith at linaro.org

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190208/2c1f7d35/attachment.html>


More information about the llvm-bugs mailing list