IBM Support

IJ04374: INCORRECT LINKER RELOCATION WITH -O2 AND -QFUNCSECT

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

APAR status

  • Closed as program error.

Error description

  • When compiling with -O2 -qfuncsect and -qrtti, an incorrect
    linker relocation entry is generated for accessing the
    type_info/typeid class.  Accessing the class may load incorrect
    memory, resulting in invalid typeid information or segmentation
    fault.
    
    Evidence of the incorrect relocation may look like:
    
    
       COMPILE LISTING:
         445| 0000E8 lwz   807C000C  L4A gr3=__type_infoXTi_(gr28,4)
                                    Original/correct offset -----^^^
    
       LINKED BINARY:
         lwz   r3,0xfc(r28)
                   ^^^^-------- New/incorrect offset relocation
    

Local fix

  • Do not use -O2 or -qfuncsect
    

Problem summary

  • USERS AFFECTED:
    Users who compile C++ programs with typeinfo and funcsect
    support on AIX may be affected by this issue.
    
    PROBLEM DESCRIPTION:
    Unexpected behaviors like segfault or wrong outputs due to
    incorrect relocation when inlining some member
    function of typeinfo like name() may occur.
    

Problem conclusion

  • The fix is to take care of typeinfo special attributes when
    inlining.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IJ04374

  • Reported component name

    XL C FOR AIX

  • Reported component ID

    5725C7100

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2018-02-27

  • Closed date

    2018-04-23

  • Last modified date

    2018-04-23

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

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

    IJ08176 IJ12256

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 #: IJ04374

Modified date: 23 April 2018