<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 href="http://dev.gentoo.org/~dberkholz/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>