|
From: Oscar F. <of...@wa...> - 2003-10-12 08:29:46
|
Jonathan Wilson <jo...@tp...> writes:
> Well when I compile the code containing this definition and then
> disassemble the .o file produced by GCC, my disassembler (IDA pro
> 4.30) tells me that __tls_index is an extern
>
> The entire code looks like this:
> #include <windows.h>
> DWORD __tls_start __attribute__ ((section (".tls"))) = 0;
> DWORD __tls_end __attribute__ ((section (".tls$ZZZ"))) = 0;
> DWORD __tls_index;
I do not understand the other stuff, but this declaration should be
static DWORD __tls_index;
if you don't want to default it to extern.
> PIMAGE_TLS_CALLBACK ___xl_a __attribute__ ((section (".CRT$XLA"))) = 0;
> PIMAGE_TLS_CALLBACK ___xl_z __attribute__ ((section (".CRT$XLZ"))) = 0;
> IMAGE_TLS_DIRECTORY __tls_used = {(DWORD)&__tls_start,
> (DWORD)&__tls_end, &__tls_index, &___xl_a, 0, 0};
>
> __tls_index should be in the uninitalized data segment but instead its
> ending up as extrn ___tls_index:near
> its in a segment labeled by IDA as UNDEF and as Segment type: Externs
> Anyone wanna tell me whats going on?
--
Oscar
|