Hi, I think I recall problems with static linkage when LE DLLs are mixed with non LE assembler modules (which I assume you are using non LE and no DLL). If your assembler is LE conforming and uses CEEENTRY, it needs to have MAIN=NO. Have you tried calling the Assembler dynamically from C using fetch and the procedure pointer, like this example for COBOL does: linkage(CBL_FUNC,COBOL).
typedef void CBL_FUNC(); . . . CBL_FUNC *fetch_ptr; fetch_ptr = (CBL_FUNC*) fetch("COBEP"); /* fetch the routine */ fetch_ptr(args); /* call COBEP */ On JVM execution you can try the following option to percolate e.g. an 0C4 or S806: -Xsignal:userConditionHandler=percolate Denis. -----Original Message----- From: Don Poitras <sas...@sas.com> To: IBM-MAIN <IBM-MAIN@LISTSERV.UA.EDU> Sent: Tue, Mar 21, 2017 2:43 pm Subject: Re: Java->C->HLASM non-XPLINK First, more people will see your post if you send to the listserv rather than the newsgroup. Second, you need to have R13 pointing to a save area when you call the non-XPLINK program. If it has any parms, you need to have R1 pointing to them. If you are in AMODE 64 and calling an AMODE 31 program, you need to copy the parms below the bar and make sure that all pointers in the parms (or in blocks pointed to by the parms) are also below the bar. I've found the easiest way to do this is to have the asm program you call be an XPLINK assembler stub that fixes up the stack and parms and you pass it the address of the routine to call and the plist. In article <b4661f65-f4ac-4718-aa59-8845d422a...@googlegroups.com> you wrote: > Hi. I am not new to any of this, but _am_ new to java on z/OS.... > I'm just trying to get some ideas firmed up in my head, by playing with code. > I am having no luck at all calling HLASM unless it's an XPLINK module. > I know what my end-game is -- a java class which will call an existing HLASM > module, which is _not_ XPLINK -- I wrote a dummy HLASM program called > JAVAOSLI, which simply does a WTO. > It's my understanding that the only way to call HLASM from java is via an > intermediate C program, using JNI. > That means this intermediate C program will need to be XPLINK. > So, how does that mesh with the fact that this C program will call a > non-XPLINK program? > I thought this would be handled in the C program with a #pragma for the HLASM > program, but I seem to be missing something.... > Some snippets follow. > > my C implementation: of my java JNI function: > extern void JAVAOSLI(void); > #pragma linkage (JAVAOSLI,OS) > /* Implementation of JNI C function. */ > JNIEXPORT int JNICALL > Java_sbjava_MYClass_cFunction1(JNIEnv *e, jobject o) { > printf("in ... Java_sbjava_MYClass.cFunction1\n"); > printf("call JAVAOSLI\n"); > JAVAOSLI(); > printf("returned from call JAVAOSLI\n"); > return (0); > } > > My compile: > c89 -c -o sbjava_myc.o -W "c,langlvl(extended)" -W c,exportall -DNEEDSIEEE754 > -DNEEDSLONGLONG -I/usr/lpp/java/J7.0/include -I/usr/lpp/java/J7.0/include/zos > sbjava_myc.c > > > My link: > c89 -Wl,map -o libsbjava_myc.so sbjava_myc.o "//OBJ(JAVAOSLI)" > > > I see the output from the first 2 printfs ("in ... > Java_sbjava_MYClass.cFunction1", and "call JAVAOSLI") , then I get my error > during the JAVAOSLI() call: > Unhandled exception > Type=Segmentation error vmState=0x00040000 > J9Generic_Signal_Number=00000004 Signal_Number=0000000b Error_Value=00000000 > Signal_Code=00000035 > Handler1=13526F80 Handler2=13AB3C80 > > I'm assuming the problem is the linkage somewhere along the way. > > Any ideas where I am going wrong? > If I change the assembler program to XPLINK, and use the xplink comile/link > options, it all works. -- Don Poitras - SAS Development - SAS Institute Inc. - SAS Campus Drive sas...@sas.com (919) 531-5637 Cary, NC 27513 ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN