Re: Linkage editor question: renaming duplicate entry points

2020-04-22 Thread Phil Smith III
Thanks to all who replied; CHANGE was indeed what I needed!

 


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Linkage editor question: renaming duplicate entry points

2020-04-15 Thread Bernd Oppolzer

I think the CHANGE command of the linkage editor will do what you want;

I remember to have used it when building a sort of "universal DB2 
interface"
out of the IBM delivered environment specific interfaces called DSNALI, 
DSNELI, DSNRLI etc.
They all provide an entry DSNHLI, which is normally called from the DB2 
application.
Normally you link your application with the desired interface; so you 
have different

load modules (one for TSO, one for Batch, one for RRSAF etc.).

If you don't want this, there exists an universal interface from IBM 
since some years.
But before that, we built such an universal interface ourself, that is: 
we combined the

different IBM interfaces into one single load module.

Because they have this duplicate entry DSNHLI (and also other duplicate 
entries),

they normally cannot be linked together in one load module; but they can,
if you CHANGE their duplicate CSECTs to have unique names. And then you 
have

to write a general interface which checks for the environment
(at first call only) and then calls the appropriate (now unique) 
specific interface.


There are some additional caveats with respect to connection startup and 
reset

and error handling, but in the end it worked without problems; only one
physical module for all environments, TSO, IMS/DC and batch.

Kind regards

Bernd


Am 15.04.2020 um 21:43 schrieb Phil Smith III:

I have a use case that's reasonable enough that it might be supported, yet odd 
enough that I'd be unsurprised if it isn't.

  


Suppose we have a function called AX that we call. At times it would be useful to be able 
to relink a program that calls AX to add a "shim"-let's call it AXPRIME-between 
the program and AX. Yet we don't want to change that program code, just relink it (or 
point at a different library and make a dynamic call to AX).

  


Ideally, we could tell the linker "OK, load deck AXPRIME [which has entry point AX 
defined]; now include deck AX but rename entry point AX in that deck to AXMINUS". 
And the AXPRIME code would call AXMINUS to do what AX usually does.

  


The alternative-hacking AX itself-is of course possible but undesirable, because we don't 
want the shim functionality to be there all the time, as it represents a security hole. 
The shim is added explicitly when needed, so it's a "your gun, your foot" deal.

  


Anyone know whether this is possible with IEWL or anything else?


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


Re: Linkage editor question: renaming duplicate entry points

2020-04-15 Thread Charles Mills
Sorry. CHANGE. Looked right at it and typed RENAME.

I believe order of statements is that CHANGE applies to what has come before. 
Ah. Read the fine manual. You  want

CHANGE AX(AXMINUS)

Right *before* the include for the old AX module:

"Placement: In the job stream or input data set, the CHANGE control statement 
must be placed before either the module containing the external symbol to be 
changed, or the INCLUDE control statement specifying the module. The scope of 
the CHANGE statement is across the next object module, load module, or program 
object. However if the -IMMED option is specified, the CHANGE control statement 
should be placed anywhere after the module being changed, or the INCLUDE 
statement specifying the module."

Charles


-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Steve Smith
Sent: Wednesday, April 15, 2020 1:32 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Linkage editor question: renaming duplicate entry points

I think I'd be unlikely to get it right on the first try.  I had never even
heard of the "RENAME" statement, but it exists, alongside the venerable
"CHANGE" statement.  I don't presently have the time to sort that out.  And
the required order of statements is sometimes surprising.  Nevertheless,
I'm sure it's doable.

sas

On Wed, Apr 15, 2020 at 4:12 PM Charles Mills  wrote:

