Re: Fun trick

Liste des GroupesRevenir à co vms 
Sujet : Re: Fun trick
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vms
Date : 08. Jan 2025, 20:36:13
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vlmk3d$2u2t1$1@dont-email.me>
References : 1 2
User-Agent : Mozilla Thunderbird
On 1/8/2025 12:37 PM, John Reagan wrote:
On 1/7/2025 8:58 PM, Arne Vajhøj wrote:
During some troubleshooting over at VSI forum hb told me that
running a shareable image will execute LIB$INITIALIZE
functions.
>
That made me write this:
...
Pascal has an [INITIALIZE] attribute that you can put on the PROCEDURE CHECK and the compiler should do the contribution to the LIB$INITIALIZE PSECT.
 And you should include LIB$INITIALIZE (the code module, not the data PSECT) from STARLET when linking.  The x86 linker will do that for you, but the Alpha and Itanium linkers do not.
Zweite Sehr Verbesserte Ausgabe:
$ type lib.pas
[inherit('sys$library:pascal$lib_routines', 'sys$library:starlet')]
module lib(input, output);
[initialize]
procedure check;
var
    imgnam : varying [1024] of char;
begin
    lib$getjpi(item_code := jpi$_imagname, resultant_string := imgnam.body, resultant_length := imgnam.length);
    if index(imgnam, ']libshr.EXE') > 0 then begin
       writeln('This is a shareable image to link against not run');
       $exit(ss$_normal);
    end;
end;
[global]
procedure say;
begin
    writeln('Hi');
end;
end.
$ type prg.pas
program prg(input,output);
[external]
procedure say; external;
begin
    say;
end.
$ pas lib
$ link/share=libshr lib + sys$library:starlet/lib/incl=lib$initialize + sys$input/opt
SYMBOL_VECTOR=(say=PROCEDURE)
$
$ define/nolog libshr sys$disk:[]libshr
$ pas prg
$ link prg + sys$input/opt
libshr/share
$
$ run prg
Hi
$ run libshr
This is a shareable image to link against not run
Arne

Date Sujet#  Auteur
8 Jan 25 * Fun trick39Arne Vajhøj
8 Jan 25 +- Re: Fun trick1Lawrence D'Oliveiro
8 Jan 25 +* Re: Fun trick11John Reagan
8 Jan 25 i`* Re: Fun trick10Arne Vajhøj
8 Jan 25 i `* Re: Fun trick9John Reagan
8 Jan 25 i  +* Re: Fun trick2Arne Vajhøj
8 Jan 25 i  i`- Re: Fun trick1Arne Vajhøj
8 Jan 25 i  `* Re: Fun trick6Arne Vajhøj
14 Jan 25 i   `* Re: Fun trick5John Reagan
14 Jan 25 i    `* Re: Fun trick4Lawrence D'Oliveiro
14 Jan 25 i     `* Re: Fun trick3Arne Vajhøj
14 Jan 25 i      +- Re: Fun trick1Arne Vajhøj
15 Jan 25 i      `- Re: Fun trick1John Reagan
8 Jan 25 `* Re: Fun trick26hb0815
8 Jan 25  `* Re: Fun trick25Arne Vajhøj
8 Jan 25   `* Re: Fun trick24hb0815
9 Jan 25    `* Re: Fun trick23Arne Vajhøj
9 Jan 25     `* Re: Fun trick22hb0815
13 Jan 25      +* Re: Fun trick11Arne Vajhøj
17 Jan 25      i`* GNU diff command, was: Re: Fun trick10Simon Clubley
17 Jan 25      i `* Re: GNU diff command, was: Re: Fun trick9Craig A. Berry
17 Jan 25      i  `* Re: GNU diff command, was: Re: Fun trick8Craig A. Berry
19 Jan 25      i   `* Re: GNU diff command, was: Re: Fun trick7hb0815
21 Jan 25      i    `* Re: GNU diff command, was: Re: Fun trick6Craig A. Berry
22 Jan 25      i     `* Re: GNU diff command, was: Re: Fun trick5hb0815
22 Jan 25      i      `* Re: GNU diff command, was: Re: Fun trick4Lawrence D'Oliveiro
23 Jan 25      i       `* Re: GNU diff command, was: Re: Fun trick3Robert A. Brooks
24 Jan 25      i        `* Re: GNU diff command, was: Re: Fun trick2Simon Clubley
25 Jan 25      i         `- Re: GNU diff command, was: Re: Fun trick1Dave Froble
13 Jan 25      `* Re: Fun trick10Arne Vajhøj
13 Jan 25       `* Re: Fun trick9Lawrence D'Oliveiro
13 Jan 25        `* Re: Fun trick8Arne Vajhøj
14 Jan 25         +* Re: Fun trick6John Reagan
14 Jan 25         i`* Re: Fun trick5Arne Vajhøj
3 Feb 25         i +- Cobol (was Re: Fun trick)1Arne Vajhøj
3 Feb 25         i `* Re: Fun trick3Arne Vajhøj
3 Feb 25         i  `* Cobol (was: Re: Fun trick)2Arne Vajhøj
5 Feb 25         i   `- Re: Cobol1Arne Vajhøj
14 Jan 25         `- Re: Fun trick1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal