IBM Support

LI77397: 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

    LI77397

  • Reported component name

    XL C/C++ FOR BG

  • Reported component ID

    5799AG100

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-05-22

  • Closed date

    2013-05-29

  • Last modified date

    2013-05-29

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

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

    IV49628 LI77670

Fix information

  • Fixed component name

    XL C/C++ FOR BG

  • Fixed component ID

    5799AG100

Applicable component levels

  • RC10 PSY

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSCSJLG","label":"Compiler"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.1","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
29 May 2013