IBM Support

IJ46603: QROPTR CAUSING LINKER ERROR: CSECTS OVERLAP

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 using the -qroptr compiler option to place constant
    pointers in read-only memory, the presence of static const
    global variables may encounter a linker error:
    
    
    $ xlc apar.c -qroptr
    ld: 0711-552 SEVERE ERROR: Object /tmp/15663144_0.o:
            Csects with symbol numbers 14 and 18 overlap.
    $
    
    
    
       === TEST CASE ===
    
    typedef struct mystruct1
    {
      unsigned char    **val;
    } mystruct1;
    
    typedef struct mystruct2
    {
      mystruct1  *val;
    } mystruct2;
    
    typedef struct mystruct3
    {
      mystruct2    *val;
    } mystruct3;
    
    static const unsigned char* myconst1[] = {
        (unsigned char*)0};
    
    static const mystruct1 myconst2[] = {
    { (unsigned char **)myconst1},
      { (unsigned char **)0}};
    
    static const mystruct2 myconst3[] = {
    { (mystruct1 *)myconst2},
    { (mystruct1 *)0}}
    ;
    
    const mystruct3 myconst4[] =
    {
      { (mystruct2 *)myconst3},
      { (mystruct2 *)0 }
    };
    

Local fix

  • - Remove the -qroptr option
    - Remove either 'static' or 'const' from affected symbol
    

Problem summary

  • PROBLEM DESCRIPTION:
    The compiler is ignoring static variables if there is no code
    that references it; this then causes symbol mismatch when
    generating the object symbol table.
    
    USERS AFFECTED:
    Users of -qroptr with code that contains static const objects.
    

Problem conclusion

  • The symbol mismatch issue was resolved.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IJ46603

  • Reported component name

    XL C/C++ FOR AI

  • Reported component ID

    5725C7200

  • Reported release

    G10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2023-04-27

  • Closed date

    2023-06-09

  • Last modified date

    2023-06-09

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

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

Fix information

  • Fixed component name

    XL C/C++ FOR AI

  • Fixed component ID

    5725C7200

Applicable component levels

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSGH3R","label":"XL C\/C++ for AIX"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"G10","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
09 June 2023