<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - TLS variables in inline assembly not considered TLS variables"
   href="https://bugs.llvm.org/show_bug.cgi?id=45598">45598</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>TLS variables in inline assembly not considered TLS variables
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>yshuiv7@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, smithp352@googlemail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Input file 1:

target datalayout =
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

%struct._glapi_table = type opaque

@table_noop_array = external constant [0 x void ()*], align 8
@_glapi_tls_Dispatch = thread_local(initialexec) local_unnamed_addr global
%struct._glapi_table* bitcast ([0 x void ()*]* @table_noop_array to
%struct._glapi_table*), align 8

; Function Attrs: norecurse nounwind readonly sspstrong uwtable
define %struct._glapi_table* @_glapi_get_dispatch() local_unnamed_addr #2 {
  %1 = load %struct._glapi_table*, %struct._glapi_table** @_glapi_tls_Dispatch,
align 8
  ret %struct._glapi_table* %1
}

Input file 2:

target datalayout =
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

module asm ".text"
module asm ".balign 32"
module asm "x86_64_entry_start:"
module asm ".hidden shared_dispatch_stub_0"
module asm ".globl shared_dispatch_stub_0"
module asm ".type shared_dispatch_stub_0, @function"
module asm ".balign 32"
module asm "shared_dispatch_stub_0:"
module asm "\09movq _glapi_tls_Dispatch@GOTTPOFF(%rip), %rax"
module asm "\09movq %fs:(%rax), %r11"
module asm "\09jmp *(8 * 0)(%r11)"

@x86_64_entry_start = external hidden global [0 x i8], align 1


lld complains:

ld.lld: error: TLS attribute mismatch: _glapi_tls_Dispatch

Looks like _glapi_tls_Dispatch in input file 2 is not considered a TLS
variable, presumably because it's defined in inline assembly.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>