IBM Support

LI76202: INLINE ASM MAKING TLS VARIABLE LOCAL

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • When compiling source code containing inline assembly and thread
    local storage, the TLS symbols are set as local, instead of
    global.
    
    
    
       =====  TEST CASE  =====
    
    int foo(volatile int *bar) {
            while (*bar) {
                    asm volatile("or 1,1,1" : : :"memory");
            }
            return 0;
    }
    
    __thread int tls1;
    
    
    
    Compile with:  xlc -c -qtls test.c .  The resulting symbols
    (displayed with the 'nm' command) are:
    
    00000000 T foo
    00000000 b tls1
    
    The lowercase letter for the TLS variable, tls1, notes that the
    symbol is local.
    

Local fix

  • Separate inline assembly statements from TLS data by
    placing each in different source files.
    

Problem summary

  • PROBLEM DESCRIPTION:
    Uninitialized TLS variables should be placed in a TLS common
    section within an object file. This avoids duplication of
    variables at runtime.
    
    USERS AFFECTED:
    Users with multi-threaded programs who use thread local storage
    (TLS)
    

Problem conclusion

  • Customers who use TLS global variables across files should
    consider this fix if they are experiencing problems with TLS
    variable duplication in their executable files.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI76202

  • Reported component name

    XL C/C++ RHEL52

  • Reported component ID

    5724U8310

  • Reported release

    A10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-06-10

  • Closed date

    2011-06-10

  • Last modified date

    2011-06-10

  • APAR is sysrouted FROM one or more of the following:

    LI76045

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    XL C/C++ RHEL52

  • Fixed component ID

    5724U8310

Applicable component levels

  • RA10 PSY

       UP



Document information

More support for: XL C/C++

Software version: A.1

Reference #: LI76202

Modified date: 10 June 2011