[PATCH] D73508: [LLD][COFF] Fix dll import for thread_local storage

Markus Böck via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 14:43:14 PST 2020


zero9178 created this revision.
zero9178 added reviewers: rnk, mstorsjo.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

DLLs with thread local storage used the relocaction type IMAGE_REL_AMD64_SECREL which had no bitsize specified leading to a linking failure with lld. This adds the bitsize from ld.bfd https://github.com/bminor/binutils-gdb/blob/3024a17ae029ec7f55b498e99ddd6238e22fe565/bfd/coff-x86_64.c#L340

Would need someone to commit this for me if accepted


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D73508

Files:
  lld/COFF/Chunks.cpp


Index: lld/COFF/Chunks.cpp
===================================================================
--- lld/COFF/Chunks.cpp
+++ lld/COFF/Chunks.cpp
@@ -508,6 +508,7 @@
     case IMAGE_REL_AMD64_REL32_3:
     case IMAGE_REL_AMD64_REL32_4:
     case IMAGE_REL_AMD64_REL32_5:
+    case IMAGE_REL_AMD64_SECREL:
       return 32;
     default:
       return 0;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73508.240686.patch
Type: text/x-patch
Size: 351 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200127/e931deff/attachment.bin>


More information about the llvm-commits mailing list