Subject: Re: CLD symbol table object on Itanium From: John Reagan Date: Fri, 25 Mar 2005 19:31:45 GMT Newsgroups: comp.os.vms Rob Brooks wrote: > VAXman- @SendSpamHere.ORG writes: > >> brooks@cuebid.zko.dec.nospam (Rob Brooks) writes: >> >>> VAXman- @SendSpamHere.ORG writes: >>> >>>> So how are you supposed to use CLD symbol tables on Itanium? The linker >>>> balks at them when I try to link. >>>> >>>> %ILINK-W-RELODIFTYPE, relocation requests the linker to build a function descri >>>> symbol: CMDTBL >>>> relocation section: .rela$CODE$ (section header entry: 37) >>>> relocation type: RELA$K_R_IA_64_LTOFF_FPTR22 >>>> relocation entry: 51 >>>> module: CMD >>>> file: TOP$:[OBJ.IA64.V8_2]CMD.OBJ;2 >>> >>> >>> What's the definition of CMDTBL? > > > > Yeah, but how is it referenced in the calling program? I seem to recall that > the I64 linker is a bit more strict about certain attributes than the Alpha > linker. > To elaborate a bit more... The CMD table built by CDU must be declared as external data from your calling program. On Alpha, you can get away with declaring it as an external routine if all you did was take the address of the "routine" and pass it into CLI$DCL_PARSE, etc. However, on Itanium, the fact that the linker is much more involved with building function descriptors, relocations,etc., it turns out you can't do that "trick". We saw it most often in Fortran where you would write something like EXTERNAL CMDTBL and then use %LOC(CMDTBL) when you passed the address of the cmd table to the CLI$ routine. The problem is that "EXTERNAL CMDTBL" is declaring an external routine in Fortran, not external data. You can fall into the same trap in C, BLISS, etc. but in those languages you tend to have to write more characters to declare an external routine instead of external data. -- John Reagan HP Pascal/{A|I}MACRO for OpenVMS Project Leader Hewlett-Packard Company