Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problem linking AMODE64 + ICSF = DLL under OMVS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
HenriqueS

New User


Joined: 17 Feb 2007
Posts: 30
Location: Brazil

PostPosted: Tue Jan 25, 2011 4:47 am    Post subject: Problem linking AMODE64 + ICSF = DLL under OMVS
Reply with quote

Hello,

I am having trouble trying to link a C DLL that uses ICSF under OMVS.

This is my command line:

Code:

cc -V -c -o MyDLL.o -Wc,dll,LP64,exportall -I. -I/usr/lpp/java/J6.0_64/include MyDLL.c > cmplisting.txt
#customize DD cards used by the linker
export _CC_L6SYSLIB="CSF.SCSFMOD0:CEE.SCEEBND2:SYS1.CSSLIB:CEE.SCEELIB"
export _CC_L6SYSIX="CEE.SCEELIB(CELQS003)"
cc -V -W l,dll,LP64 -o MyDLL.dll  MyDLL.o /usr/lpp/java/J6.0_64/bin/j9vm/libjvm.x > lnklisting.txt


This is my output:

Code:

 IEW2469E 9907 THE ATTRIBUTES OF A REFERENCE TO CSNFKRC FROM SECTION GenChav#C
          DO NOT MATCH THE ATTRIBUTES OF THE TARGET SYMBOL. REASON  2
 IEW2469E 9907 THE ATTRIBUTES OF A REFERENCE TO CSNFKRC FROM SECTION GenChav#C
          DO NOT MATCH THE ATTRIBUTES OF THE TARGET SYMBOL. REASON  2
FSUM3065 The LINKEDIT step ended with return code 8.


This message, according to the manuals is:
Quote:

Explanation: The interface attributes as indicated by the signatures stored in the ESDs and RLDs do not match. Either the reference was resolved to an incorrect module (which contained a symbol of the same name as the desired module) or there was an error in the source code. The possible values of the reason field are:
...
2. The xplink attributes of the reference and target do not match.
...


We had no messages showing up while compiling it under z/OS, but it seems we ended up not having the DLL we wanted in BOTH CASES (OMVS and z/OS compile/link), because it turned out to be an executable file (save attribute on the linker listing is EXECUTABLE = YES in both cases).

Still, a file got written to disk and I tried to use it anyway, but my main program (the one that uses the dll) crashed...

Any ideas?
Back to top
View user's profile Send private message

HenriqueS

New User


Joined: 17 Feb 2007
Posts: 30
Location: Brazil

PostPosted: Tue Jan 25, 2011 5:29 am    Post subject:
Reply with quote

Well, just to mention, I think the EXECUTABLE attribute is not the problem.

I did pull out the ICSF functions and recompiled the DLL just with pritfs from it. I got no complain from the linker, got EXECUTABLE = YES on the save module summary and it did run perfect.

SAVE SUMMARY for DLL with ICSF call (linker complains and crashes when called from main program):
Code:

1SAVE MODULE ATTRIBUTES:
    AC                  000
    AMODE                64
    COMPRESSION         BINDER DATA
    DC                  NO
    EDITABLE            YES
    EXCEEDS 16MB        NO
    EXECUTABLE          YES
    MIGRATABLE          NO
    OL                  NO
    OVLY                NO
    PACK,PRIME          NO,NO
    PAGE ALIGN          NO
    REFR                NO
    RENT                YES
    REUS                YES
    RMODE               ANY
    SCTR                NO
    SIGN                NO
    SSI
    SYM GENERATED       NO
    TEST                NO
    XPLINK              YES
    MODULE SIZE (HEX)   00000E38
    DASD SIZE (HEX)     0000B000


SAVE SUMMARY for DLL withOUT ICSF call (just printfs - works perfect called from main program):
Code:

    AC                  000
    AMODE                64
    COMPRESSION         BINDER DATA
    DC                  NO
    EDITABLE            YES
    EXCEEDS 16MB        NO
    EXECUTABLE          YES
    MIGRATABLE          NO
    OL                  NO
    OVLY                NO
    PACK,PRIME          NO,NO
    PAGE ALIGN          NO
    REFR                NO
    RENT                YES
    REUS                YES
    RMODE               ANY
    SCTR                NO
    SIGN                NO
    SSI
    SYM GENERATED       NO
    TEST                NO
    XPLINK              YES
    MODULE SIZE (HEX)   00000B80
    DASD SIZE (HEX)     0000B000



