> If dynamically loaded, read the module to any location with a
> channel program.  RLDs were resolved by linker.

The binder and linkage editor relocate addresses relative to the module. 
Somebody still has to adjust them relative to where you read in the module. 
Which, BTW, is not as easy as it sounds.

OS/360 and OS/VS1 had SVC transient areas. No adcons were allowed in type 3 and 
4 SVC routines.
     


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
Paul Gilmartin [0000000433f07816-dmarc-requ...@listserv.ua.edu]
Sent: Monday, August 23, 2021 9:22 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Relocatability (was: Load Library Module Length ...)

On Mon, 23 Aug 2021 11:54:19 +0000, Seymour J Metz wrote:

[Re: 
<https://secure-web.cisco.com/1LUGiGKrOCO5YgBhHj1lbduJ_JlWU83NOxQUJDpdKXDB-PkOXDQNNottIrLcJ7i9fehwk6ym1gOrw1ylJ12hPQjHDvpRQjubrUSucEm1h-bc3Jms67yOjgbG0Gh19ewEhDFhXcajzqYVXlHpvwKpWDLAXnC1HquJTzBLU12t3kB_Ssc-34E0tQp7xNzdIlbwh5pERWpYdzysq4AWyJFD9F-kZv0S6N7K1Fd2Sxwrf896J_JgIw3ekFnVGOuwd8aDALvJhD4WcSqj1rfBYmn2WQrS5UWYMMdiVydN2rMYNTZUJ0axBC-FDHNqrrgJxs7su1TXYfBfTOzLXxmVj06x8PqKbY78VnYpjyG-DBtQro-Om793V35mT0l92EGIKUP2leUswUq9dkIK_oeoZBci0GiBv21AaAylWsevoukJkQGTMvaRNWas7L2ofS4DW0SeF/https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FPosition-independent_code>]

>How would you handl calls to sepaerately compiled subroutines without RLD? How 
>would you write PIC that called external subroutines?
>
If statically linked:

         LA     R15,EPTR
         AL    R15,EPTR
         BALR  R14,R15  R15 is available as a code base.
         ...
* Linker will resolve RLDs -- pairing makes the value absolute.
EPTR     DC    A(SUBR-*)  This value is position-independent.

If dynamically loaded, read the module to any location with a
channel program.  RLDs were resolved by linker.
Place its address in R15
         BALR  R14,R15  R15 is available as a code base.

Some OS (DOS 360?) (CMS?) had a convention of "transient"
modules, loadable anywhere, either PIC or containing prologues
to modify addresses.

I recall FORTRAN II for IBM 700/7000.  Each subroutine contained
a prologue to replace addresses of formal parameters with addresses
of actual parameters.  Self-modifying; horribly NORENT.

>________________________________________
>From: Paul Gilmartin
>Sent: Monday, August 23, 2021 5:29 AM
>
>On Sun, 22 Aug 2021 17:04:20 -0700, Charles Mills wrote:
>
>>Not what you asked, but can one MVCL a load module ...
>>Of course in some case one might know that the
>>load module in question was a table e.g. that had no RLDs.
>>
>https:[...]
>
>I was once modifying a [FOSS] Pascal compiler ...

-- gil

----------------------------------------------------------------------
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

Reply via email to