IBM Support

IV13924: OVERLAPING CSECTS CAUSING LINKER ERROR

Fixes are available

April 2012 PTF for XL C for AIX, V11.1
April 2012 PTF for XL C/C++ for AIX, V11.1
July 2012 PTF for XL C/C++ for AIX, V11.1
October 2012 PTF for XL C/C++ for AIX, V11.1
October 2012 PTF for XL C for AIX, V11.1
February 2013 PTF for XL C for AIX, V11.1
February 2013 PTF for XL C/C++ for AIX, V11.1
XL C/C++ for AIX Fix Pack 14 (May 2013 PTF) for 11.1
XL C for AIX Fix Pack 14 (May 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 15 (August 2013 PTF) for 11.1
XL C for AIX Fix Pack 15 (August 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 16 (November 2013 PTF) for 11.1
XL C for AIX Fix Pack 17 (February 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 17 (February 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 18 (May 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 19 (August 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 20 (November 2014 PTF) for 11.1
XL C for AIX Fix Pack 21 (April 2015 PTF) for 11.1
XL C/C++ for AIX Fix Pack 21 (April 2015 PTF) for 11.1
XL C/C++ for AIX Fix Pack 22 (September 2015 PTF) for 11.1
XL C for AIX Fix Pack 23 (March 2016 PTF) for 11.1
XL C/C++ for AIX Fix Pack 23 (March 2016 PTF) for 11.1
XL C for AIX Fix Pack 24 (September 2016 PTF) for 11.1
XL C/C++ for AIX Fix Pack 24 (September 2016 PTF) for 11.1
July 2012 PTF for XL C for AIX, V11.1
XL C for AIX Fix Pack 16 (November 2013 PTF) for 11.1
XL C for AIX Fix Pack 18 (May 2014 PTF) for 11.1
XL C for AIX Fix Pack 19 (August 2014 PTF) for 11.1
XL C for AIX Fix Pack 20 (November 2014 PTF) for 11.1
XL C for AIX Fix Pack 22 (September 2015 PTF) for 11.1

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When compiling with both -qfuncsect and -qminimaltoc, the newer
    linkers (ie bos.rte.bind_cmds 7.1.0.16 and above)
    start complaining about overlaping csect symbols in the object
    file.
    
    After looking at the .s file, you can see the overlap between
    csect H.12 and H.22:
    .
    .
            .csect  H.22.NO_SYMBOL{RO}, 3         <----start of H.22
            .long   0x00000054              # "\0\0\0T"
            .long   0x00000060              # "\0\0\0`"
            .long   0x0000006c              # "\0\0\0l"
            .long   0x00000078              # "\0\0\0x"
    
            .toc
    T.12.NO_SYMBOL:
            .tc     H.12.NO_SYMBOL{TC},0x00000084     <----start of
    H.12
            .long   0x00000090              # "\0\0\0\220"
            .long   0x0000009c              # "\0\0\0\234"
            .long   0x000000a8              # "\0\0\0\250"
    # End   csect   H.22.NO_SYMBOL{RO}          <----end of H.22
    
    
    
    
    ===== COMPILE COMMAND:
    $xlC -qfuncsect -qminimaltoc test.cpp
    
    ===== TESTCASE:
    $cat test.cpp
    int Z(int val)
    {
     int ret=0;
     switch(val)
     {
     case 0:
      ret=5;
      break;
     case 1:
      ret=10;
      break;
     case 2:
      ret=7;
      break;
     case 3:
      ret=2;
      break;
     case 4:
      ret=17;
      break;
     case 5:
      ret=1;
      break;
     case 6:
      ret=47;
      break;
     case 7:
      ret=99;
      break;
     default:
      ret=98;
      break;
     }
     return ret;
    }
    
    int main(int argc)
    {
     return Z(argc);
    }
    $
    
    
    ===== ACTUAL OUTPUT:
    $xlC -qfuncsect -qminimaltoc test.cpp
    ld: 0711-552 SEVERE ERROR: Object test.o:
     Csects with symbol numbers 22 and 12 overlap.
    $
    
    ===== EXPECTED OUTPUT:
    Should not cause a link error.
    

Local fix

  • Avoid using the -qfuncsect -qminimaltoc option combination as a
    workaround with the 7.1.0.16 (and above) linkers.
    

Problem summary

  • USERS AFFECTED:
    Clients using -qfuncsect and -qminimaltoc together to compile a
    program with switch statements may be affected by this issue.
    
    PROBLEM DESCRIPTION:
    The compiler internally generates a branch table for the switch
    statement when -qfuncsect is used.
    When -qminimaltoc is used, relocatable addresses are created
    and put into data CSECTs and should not generate TOC slots.
    When both are used together, the compiler generates incorrect
    addresses that overlap the branch table causing the linker to
    complain.
    

Problem conclusion

  • The fix is to not emit the sym table entries for the incorrect
    TOC slot.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV13924

  • Reported component name

    XL C/C++ AIX

  • Reported component ID

    5724X1300

  • Reported release

    B10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-01-24

  • Closed date

    2012-03-29

  • Last modified date

    2012-03-29

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

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

    LI76822

Fix information

  • Fixed component name

    XL C FOR AIX

  • Fixed component ID

    5724X1200

Applicable component levels

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSGH2K","label":"XL C for AIX"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.1","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
29 March 2012