Just to remember, the compile and link command lines are the same for both version of the DLL:
Code:

cc -v -V -c -o MyDLL.o -W c,dll,LP64,exportall -I. -I/usr/lpp/java/J6.0_64/include MyDLL.c > cmplisting.txt
export _CC_L6SYSLIB="CSF.SCSFMOD0:CEE.SCEEBND2:SYS1.CSSLIB:CEE.SCEELIB"
export _CC_L6SYSIX="CEE.SCEELIB(CELQS003)"
cc -v -V -W l,dll,LP64,LET=8,COMPAT=ZOSV1R10 -o MyDLL.dll MyDLL.o /usr/lpp/java/J6.0_64/bin/j9vm/libjvm.x > lnklisting.txt
Back to top
View user's profile Send private message
HenriqueS

New User


Joined: 17 Feb 2007
Posts: 30
Location: Brazil

PostPosted: Wed Jan 26, 2011 9:59 pm    Post subject:
Reply with quote

Good news here...

As you may check, documentation clearly states that jsut referring to CSF.SCSFMOD0 on the DD SYSLIB should be enough as seen in http://publib.boulder.ibm.com/infocenter/zos/v1r11/index.jsp?topic=/com.ibm.zos.r11.csfb400/lnkcal.htm .

But following the documentation I was getting this all the time:

Code:

 IEW2469E 9907 THE ATTRIBUTES OF A REFERENCE TO CSNFKRC FROM SECTION GenChav#C
          DO NOT MATCH THE ATTRIBUTES OF THE TARGET SYMBOL. REASON  2
 IEW2469E 9907 THE ATTRIBUTES OF A REFERENCE TO CSNFKRC FROM SECTION GenChav#C
          DO NOT MATCH THE ATTRIBUTES OF THE TARGET SYMBOL. REASON  2
FSUM3065 The LINKEDIT step ended with return code 8.


A load module was saved but was corrupted, with broken references to the ICSF functions I was referring to. Listing the CSF.SCSFMOD0 library I could clearly see the module was there. Also, the reason code showed in the linker error message seemed to say that found a target module for my program call, but it was incompatible:

Quote:

IEW2469E THE ATTRIBUTES OF A REFERENCE TO symbol-name DO NOT MATCH THE ATTRIBUTES OF THE TARGET SYMBOL. REASON reason.

Explanation: The interface attributes as indicated by the signatures stored in the ESDs and RLDs do not match. Either the reference was resolved to an incorrect module (which contained a symbol of the same name as the desired module) or there was an error in the source code. The possible values of the reason field are:

2. The xplink attributes of the reference and target do not match.



So, I had no idea if this was some sort of documentation error from IBM or if the z/OS team here screwed up during the s.o. upgrade. But I kept researching and found several references of AMODE64 compile/linking in the PKCS#11 implementation from IBM (PKCS#11 is an standard library call, it is pretty much a wrapper, so instead of calling the CSNxxxxx ICSF calls, you call them using another naming scheme just for portability purposes, easing cross platform development). Bu in the end it relies on calling the ICSF functions...

There I found about SYS1.SIEALNKE and SYS1.SIEASID(CSFDLL64).

First, SYS1.SIEALNKE, a library with CSF calls compiled in AMODE64 with a CSFDLL64 member, so I did refer to in on my linker job SYSLIB .

Second, SYS1.SIEASID(CSFDLL64), is a "sidedeck" with a mapping scheme of 64 functions available in the target module for linking, this goes on the SYSLIN DD of my linker job...

Just to note that CSF.SCSFMOD0 was ripped off from the SYSLIB.

After that, tried new compile/link and it worked like a charm. Also, my caller AMODE64 app was able to call the ICSF function without issues.

I am leaving this here if anyone struggles with the same problem and if any IBMer is seeing this, it would be nice to investigate more about the issue and maybe update the ICSF Programming Guide manual, because the linkng instructions there do not work for AMODE64...

My z/OS here is 1.11.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts DB2 Streaming Batch Processing Problem Manshadi DB2 4 Sat Sep 24, 2016 12:14 pm
No new posts Problem with GETMAIN command amitc23 CICS 6 Thu Sep 01, 2016 1:01 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us