> So every call to AX would instead call an entrypoint within a new module
> (except for one call from within that new module, which would call the old
> AX)?
>
> Yes, I think binder RENAME can do that.
>
> Code the new module to with a hard-coded entry of AX and an internal call
> to
> AXMINUS. No point in making that part difficult.
>
> Include the old AX. Follow that with RENAME AX(AXMINUS)
>
> Then Include the new module and everything else and link as normal.
>
> I think that is close at least. May require some tweaking.
>
> Charles
>
>
> -Original Message-
> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
> Behalf Of Phil Smith III
> Sent: Wednesday, April 15, 2020 12:44 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Linkage editor question: renaming duplicate entry points
>
> I have a use case that's reasonable enough that it might be supported, yet
> odd enough that I'd be unsurprised if it isn't.
>
>
>
> Suppose we have a function called AX that we call. At times it would be
> useful to be able to relink a program that calls AX to add a "shim"-let's
> call it AXPRIME-between the program and AX. Yet we don't want to change
> that
> program code, just relink it (or point at a different library and make a
> dynamic call to AX).
>
>
>
> Ideally, we could tell the linker "OK, load deck AXPRIME [which has entry
> point AX defined]; now include deck AX but rename entry point AX in that
> deck to AXMINUS". And the AXPRIME code would call AXMINUS to do what AX
> usually does.
>
>
>
> The alternative-hacking AX itself-is of course possible but undesirable,
> because we don't want the shim functionality to be there all the time, as
> it
> represents a security hole. The shim is added explicitly when needed, so
> it's a "your gun, your foot" deal.
>
>
>
> Anyone know whether this is possible with IEWL or anything else?
>
>
> --
> 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
>


-- 
sas

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


Re: Linkage editor question: renaming duplicate entry points

2020-04-15 Thread Steve Smith
I think I'd be unlikely to get it right on the first try.  I had never even
heard of the "RENAME" statement, but it exists, alongside the venerable
"CHANGE" statement.  I don't presently have the time to sort that out.  And
the required order of statements is sometimes surprising.  Nevertheless,
I'm sure it's doable.

sas

On Wed, Apr 15, 2020 at 4:12 PM Charles Mills  wrote:

> So every call to AX would instead call an entrypoint within a new module
> (except for one call from within that new module, which would call the old
> AX)?
>
> Yes, I think binder RENAME can do that.
>
> Code the new module to with a hard-coded entry of AX and an internal call
> to
> AXMINUS. No point in making that part difficult.
>
> Include the old AX. Follow that with RENAME AX(AXMINUS)
>
> Then Include the new module and everything else and link as normal.
>
> I think that is close at least. May require some tweaking.
>
> Charles
>
>
> -Original Message-
> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
> Behalf Of Phil Smith III
> Sent: Wednesday, April 15, 2020 12:44 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Linkage editor question: renaming duplicate entry points
>
> I have a use case that's reasonable enough that it might be supported, yet
> odd enough that I'd be unsurprised if it isn't.
>
>
>
> Suppose we have a function called AX that we call. At times it would be
> useful to be able to relink a program that calls AX to add a "shim"-let's
> call it AXPRIME-between the program and AX. Yet we don't want to change
> that
> program code, just relink it (or point at a different library and make a
> dynamic call to AX).
>
>
>
> Ideally, we could tell the linker "OK, load deck AXPRIME [which has entry
> point AX defined]; now include deck AX but rename entry point AX in that
> deck to AXMINUS". And the AXPRIME code would call AXMINUS to do what AX
> usually does.
>
>
>
> The alternative-hacking AX itself-is of course possible but undesirable,
> because we don't want the shim functionality to be there all the time, as
> it
> represents a security hole. The shim is added explicitly when needed, so
> it's a "your gun, your foot" deal.
>
>
>
> Anyone know whether this is possible with IEWL or anything else?
>
>
> --
> 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
>


-- 
sas

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Linkage editor question: renaming duplicate entry points

2020-04-15 Thread Binyamin Dissen
Look at the binder CHANGE directive

On Wed, 15 Apr 2020 15:43:49 -0400 Phil Smith III  wrote:

:>I have a use case that's reasonable enough that it might be supported, yet 
odd enough that I'd be unsurprised if it isn't.
:>
:> 
:>
:>Suppose we have a function called AX that we call. At times it would be 
useful to be able to relink a program that calls AX to add a "shim"-let's call 
it AXPRIME-between the program and AX. Yet we don't want to change that program 
code, just relink it (or point at a different library and make a dynamic call 
to AX).
:>
:> 
:>
:>Ideally, we could tell the linker "OK, load deck AXPRIME [which has entry 
point AX defined]; now include deck AX but rename entry point AX in that deck 
to AXMINUS". And the AXPRIME code would call AXMINUS to do what AX usually does.
:>
:> 
:>
:>The alternative-hacking AX itself-is of course possible but undesirable, 
because we don't want the shim functionality to be there all the time, as it 
represents a security hole. The shim is added explicitly when needed, so it's a 
"your gun, your foot" deal.
:>
:> 
:>
:>Anyone know whether this is possible with IEWL or anything else?
:>
:>
:>--
:>For IBM-MAIN subscribe / signoff / archive access instructions,
:>send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
Binyamin Dissen 
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Linkage editor question: renaming duplicate entry points

