Chapter Contents |
Previous |
Next |
Extended Names |
To get a clearer picture of the content of these CSECTs,
examine an OMD370 listing. Use the
verbose
option to include the extended
names CSECTs in the disassembly. For more information about the constants
CSECT and the run-time constants CSECT, refer to Compiler-generated Names. Code Generation Conventions also
contains more information about CSECT addressing at execution time.
The PRTNAME Function |
void prtname(_remote void (*) (void));
The PRTNAME Function shows the PRTNAME function.
The PRTNAME Function
PRTNAME@ CSECT CREGS USING USING CPROLOG,R2 PRTNAME CENTRY DSA=DSALEN L R2,0(,R1) R2 -> function pointer L R2,0(,R2) R2 -> function prolog LA R3,CPROFNM R3 -> function name CLC =C'@@',CPROFNM Start with @@? BNE NOTEXTND No - not an extended name L R4,CPROCONS R4 -> constant CSECT L R4,8(,R4) R4 -> run-time constants CSECT L R4,12(,R4) R4 -> extended function names CSECT LTR R4,R4 Set to 0 if CSECT not present. BZ NOTEXTND L R0,0(,R4) R0 = SNAME hash value PACK EXTSYM(8),CPROFNM+2(6) Convert 6 digits in external CVB R5,EXTSYM symbol name to binary. CR R5,R0 Is symbol less than hash value? BNH FOUND If so, don't subtract. SR R5,R0 If not, subtract hash value. FOUND DS 0H AR R5,R4 R5 -> length of extended name LH R0,0(,R5) R0 = length ST R0,NAMELEN Store in printf parm list. LA R5,2(,R5) R5 -> extended name ST R5,NAME Store in printf parm list. B CALLPRTF Go call printf. * * Handle function names that aren't extended. * NOTEXTND DS 0H MVC NAMELEN,=F'8' Store length in plist. ST R3,NAME Store pointer to name in plist. * * Call printf to print the function name. * CALLPRTF DS 0H MVC FORMAT,=A(FMTSTR) LA R1,PARMLIST L R15,=V(PRINTF) BALR R14,R15 CEXIT DSA=DSALEN,RC=0 DROP R2 LTORG FMTSTR DC C'"%.*s"',X'1500' printf format COPY DSA EXTSYM DS 8C decimal-to-binary conversion area PARMLIST DS 0F printf parameter list FORMAT DS A NAMELEN DS A NAME DS A DSALEN EQU *-DSA COPY CPROLOG COPY CRAB
Two tests are performed to discover if the function
has an extended name. The first test determines if the name stored in the
function prolog begins with
@@
. The second test determines if the address of
the extended function names CSECT is nonzero. If the
NOXFNMKEEP
COOL option
is specified, this address is set to 0, and the extended function names CSECT
is deleted from the output object file.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.