At 15:08 -0500 on 12/17/2015, Tony Harminc wrote about Re: Reltive branches to outside a control section:

<x-charset UTF-8>On 17 December 2015 at 01:36, Mark Boonie <[email protected]> wrote:
 The error was due to the target not having an RLD entry.  At Jim Mulder's
 suggestion, I created an ENTRY statement for the target instruction in the
 CSECT and an EXTRN in the file with the relative-branch.  (When I
 mentioned a "relative-branch instruction", I meant any of the
 relative-branch instructions, not specifically J instead of JLU.)  Now the
 JLU assembles fine, and the binder resolves the displacement.

But the Binder surely has no way of knowing what the displacement will
be at run time. Whatever loads your routine (the main one - not the
low storage one) needs to know the address difference and update the
JLU at that time. How does it gain knowledge of the load point (0) of
your called routine? Presumably the load process that loads your main
routine doesn't also load a module starting at virtual address 0!

So long as the CSECT with the ENTRY and the one with the relative branch and EXTRN are linked into the same load module the displacement from the Branch to the Target is fixed and resolved. WHERE the load module ends up loaded into memory is not important since the branch instruction operand has been resolved by the BINDER. This linkage of an EXTRN and ENTRY is the same as occurs with an ACON/VCON. The value in the load module created by the BINDER in the XCON is fixed and is the offset from the start of the load module.


The binder doesn't know that the module will be loaded at location 0, but I do, so no
 more relocation is necessary, as would be required if it was loaded
 somewhere else.

I'm still not getting it. Have you actually *run* this JLU?

 Yes, the target is an instruction.  It's simply a stub that branches to
 another location, not a full routine.

Sure - strange to my z/OS mind, but not "wrong".

Tony H.
</x-charset>

Reply via email to