Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!rutgers!labrea!aurora!ames!ucbcad!ucbvax!germany.CSNET!F1142S30%unika2
From: F1142S30%unika2@germany.CSNET (Juergen Renz)
Newsgroups: comp.os.vms
Subject: Re: Are Transfer Vectors Truly Useful When Creating Shareable Images?
Message-ID: <8707220428.AA22024@ucbvax.Berkeley.EDU>
Date: Tue, 21-Jul-87 04:57:00 EDT
Article-I.D.: ucbvax.8707220428.AA22024
Posted: Tue Jul 21 04:57:00 1987
Date-Received: Fri, 24-Jul-87 00:45:33 EDT
Sender: daemon@ucbvax.BERKELEY.EDU
Distribution: world
Organization: The ARPA Internet
Lines: 49

In article <2961@blia.BLI.COM> forrest@blia.BLI.COM (Jon Forrest) writes:
>For example, let's say that a sharable image contains variable A which
>is 10 bytes long and begins at location 100 and variable B which is
>20 bytes long and begins at location 110. We can assume both are
>universal symbols. The user links an application program that references
>both variables with this sharable image. Everything works fine.
>Meanwhile, the software developer who sold the user the shareable
>image modifies variable A so that it now is 20 bytes long. This
>means that variable A begins at 100, as before, but now variable
>B now begins at location 120. Then, the user receives this new
>shareable image and, much to his consternation, finds that his
>program bombs every time he references location B.

Randy Buckland answers:
>The solution is really simple. Have a section of code that will
>always be at a fixed address and will contain pointers to the data structures.
>The pointers will always be 4 bytes and the addresses won't change. You
>can change the size of the structure and you could even change it
>at run time and the program won't care since it always accesses it through
>the pointer that is in a known location.

Your wrong Randy !
One transfer vector takes up to 8 bytes (entry routine):

        .transfer       routine
        .mask           routine
        jmp             L^routine+2

or at least 2 bytes (subroutine):

        .transfer       subroutine
        bsb             subroutine      ! this is not recommended

mostly it takes 6 bytes for subroutines:

        .transfer       subroutine
        jmp             L^subroutine

Refer to the MACRO reference manual for the complete information.

The great advantage of transfer vectors is:
  You need not recompile your programs, if a new version of the shared library
  is build, because the location of the vectors doesn't change.
  The location of the routines will mostly change.

Juergen Renz                                        Universitaet Karlsruhe
Falkengarten 7                                      Institut fuer Informatik IV
D-7530 Pforzheim
West-Germany