IBM Support

LI77670: UNDEFINED REFERENCE TO `__TLS_GET_ADDR' ERROR

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • The source file compiled with -g issues the following error:
    
    ../../../../bin/../lib/libldb-rand.o:(.text+0x90): undefined
    reference to `__tls_get_addr'
    
    at link time.
    

Local fix

  • Do not use -g with noopt, or use optimization -O2(-O3) with -g
    

Problem summary

  • link failure - undefined reference to `__tls_get_addr' with -g
    
    The linker requires thread local storage references to be of
    the form
    0| 0017B0 addi     38620000   1     L8
    gr3=.Cpv_expIOFlushFlag_<<208>>(gr2,0)
    3734| 0017C0 bl       48000001   1     CALLN
    gr3=__tls_get_addr<<2192>>,1,gr3,__tls_get_addr
    3734| 0017C4 ori      60000000   1
    
    There is a relocation on the load from the toc .  There can be
    instructions in between as long as they do not require
    relocation.   In this case, there were 2 identical references
    in the same extended basic block.  The CALLN was commoned.  We
    didn't common the load because of the -g (storage can be
    changed in the debugger), so we had a dead toc load with no
    corresponding call to __tls_get_addr and
    the linker complained.
    

Problem conclusion

  • Allow red_pl to remove loads from the toc even with -g since
    the toc cannot be changed from the debugger.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI77670

  • Reported component name

    XL C/C++ FOR LI

  • Reported component ID

    5725C7300

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-10-28

  • Closed date

    2013-10-28

  • Last modified date

    2013-10-28

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

    LI77397

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

Fix information

  • Fixed component name

    XL C/C++ FOR LI

  • Fixed component ID

    5725C7300

Applicable component levels



Document information

More support for: XL C/C++ for Linux
Compiler

Software version: 12.1

Reference #: LI77670

Modified date: 28 October 2013