Chapter Contents

Previous

Next
Extended Names

Extended Names CSECTs

The compiler stores each extended name in one of two extended names CSECTs in the output object module. One of the extended names CSECTs contains the extended names of all of the static and extern functions defined in the compilation. The other extended names CSECT contains the extended names of all other external identifiers. The names of both CSECTs are formed from the compilation section name. The suffix character for the extended function name CSECT is a right angle bracket (>). The suffix character for the extended external identifier CSECT is a left angle bracket (<). Refer to Control Section Names for more information on CSECT names and how they are formed.


CSECT Format

Both extended names CSECTs have the same format. A representation of the extended names CSECT format in assembler language follows:

SNAME@>  CSECT
         DC   F'nnnn'
         DC   XL2'length-1 ',C'name-1'
         DC   XL2'length-2 ',C'name-2'
         .
         .
         .
         DC   XL2'0'
         END

The CSECT begins with a fullword value. Following this value is the length of the first extended name, length-1, represented as an unsigned halfword. The extended name, name-1, follows the length. The next extended name, name-2, follows the same format. The extended names are not terminated by nulls. Following all of the extended names is a halfword with all bits set to 0.

Extended external identifiers CSECT

The fullword field at the beginning of the extended external identifiers CSECT contains the minimum external symbol value, that is, the smallest value of external symbol nnnnnn used to create the external symbols for the extended external identifiers. The compiler assigns external symbols beginning with 750000 and increments by 1 for each extended external identifier. For example, the compiler assigns @@750000 to the first extended external identifier, @@750001 to the second, and @@750002 to the third. Because the maximum value for nnnnnn is 999999, there can be no more than 250,000 extended external identifiers, excluding function names, in a single compilation. This is also the maximum number of extended external identifiers in a load module.

Extended function names CSECT

In the extended function names CSECT, the fullword field contains a number created by hashing the compilation section name. The hash value is in the range from 0 through 749999. For a given external function name, the compiler determines an identifying number n for the function by adding the hash value to the offset of the length field of the external name in the CSECT. If n is greater than 749999, the compiler uses the offset in the CSECT as n, ignoring the hash value. In either case, the external name assigned by the compiler is @@NNNNNN, where NNNNNN is the decimal expansion of n, padded on the left with zeroes if necessary.

The following example illustrates the process of deriving external symbols for extended function names:

SNAME@>  CSECT
         DC   F'2456'
         DC   XL2'22',C'My_Structure_Type_Copy'
         DC   XL2'26',C'My_Structure_Type_Allocate'
         DC   XL2'24',C'My_Structure_Type_Delete'
         DC   XL2'0'
         END

The external symbol for My_Structure_Type_Copy is the offset of the length field in the CSECT, 2456+4, or @@002460. The external symbol for My_Structure_Type_Allocate is 2456+26, or @@002482. The external symbol for My_Structure_Type_Delete is 2456+52, or @@002508. The total number of extended function names in a compilation depends on the cumulative length of the function names; no extended function name can begin at a location greater than 750000 bytes from the start of the CSECT. However, this is not the limit of extended function identifiers in a load module.

The compiler also stows the external symbol in the function name field of the function prolog. This copy of the external symbol can be used at runtime to associate a function entry point with the original extended function name.


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.