2020-04-15 Thread Charles Mills
So every call to AX would instead call an entrypoint within a new module
(except for one call from within that new module, which would call the old
AX)?

Yes, I think binder RENAME can do that.

Code the new module to with a hard-coded entry of AX and an internal call to
AXMINUS. No point in making that part difficult.

Include the old AX. Follow that with RENAME AX(AXMINUS)

Then Include the new module and everything else and link as normal.

I think that is close at least. May require some tweaking.

Charles


-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of Phil Smith III
Sent: Wednesday, April 15, 2020 12:44 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Linkage editor question: renaming duplicate entry points

I have a use case that's reasonable enough that it might be supported, yet
odd enough that I'd be unsurprised if it isn't.

 

Suppose we have a function called AX that we call. At times it would be
useful to be able to relink a program that calls AX to add a "shim"-let's
call it AXPRIME-between the program and AX. Yet we don't want to change that
program code, just relink it (or point at a different library and make a
dynamic call to AX).

 

Ideally, we could tell the linker "OK, load deck AXPRIME [which has entry
point AX defined]; now include deck AX but rename entry point AX in that
deck to AXMINUS". And the AXPRIME code would call AXMINUS to do what AX
usually does.

 

The alternative-hacking AX itself-is of course possible but undesirable,
because we don't want the shim functionality to be there all the time, as it
represents a security hole. The shim is added explicitly when needed, so
it's a "your gun, your foot" deal.

 

Anyone know whether this is possible with IEWL or anything else?


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


Re: Linkage editor question: renaming duplicate entry points

2020-04-15 Thread Paul Gilmartin
On Wed, 15 Apr 2020 15:43:49 -0400, Phil Smith III wrote:

>I have a use case that's reasonable enough that it might be supported, yet odd 
>enough that I'd be unsurprised if it isn't.
>
>Suppose we have a function called AX that we call. At times it would be useful 
>to be able to relink a program that calls AX to add a "shim"-let's call it 
>AXPRIME-between the program and AX. Yet we don't want to change that program 
>code, just relink it (or point at a different library and make a dynamic call 
>to AX).
> 
I'd say put a library contaning the shim AX first in STEPLIB.
The shim AX could then LINK the real AX with TASKLIB containing it
concatenated first.  But I fear that CSV may outwit you.

>Ideally, we could tell the linker "OK, load deck AXPRIME [which has entry 
>point AX defined]; now include deck AX but rename entry point AX in that deck 
>to AXMINUS". And the AXPRIME code would call AXMINUS to do what AX usually 
>does.
>
>The alternative-hacking AX itself-is of course possible but undesirable, 
>because we don't want the shim functionality to be there all the time, as it 
>represents a security hole. The shim is added explicitly when needed, so it's 
>a "your gun, your foot" deal.
>
>Anyone know whether this is possible with IEWL or anything else?

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Linkage editor question: renaming duplicate entry points

2020-04-15 Thread Phil Smith III
I have a use case that's reasonable enough that it might be supported, yet odd 
enough that I'd be unsurprised if it isn't.

 

Suppose we have a function called AX that we call. At times it would be useful 
to be able to relink a program that calls AX to add a "shim"-let's call it 
AXPRIME-between the program and AX. Yet we don't want to change that program 
code, just relink it (or point at a different library and make a dynamic call 
to AX).

 

Ideally, we could tell the linker "OK, load deck AXPRIME [which has entry point 
AX defined]; now include deck AX but rename entry point AX in that deck to 
AXMINUS". And the AXPRIME code would call AXMINUS to do what AX usually does.

 

The alternative-hacking AX itself-is of course possible but undesirable, 
because we don't want the shim functionality to be there all the time, as it 
represents a security hole. The shim is added explicitly when needed, so it's a 
"your gun, your foot" deal.

 

Anyone know whether this is possible with IEWL or anything else?


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN