<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
The definitive document is here: <a class="moz-txt-link-freetext" href="http://www.akkadia.org/drepper/tls.pdf">http://www.akkadia.org/drepper/tls.pdf</a><br>
<br>
I just had a look through and I guess it probably is a bug. Technically
the code in DLYDRendezvous::GetThreadInfo() should query not only the
location, but also the size of modid (using the same API), and then
later issue the appropriately-sized read.<br>
<br>
It's not really "wrong" for little-endian systems right now, unless you
have 4 billion modules loaded.<br>
<br>
<br>
Steve Pucci wrote:
<blockquote
cite="mid:CAHKH9PQ3u7H14+unK_hCndjHwB_UdUnkO+=wtuX+zkZVR3dqOg@mail.gmail.com"
type="cite">
<div dir="ltr">Hi all,
<div><br>
</div>
<div>I'm trying to determine if some code in DynamicLoaderPOSIXDYLD
is correct and I could use some confirmation:</div>
<div><br>
</div>
<div>The code in question reads the module id of a module as part of
finding the TLS block associated with that module, by determining its
location and then reading with a hardcoded 32-bit unsigned read. (The
code in question is
source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp, in
DynamicLoaderPOSIXDYLD::GetThreadLocalData).</div>
<div><br>
</div>
<div>I've read <a moz-do-not-send="true"
href="http://dev.gentoo.org/%7Edberkholz/articles/toolchain/tls.pdf">http://dev.gentoo.org/~dberkholz/articles/toolchain/tls.pdf</a>
, which describes a number of architectures and in all cases the value
seems to be either size_t or "unsigned long int". Thus the code
appears to be wrong in at least some cases, in that it should be
reading 64 bits when debugging 64-bit runtimes. The code presumably
works today for 64-bit LSB (little-endian) systems (which is most of
the 64-bit Linuxes) because it's reading the right 32-bits out of the
64-bit location.</div>
<div><br>
But I'm not 100% sure, because</div>
<div>* I'm not sure that the referenced pdf is definitive</div>
<div>* I don't have an MSB 64-bit system to test on to verify that
it's a bug.</div>
<div><br>
</div>
<div>Can anyone with any familiarity with this issue comment on this?</div>
<div><br>
</div>
<div>Thanks,</div>
<div> Steve</div>
</div>
<pre wrap="">
<hr class="__postbox_mime_separator" width="90%" size="4">
_______________________________________________
lldb-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a>
</pre>
</blockquote>
</body>
</html>