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

[Re: <https://en.wikipedia.org/wiki/Position-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

Reply via email to