Yes, it is trivial to write a program that relocates itself and is not reliant on loader relocation of address constants.
That was not my point. My point was that generally speaking programs are not written that way, so moving "some" program with MVCL is not likely to result in a usable image. Can be written that way does not equal guaranteed to be written that way. Charles -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Paul Gilmartin Sent: Monday, August 23, 2021 2:30 AM To: [email protected] Subject: Re: Load Library Module Length and Load Macro Module Length different Values On Sun, 22 Aug 2021 17:04:20 -0700, Charles Mills wrote: >Not what you asked, but can one MVCL a load module from one address to >another and rely on its executing correctly? What about relocatable address >constants? (Less necessary today than once upon a time due to LARL, but >still lots of them around.) Of course in some case one might know that the >load module in question was a table e.g. that had no RLDs. > https://en.wikipedia.org/wiki/Position-independent_code I was once modifying a Pascal compiler to generate code to run embedded, on bare metal on 370-like processor. I added the capability to generate position-independent_code (PIC). I generated all pointers self-relative, used by the sequence: USING *,R15 ... LA Rx,POINTER AL Rx,POINTER Pascal has the limitation, useful in this case, of having no syntax to statically initialize pointers in data areas. The MVCL test worked. For other reasons the product never made GA. I believed the 360 base-displacement hardware design facilitated PIC, making RLDs unnecessary; OS designers ignored the capability. -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
