IBM Support

IV85629: SUCCESSIVE LABELS IN ARRAY OF LABEL ADDRESSES CAUSING LINKER RLD ERROR

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • Incorrect relocation information is generated by the compiler
    for successive labels in an array of label addresses.  This can
    cause RLD linker errors during linking, or runtime segmentation
    faults.
    
    
       === TEST CASE ===
    
    #include <stdio.h>
    
    int test(int index)
    {
        static void* table[]
           = { &&L2, &&L5, &&L2, &&L8, &&L8, &&L1, };
                               //^^^^  ^^^^ - successive labels
    
        goto *table[index];
    
        return -1;
    
        L0: return 0; L1: return 1; L2: return 2; L3: return 3;
        L4: return 4; L5: return 5; L6: return 6; L7: return 7;
        L8: return 8; L9: return 9;
    }
    
    int main(int argc, char *argv[])
    {
        printf("input:  %d = %d\n", argc-1, test(argc-1));
    }
    
    
    $ xlc test.c
    ld: 0711-596 SEVERE ERROR: Object test.o
            An RLD for section 2 (.data) refers to symbol 0,
            but the storage class of the symbol is not C_EXT or
            C_HIDEXT.
    $
    

Local fix

  • Do not use successive label addresses in an array.
    

Problem summary

  • PROBLEM DESCRIPTION:
    Linker errors stating one data relocation referring to symbol
    0, or runtime segmentation fault.
    
    USERS AFFECTED:
    Users who have array members initialized by the addresses of
    repeated label values, located closely in the array.
    

Problem conclusion

  • A fix was implemented to correct the array member
    initialization issue for repeated label addresses.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV85629

  • Reported component name

    XL C FOR AIX

  • Reported component ID

    5725C7100

  • Reported release

    D13

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-06-10

  • Closed date

    2016-06-10

  • Last modified date

    2016-06-10

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

    IV85047

  • 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

  • RD13 PSY

       UP



Document information

More support for: XL C for AIX
Compiler

Software version: D13

Reference #: IV85629

Modified date: 10 June 2016