IBM Support

IV49628: UNDEFINED REFERENCE TO `__TLS_GET_ADDR' ERROR

Fixes are available

XL C/C++ for AIX Fix Pack 5 (September 2013 PTF) for 12.1
XL C/C++ for AIX Fix Pack 7 (January 2014 PTF) for 12.1
XL C for AIX Fix Pack 8 (March 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 8 (March 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 11 (February 2015 PTF) for 12.1
XL C for AIX Fix Pack 12 (May 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 12 (May 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 13 (August 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C for AIX Fix Pack 15 (April 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 15 (April 2016 Update) for 12.1
XL C for AIX Fix Pack 16 (July 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 16 (July 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 17 (November 2016 Update) for 12.1
XL C for AIX Fix Pack 17 (November 2016 Update) for 12.1
XL C for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C/C++ for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C for AIX Fix Pack 5 (September 2013 PTF) for 12.1
XL C for AIX Fix Pack 6 (December 2013 PTF) for 12.1
XL C/C++ for AIX Fix Pack 6 (December 2013 PTF) for 12.1
XL C for AIX Fix Pack 7 (January 2014 PTF) for 12.1
XL C for AIX Fix Pack 9 (July 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 9 (July 2014 PTF) for 12.1
XL C for AIX Fix Pack 10 (October 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 10 (October 2014 PTF) for 12.1
XL C for AIX Fix Pack 11 (February 2015 PTF) for 12.1
XL C for AIX Fix Pack 13 (August 2015 Update) for 12.1
XL C for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 21 (January 2019 Update) for 12.1
XL C for AIX Fix Pack 21 (January 2019 Update) for 12.1

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

    IV49628

  • Reported component name

    XL C FOR AIX

  • Reported component ID

    5725C7100

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-09-18

  • Closed date

    2013-09-18

  • Last modified date

    2013-09-20

  • 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 FOR AIX

  • Fixed component ID

    5725C7100

Applicable component levels



Document information

More support for: XL C for AIX
Compiler

Software version: 12.1

Reference #: IV49628

Modified date: 20 September 2013