Re: Optimizes out TLS variable called in a child function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/08/2015 07:28 PM, Michael Cronenworth wrote:

The attached test case is getting the offset location of a TLS variable. When
compiled with -O0 the test case compiles. When compiled with -O1 the test case will
not compile with an error for an undefined reference to the TLS variable. If you
move the THREAD_VAR_OFFSET macro call to main() gcc will compile without error. Any
suggestions?

FYI:

The issue is resolve when using __attribute__((used)) on the global variable.





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux