JP3293821B2 - Dynamic link system - Google Patents

Dynamic link system

Info

Publication number
JP3293821B2
JP3293821B2 JP31185188A JP31185188A JP3293821B2 JP 3293821 B2 JP3293821 B2 JP 3293821B2 JP 31185188 A JP31185188 A JP 31185188A JP 31185188 A JP31185188 A JP 31185188A JP 3293821 B2 JP3293821 B2 JP 3293821B2
Authority
JP
Japan
Prior art keywords
common section
program
length
area
common
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP31185188A
Other languages
Japanese (ja)
Other versions
JPH02157936A (en
Inventor
雅春 井尻
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP31185188A priority Critical patent/JP3293821B2/en
Publication of JPH02157936A publication Critical patent/JPH02157936A/en
Application granted granted Critical
Publication of JP3293821B2 publication Critical patent/JP3293821B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】TECHNICAL FIELD OF THE INVENTION

本発明は、主プログラムと複数の外部手続きの間で共
通に使用されるデータを共通区の宣言を通じて参照する
コモンセクション方式に係り、更に詳しくは、コモンセ
クションを有するロードモジュール間の動的リンクを行
う動的リンクシステムに関する。
The present invention relates to a common section method of referring to data commonly used between a main program and a plurality of external procedures through a declaration of a common area, and more particularly, to a dynamic link between load modules having a common section. Related to dynamic linking system.

【0002】 近年、汎用計算機システムばかりでなく、パーソナル
ユースの計算機システムにおいても、利用者プログラム
の保守性のために、ロードモジュールすなわち、実行可
能なプログラムそのものの間で動的にリンクして、使用
する要求が高まってきた。ロードモジュール間で動的に
リンクすることにより利用者プログラム実行時のワーキ
ング領域が削減でき、重複したプログラムコードの保有
に起因するロードモジュールの保管ディスク容量が膨張
するという問題を回避することが可能である。
In recent years, not only general-purpose computer systems but also personal-use computer systems have been used by dynamically linking load modules, that is, executable programs themselves, for maintainability of user programs. Demands have been growing. By dynamically linking between load modules, the working area when executing a user program can be reduced, and it is possible to avoid the problem of expanding the storage disk capacity of load modules due to possession of duplicate program code. is there.

【0003】[0003]

【従来の技術】[Prior art]

従来、複数個のプログラム単位の間でデータを共有し
て利用するコモンセクションの方式では、コモンセクシ
ョンの宣言は、ソースプログラムで行い、コンパイル
し、リンクし、ローダへの入力としていた。ロードモジ
ュール化された後では、動的リンクする機構はサポート
できず、コモンセクションの有無を識別する機構はまっ
たく装備されていなかった。
Conventionally, in a common section method in which data is shared and used between a plurality of program units, a common section is declared in a source program, compiled, linked, and input to a loader. After being load-moduleized, it could not support a mechanism for dynamically linking, and had no mechanism for identifying the presence or absence of a common section.

【0004】[0004]

【発明が解決しようとする課題】[Problems to be solved by the invention]

従って、従来のローティング機構ではコモンセクショ
ンを保持するロードモジュール間の動的リンクの処理は
禁止されていた。そのため、複数のロードモジュールに
対して利用者プログラムの保守を行う時にも、コンパイ
ル単位のロードモジュールの入れ替えが出来ず、必ず静
的リンクのやり直しを伴っていた。このため、煩雑なロ
ードモジュール関係の管理が必要となり、保守時間の無
駄と、管理の複雑化といった問題が生じていた。
Therefore, in the conventional loading mechanism, processing of a dynamic link between load modules holding a common section has been prohibited. For this reason, even when the user program is maintained for a plurality of load modules, the load modules cannot be replaced for each compilation unit, and static linking must be performed again. For this reason, complicated management of load modules is required, which causes problems such as wasted maintenance time and complicated management.

【0005】 さらに静的リンクを行っているため、実行時に不必要
なワーキングセットが増加したり、ロードモジュールの
保管ディスク容量が膨張するという問題が生じていた。 本発明は、コモンセクションを保持するロードモジュ
ール群の間で動的リンクを可能とすることを目的とす
る。
[0005] Furthermore, since the static link is performed, unnecessary working sets increase at the time of execution, and the storage disk capacity of the load module expands. An object of the present invention is to enable a dynamic link between a group of load modules holding a common section.

【0006】[0006]

【課題を解決するための手段】[Means for Solving the Problems]

本発明は、コモンセクションの宣言がなされた複数の
ロードモジュール間の動的リンクを行う動的リンクシス
テムにおいて、既にローティング済みの第1のロードモ
ジュールから動的リンクを要求された第2のロードモジ
ュールをローティングする際、この第2のロードモジュ
ール中で宣言されているコモンセクションの長さと既存
のコモンセクションの長さとを比較判定する比較判定手
段と、この比較判定手段において、上記第2のロードモ
ジュール中で宣言されているコモンセクションの長さの
方が上記既存のコモンセクションの長さよりも長いと判
定された場合、上記第2のロードモジュール中で宣言さ
れているコモンセクションの長さに等しい長さの領域を
新たに獲得し、上記既存のコモンセクションの内容を当
該新領域に複写し、当該新領域を新たなコモンセクショ
ン領域として、コモンセクションの宣言された各ロード
モジュールにアクセスさせるアクセス制御手段と、を有
することを特徴とするものである。
The present invention provides a dynamic link system for dynamically linking a plurality of load modules for which a common section has been declared, in which a second load for which a dynamic link has been requested from a first loaded module that has already been loaded. When loading the module, the comparison and determination means for comparing the length of the common section declared in the second load module with the length of the existing common section; If it is determined that the length of the common section declared in the load module is longer than the length of the existing common section, the length of the common section declared in the second load module is determined. Obtain a new area of equal length, copy the contents of the existing common section to the new area, The 該新 region as a new common section area, is characterized in that it has an access control means for accessing each of the load modules that are declared common section, the.

【0007】 図1は本発明を更に詳しく説明した原理図であり、以
下に図1を用いて、本発明をより具体的に説明する。 利用者プログラムがまず動的リンク要求(CALL文呼び
出し、関数呼び出し等)を行って、システムコールす
る。そして、動的リンク機構において、コモンセクショ
ンの有無識別手段1は、動的リンクを要求されたプログ
ラムがコモンセクション付のロードモジュールか否か
(すなわち、コモンセクションの宣言がなされているロ
ードモジュールか否か)の識別を行う。 コモンセクションの共用制御手段2は、動的リンクを
要求されたロードモジュールがコモンセクション付でな
ければ従来の動的リンク機構を利用し、コモンセクショ
ン付であれば、すでに獲得されたコモンセクションが存
在するか否かをコモンセクション共用制御表の検索によ
って調べる。そして、既存のコモンセクションがないと
判断したときは、動的リンクの要求されたロードモジュ
ールをローディングする際、コモンセクションを新たに
獲得する。すなわち、コモンセクション共用制御表を新
たに作成すると共に、コモンセクションポインタにコモ
ンセクションの領域のアドレスを設定する制御を行う。
FIG. 1 is a principle diagram for explaining the present invention in further detail, and the present invention will be described more specifically with reference to FIG. The user program first makes a dynamic link request (CALL statement call, function call, etc.) and makes a system call. In the dynamic link mechanism, the common section presence / absence identifying means 1 determines whether the program requested to be dynamically linked is a load module with a common section (that is, whether the program is a load module for which a common section is declared). ) Is identified. The common section common control means 2 uses the conventional dynamic link mechanism if the load module requested for dynamic link does not have a common section, and if the load module has a common section, the already obtained common section exists. Whether or not to perform is checked by searching the common section common control table. If it is determined that there is no existing common section, a new common section is acquired when loading the load module required for the dynamic link. That is, a new common section common control table is created, and control is performed to set the address of the common section area to the common section pointer.

【0008】 コモンセクションの共用制御手段2で、既存のコモン
セクションが有ると判断したときは、動的リンクの要求
されたロードモジュール中で宣言されているコモンセク
ションの長さが既存のコモンセクションの長さよりも長
いかどうかをコモンセクションの誤長検出手段3で検出
する。その結果、上記宣言されているコモンセクション
の長さが既存のコモンセクションの長さ以下である場合
には、コモンセクションのアクセス制御手段4は、既存
のコモンセクションのアドレスをコモンセクションポイ
ンタ領域に設定する。 一方、上記宣言されているコモンセクションの長さが
既存のコモンセクションの長さよりも長い場合には、コ
モンセクションのアクセス制御手段4は、上記宣言され
ているコモンセクションの長さに等しい長さの領域を新
たに獲得した後、この新領域に上記既存のコモンセクシ
ョンの内容を複写すると共に、この既存のコモンセクシ
ョンを参照するプログラムの全コモンセクションポイン
タを新たに獲得したコモンセクション領域のアドレスに
変更し、以前のコモンセクション領域を返却する制御を
行ってコモンセクションへのアクセスを可能とし、コモ
ンセクションの宣言されたロードモジュール群の実行時
にリンクを可能とする。
When the common section sharing control means 2 determines that there is an existing common section, the length of the common section declared in the load module required for the dynamic link is changed to the length of the existing common section. Whether the length is longer than the length is detected by the erroneous length detection means 3 of the common section. As a result, if the length of the declared common section is less than or equal to the length of the existing common section, the common section access control means 4 sets the address of the existing common section in the common section pointer area. I do. On the other hand, when the length of the declared common section is longer than the length of the existing common section, the common section access control means 4 sets the length of the common section to be equal to the length of the declared common section. After acquiring a new area, copy the contents of the existing common section into this new area and change all the common section pointers of the programs that refer to this existing common section to the addresses of the newly acquired common section area. Then, control is performed to return the previous common section area to enable access to the common section, and linking is enabled when executing a load module group in which the common section is declared.

【0009】 このようにするとで、コモンセクションの宣言がなさ
れたロードモジュール間の動的リンクが実現される。
In this way, a dynamic link between load modules for which a common section is declared is realized.

【0010】[0010]

【発明の実施の形態】BEST MODE FOR CARRYING OUT THE INVENTION

次に本発明の実施例を図面を参照して説明する。 一般にオブジェクトプログラムが直接実行形態で動く
機械語はロードモジュールと呼ばれる。このロードモジ
ュールを作成する場合には、幾つかの単位に区切られた
プログラムを読み込んで、プログラム相互にまたがる名
前の参照を解釈し、更にその名前による参照を番地によ
る参照を換えるため、リンケージという作業が行われ
る。与えられたプログラムは必要なだけの標準的な副プ
ログラム類を選択して結合するセレクティブローディン
グの機能を有している。更にプログラムに指定された変
数の初期値等が代入されて、ロードモジュールが形成さ
れる。
Next, an embodiment of the present invention will be described with reference to the drawings. Generally, a machine language in which an object program runs in a direct execution form is called a load module. When creating this load module, read the program divided into several units, interpret the reference of the name that crosses the programs, and change the reference by the name to the reference by the address. Is performed. A given program has a selective loading function that selects and combines as many standard subprograms as necessary. Further, the load module is formed by substituting the initial values of the variables specified in the program.

【0011】 FORTRAN等で書かれたプログラムにおける手続きは、
1つの主プログラムと複数個のサブルーチン、すなわち
外部手続きに分割されている。これら分割された手続き
では、各々の関数やサブルーチンがプログラム単位であ
って、各プログラム単位で、名前(名標と呼ばれる)の
有効範囲の局所性を定める必要がある。その名標によっ
て参照されるデータはプログラム単位の内部に閉じめら
れる場合もあれば他のプログラム単位とやりとりされる
場合もあり、また共通区すなわちコモンセクションの宣
言を通してコモンセクション中のデータをお互いに参照
する場合もある。
[0011] The procedure in a program written in FORTRAN or the like is as follows.
It is divided into one main program and a plurality of subroutines, that is, external procedures. In these divided procedures, each function or subroutine is a program unit, and it is necessary to determine the locality of the effective range of a name (called a mark) in each program unit. The data referred to by its name may be confined within the program unit, may be exchanged with other program units, and may exchange data in the common section with each other through a common area or common section declaration. Sometimes referred to.

【0012】 一般に、複数個のプログラム単位がある1つのコモン
セクションのデータを参照する場合、それらのプログラ
ム単位の実行中はそのコモンセクション中のデータの値
は保存されるが、コモンセクションを宣言しているプロ
グラム単位のうち、実行系列の最下位のものの実行が終
わるとそのコモンセクション中のデータの値は不定とな
る。例えばプログラム単位Aがプログラム単位BとCを
呼んでいる、すなわちコールしているとした場合で、さ
らにそのBとCはコモンセクションXのデータを共用す
るとする。
In general, when referring to data of one common section having a plurality of program units, data values in the common section are preserved during execution of those program units, but the common section is declared. After the execution of the lowest unit of the execution sequence among the program units, the value of the data in the common section becomes indefinite. For example, it is assumed that the program unit A calls the program units B and C, that is, it is calling, and the B and C share data of the common section X.

【0013】 このような場合には、一般にプログラム単位BとCの
中にコモンセクションの宣言を書き、そのBとCを呼ん
でいるプログラム単位A、すなわち上記のプログラム単
位にもしコモンセクションXの宣言がない場合には、B
やCの実行が終わった時点ではXの値は不定となる。
In such a case, a common section declaration is generally written in the program units B and C, and the program unit A which calls the B and C, that is, the common unit X If not, B
When the execution of C or C is completed, the value of X is undefined.

【0014】 一般に、複数のプログラム単位上で個別に定義される
コモンセクションはこのため、ソースプログラムのみで
定義されていた。コモンセクションを保持するロードモ
ジュール群の間では動的にリンクすることが出来なかっ
たため、コンパイル単位のロードモジュールの入れ替え
が出来ない等の問題が生じていた。そこで、本発明はコ
モンセクションを保持するロードモジュール群の間でも
動的にリンクを可能にしたものである。
In general, a common section defined individually on a plurality of program units is therefore defined only by a source program. Since it was not possible to dynamically link between the load modules that hold the common section, problems such as the inability to switch the load modules in compilation units occurred. Thus, the present invention dynamically enables linking between load modules that hold a common section.

【0015】 図2は本発明の構成図で、図3はコモンセクションへ
のアクセス手順の実施例図である。図2,図3において5
は利用者プログラム、6は動的リンク機構、1はコモン
セクションの有無を識別する識別機構、2はコモンセク
ションの共用制御機構、3は誤長検出機構、4はコモン
セクションへのアクセス機構である。
FIG. 2 is a configuration diagram of the present invention, and FIG. 3 is an embodiment diagram of a procedure for accessing a common section. 2 and FIG.
Is a user program, 6 is a dynamic link mechanism, 1 is an identification mechanism for identifying the presence or absence of a common section, 2 is a common section shared control mechanism, 3 is an error length detection mechanism, and 4 is an access mechanism to the common section. .

【0016】 図2に示されるように、本発明では、コモンセクショ
ン付のロードモジュールか否かを識別機構1で識別し、
コモンセクション付でなければ、従来通りの動的リンク
機構を利用する。すなわち、各プログラム単位で共通に
使われる共通データはないので、従来通りの動的リンク
機構が可能となる。識別機構1において、もしコモンセ
クション付であると判明した場合には、コモンセクショ
ン共用制御機構2は、そのコモンセクションがすでに主
記憶装置にローディング済であるか否かをコモンセクシ
ョン共用制御表の検索によって調べる。そして、ローデ
ィングされていなければ、コモンセクションを新たに主
記憶装置にローディングし、コモンセクション共用制御
表を新たに作成する。そして、コモンセクションポイン
タにコモンセクションの領域のアドレス、すなわち図3
に示されるコモンセクションポインタAに、コモンセク
ション領域7の先頭アドレス8を設定する。この場合、
コモンセクションポインタAは必ず書き込み可能セクシ
ョンに作成し、書き込み禁止セクションからのコモンセ
クションへの参照は必ず書き込み可能セクション経由で
行うものとする。
As shown in FIG. 2, in the present invention, the identification mechanism 1 identifies whether or not the load module has a common section.
If it does not have a common section, the conventional dynamic link mechanism is used. That is, since there is no common data commonly used in each program unit, a conventional dynamic link mechanism can be realized. If the identification mechanism 1 determines that the common section is included, the common section sharing control mechanism 2 searches the common section sharing control table to determine whether or not the common section has already been loaded into the main storage device. Find out by. If the common section has not been loaded, the common section is newly loaded into the main storage device, and a common section shared control table is newly created. Then, the address of the common section area, that is, FIG.
Is set to the common section pointer A shown in FIG. in this case,
The common section pointer A is always created in a writable section, and a reference to a common section from a write-protected section is always made via a writable section.

【0017】 コモンセクション領域7がすでに主記憶装置にローデ
ィング済であれば、ローディング済のコモンセクション
の領域の長さが要求されたコモンセクションの長さ、す
なわち定義された領域の長さ以上か否かをコモンセクシ
ョンの誤長検出機構3によって調べる。コモンセクショ
ンの誤長検出機構3におけるこの誤長とはコモンセクシ
ョン定義長が異なる状態をいう。そしてローディング済
コモンセクションの要求の長さが長い場合には、ローデ
ィング済コモンセクション領域7の先頭アドレス8をコ
モンセクションポインタ領域、すなわち図3に示される
コモンセクションポインタAに設定する。一方、ローデ
ィング済コモンセクション領域7の長さが短い場合には
新たにコモンセクション領域7を獲得した後、ローディ
ング済であったコモンセクション領域7の内容をそこに
複写した後、該コモンセクション領域7を参照するプロ
グラムのコモンセクションポインタAを新たに獲得した
コモンセクション領域7の先頭アドレス8に変更し、以
前のローディング済コモンセクションの領域を返却す
る。なおここで複数のソースプログラム上で個別に定義
されたコモンセクションの領域の長さは同一にしておく
必要はなく、動的リンク時にこれらのコモンセクション
定義のうちの最大長が採用されることになる。
If the common section area 7 has already been loaded into the main storage device, it is determined whether the length of the loaded common section area is equal to or greater than the required common section length, that is, the length of the defined area. Is checked by the erroneous length detection mechanism 3 of the common section. The erroneous length in the common section erroneous length detection mechanism 3 refers to a state where the common section definition length is different. If the request length of the loaded common section is long, the start address 8 of the loaded common section area 7 is set to the common section pointer area, that is, the common section pointer A shown in FIG. On the other hand, if the length of the loaded common section area 7 is short, a new common section area 7 is obtained, and the contents of the loaded common section area 7 are copied there. Is changed to the start address 8 of the newly acquired common section area 7 of the program that refers to, and the area of the previously loaded common section is returned. Note that the length of the common section area defined separately in multiple source programs does not need to be the same, and the maximum length of these common section definitions is adopted during dynamic linking. Become.

【0018】 また、コモンセクションへのアクセス手順は図3に示
されるように行われる。コモンセクションへのアクセス
を行う場合には、主記憶上の書き込み可能な領域、すな
わち書き込み可能セクションを用いてまず、に示すよ
うにコモンセクションアドレス、すなわち図3の下に示
されるコモンセクション領域7の先頭アドレス8を図3
のコモンセクションポインタAから取り出し、に示す
ように、その先頭アドレス8をベースにして、コモンセ
クション領域7内のデータにアクセスする。ここでベー
スとは相対番地の基底をなすアドレスであって、プログ
ラム単位の相互間では、プログラム単位の頭からの相対
番地等の方法でコモンセクション内のデータがアクセス
される。
An access procedure to the common section is performed as shown in FIG. To access the common section, first, a writable area on the main memory, that is, a writable section is used to first access the common section address, that is, the common section area 7 shown in the lower part of FIG. FIG. 3 shows the start address 8
And the data in the common section area 7 is accessed based on the start address 8 as shown in FIG. Here, the base is an address that forms the basis of a relative address. Between program units, data in the common section is accessed by a method such as a relative address from the beginning of the program unit.

【0019】 図4は本発明のコモンセクションの動的リンク方式に
従うコモンセクションを保持するロードモジュールに対
応するプログラム例である。プログラムはわかりわすい
ようにアセンブラ言語で書かれているが、実際にはこれ
はロードモジュールであるとする。プログラム単位Aは
プログラムBを(CALL B)というCALL文で呼んでい
る。すなわちプログラムAはプログラムBよりも上位で
あって、プログラム単位AもBも名標Xというコモンセ
クションのデータを共通に宣言している。この場合、上
位のプログラム単位であるプログラム単位Aにも、下位
のプログラム単位Bにも、コモンセクションXの宣言が
あるので、プログラム単位Bの実行が終わった時点での
Xの値は不定とはならず、AとBとの間でXを通じてデ
ータの値をやりとりをすることが可能となる。もしプロ
グラムAにコモンセクションXの宣言がなければ、プロ
グラムBの実行が終わった時点でのXの値は不定とな
る。
FIG. 4 is an example of a program corresponding to a load module that holds a common section according to the common section dynamic link method of the present invention. The program is written in assembler language for clarity, but it is assumed that this is actually a load module. Program unit A calls program B with a CALL statement (CALL B). That is, the program A is higher than the program B, and both the program units A and B declare the data of the common section called the mark X in common. In this case, since the common section X is declared in both the upper program unit A and the lower program unit B, the value of X at the end of the execution of the program unit B is not determined. Instead, data values can be exchanged between A and B through X. If the common section X is not declared in the program A, the value of X at the time when the execution of the program B ends is undefined.

【0020】 このように、プログラム単位間の呼び出しの実行が一
般に主構造になり、複数のプログラム単位で1つの或い
は多数のコモンセクションを参照している場合、これら
のプログラム単位の実行中は宣言されたコモンセクショ
ンをもっているプログラム間ではそのコモンセクション
中のデータの値は保存される。
As described above, the execution of a call between program units generally has a main structure, and when one or a plurality of common sections are referred to in a plurality of program units, a declaration is made during the execution of these program units. The values of the data in the common section are preserved between programs that have common sections.

【0021】 図4に示した実施例図の動作順序は次のようになる。 1)プログラムAを実行させる(EXEC PGM=A)。 2)動的リンク機構はプログラムAのローディング時に
名標Xを持つコモンセクション領域を獲得し、プログラ
ムX内のアドレス定数XCOMにアドレスを格納する。 3)動的リンク機構はプログラムAに制御を渡す。 4)プログラムAが実行し、コモンセクション領域の内
容を変更、参照等行った後、動的リンクでプログラムB
を呼び出す。 5)動的リンク機構はプログラムBのローディング時
に、まず仮想アドレス空間内を名標Xで検索する。例で
は名標Xが発見でき、コモンセクション長を比較する
が、長さが違うため、長い方の長さを新規に獲得し直
し、旧領域から新領域に内容を複写する。新領域のアド
レスをプログラムAとプログラムBのアドレス定数域
(XCOMとYCOM)に格納する。 6)動的リンク機構はプログラムBに制御を渡す。 7)プログラムBが実行し、コモンセクション領域の内
容を変更、参照等おこなう。
The operation sequence of the embodiment shown in FIG. 4 is as follows. 1) Execute program A (EXEC PGM = A). 2) The dynamic link mechanism acquires the common section area having the mark X when loading the program A, and stores the address in the address constant XCOM in the program X. 3) The dynamic link mechanism passes control to program A. 4) After the program A executes and changes or refers to the contents of the common section area, the program B is dynamically linked.
Call. 5) When loading the program B, the dynamic link mechanism first searches the virtual address space with the mark X. In the example, the name X can be found and the common section length is compared. However, since the length is different, the longer length is newly acquired and the contents are copied from the old area to the new area. The address of the new area is stored in the address constant area of program A and program B (XCOM and YCOM). 6) The dynamic link mechanism passes control to program B. 7) The program B is executed to change or refer to the contents of the common section area.

【0022】 まず、プログラムAが実行されると、本発明の動的リ
ンク機構ではプログラムAのローディング時に名標Xを
持つコモンセクション領域を獲得する。図に示されるよ
うに、このコモンセクションのデータ長は100Aであっ
て、そのアドレスはA(X)とすれば、プログラムX内
のアドレス定数XCOMにそのアドレスが格納される。その
後、動的リンク機構はプログラムAに制御が渡される。
プログラムAが実行されると、実行途中でXはその内容
が変更され、また参照されるので、コモンセクション領
域の内容もそれに従って変更される。このように変更さ
れた値は(CALL B)のところでプログラムBを呼び出
すために、プログラムBに移る。この時、プログラムB
においてもこのXはコモンセクションの共通データであ
る。
First, when the program A is executed, the dynamic link mechanism of the present invention acquires a common section area having the mark X when the program A is loaded. As shown in the figure, if the data length of this common section is 100 A and its address is A (X), the address is stored in the address constant XCOM in the program X. Thereafter, control of the dynamic link mechanism is passed to the program A.
When the program A is executed, the contents of X are changed and referenced during the execution, so that the contents of the common section area are changed accordingly. The value thus changed is transferred to program B in order to call program B at (CALL B). At this time, program B
X is common data of the common section.

【0023】 従って、プログラムAで更新された値がプログラムB
に渡される。5)に移って本発明の動的リンク機構はプ
ログラムBのローディング時にまず、仮想アドレス空間
内を名標Xで検索する。すなわちプログラムBでXにあ
たると名標Xで検索することになる。そして名標Xが発
見されると、そのコモンセクション長を比較する。プロ
グラムAでは名標Xの長さは100Aであったがプログラム
BではXは300Aで定義されている。そのため、プログラ
ムAで更新されたXの値はプログラムBのXにそのまま
その内容が複写することが可能となる。
Therefore, the value updated by the program A is
Passed to. Moving to 5), the dynamic link mechanism of the present invention first searches the virtual address space with the name mark X when loading the program B. In other words, when X is found in the program B, the search is made with the name mark X. When the mark X is found, the common section length is compared. In the program A, the length of the mark X was 100A, but in the program B, X was defined as 300A. Therefore, the value of X updated by the program A can be directly copied to the X of the program B.

【0024】 すなわち、長さが違う場合には、領域の長い方の長さ
に新規に獲得し直し、旧領域から新領域にその内容を複
写する。この例では、すでにプログラムBのコモンセク
ションの長さはプログラムAのコモンセクションの長さ
よりも長いためそのまま複写することが可能となる。こ
うして新領域のアドレス、すなわちコモンセクションの
先頭アドレスは新規に変わる。そして、そのコモンセク
ションの先頭アドレスはプログラムAとプログラムBの
アドレス定数域、すなわちXCOMとYCOMに格納される。こ
の動作が終わった後、動的リンク機構はプログラムBに
制御をわたす。プログラムBにおいても、このXは当然
使われているため、プログラムBの実行時にコモンセク
ション領域の内容は変更され、参照される。その変更さ
れた内容はプログラムAのCALL文以下の命令において、
利用されることになる。
That is, if the lengths are different, a new area is newly acquired to the longer length of the area, and the contents are copied from the old area to the new area. In this example, since the length of the common section of the program B is already longer than the length of the common section of the program A, it can be copied as it is. Thus, the address of the new area, that is, the start address of the common section, is newly changed. Then, the head address of the common section is stored in the address constant area of the program A and the program B, that is, XCOM and YCOM. After this operation is completed, the dynamic link mechanism passes control to the program B. Since X is used in the program B as well, the contents of the common section area are changed and referred to when the program B is executed. The changed content is in the instruction below the CALL statement of program A,
Will be used.

【0025】[0025]

【発明の効果】【The invention's effect】

以上説明したように、本発明によればコモンセクショ
ン付のロードモジュールが混在する場合にも、その存在
を意識すること無く動的リンクを利用するため、あらゆ
る場合について、動的リンクを前提としたプログラム実
行環境とプログラム保守・管理の環境を構築可能とな
る。従って、実行時には必要最小限のワーキングセット
に抑えることが出来、ロードモジュール捕獲に際しては
必要最小限のディスク容量に抑えることが出来、また保
守・管理については、再リンク不要となる。そして、保
守方法の一貫性を保つことが出来、プログラム開発、プ
ログラム実行環境の構築と、プログラムの保守、管理の
資源節約と手順の簡素化に寄与するところが大きい。
As described above, according to the present invention, even in a case where load modules with a common section are mixed, a dynamic link is used in all cases in order to use a dynamic link without being conscious of its existence. A program execution environment and a program maintenance / management environment can be constructed. Therefore, the working set can be reduced to the minimum required at the time of execution, the disk capacity can be reduced to the minimum required when capturing a load module, and relinking is not required for maintenance and management. The maintenance method can be kept consistent, which greatly contributes to program development, construction of a program execution environment, and resource saving and simplification of procedures for program maintenance and management.

【図面の簡単な説明】[Brief description of the drawings]

【図1】 本発明の原理図である。FIG. 1 is a principle diagram of the present invention.

【図2】 本発明の構成図である。FIG. 2 is a configuration diagram of the present invention.

【図3】 コモンセクションへのアクセス手順の実施例図である。FIG. 3 is an embodiment diagram of a procedure for accessing a common section.

【図4】 本発明のコモンセクションの動的リンク方式に従うコモ
ンセクションを保持するロードモジュールに対応するプ
ログラムの実施例図である。
FIG. 4 is an embodiment diagram of a program corresponding to a load module holding a common section according to the common section dynamic link method of the present invention.

【符号の説明】[Explanation of symbols]

1……コモンセクションの有無識別手段 2……コモンセクションの共有制御手段 3……コモンセクションの誤長検出手段 4……コモンセクションのアクセス制御手段 1 ... Common section presence / absence identification means 2 ... Common section sharing control means 3 ... Common section erroneous length detection means 4 ... Common section access control means

フロントページの続き (56)参考文献 特開 昭62−241031(JP,A) 特開 昭62−163148(JP,A) 特公 昭62−32497(JP,B2) 「FACOM OSIV/X8,リン ケージエディタ/ローダ使用手引書 65 SP−3522−1」p.19〜21,p.76〜 77(コモンセクションの統合の欄を参 照。),富士通株式会社,昭和58年12月Continuation of the front page (56) References JP-A-62-241031 (JP, A) JP-A-62-163148 (JP, A) JP-B-62-32497 (JP, B2) “FACOM OSIV / X8, Linkage Editor / Loader User's Guide 65 SP-3522-1 "p. 19-21, p. 76-77 (See the section on integration of common section.), Fujitsu Limited, December 1983

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】コモンセクションの宣言がなされた複数の
ロードモジュール間の動的リンクを行う動的リンクシス
テムにおいて、 既にローディング済みの第1のロードモジュールから動
的リンクを要求された第2のロードモジュールをローテ
ィングする際、該第2のロードモジュール中で宣言され
ているコモンセクションの長さと既存のコモンセクショ
ンの長さとを比較判定する比較判定手段と、 該比較判定手段において、前記第2のロードモジュール
中で宣言されているコモンセクションの長さの方が前記
既存のコモンセクションの長さよりも長いと判定された
場合、前記第2のロードモジュール中で宣言されている
コモンセクションの長さに等しい長さの領域を新たに獲
得し、前記既存のコモンセクションの内容を当該新領域
に複写し、当該新領域を新たなコモンセクション領域と
して、コモンセクションの宣言された各ロードモジュー
ルにアクセスさせるアクセス制御手段と、 を有することを特徴とする動的リンクシステム。
In a dynamic link system for dynamically linking a plurality of load modules for which a common section has been declared, a second load for which a dynamic link has been requested from a first load module that has already been loaded. When loading a module, comparing and judging means for judging a length of a common section declared in the second load module and a length of an existing common section; If it is determined that the length of the common section declared in the load module is longer than the length of the existing common section, the length of the common section declared in the second load module is Obtaining a new area of equal length, copying the contents of the existing common section into the new area, The 該新 region as a new common section area, dynamic linking system, characterized in that it comprises an access control means for accessing each of the load modules that are declared common section, the.
JP31185188A 1988-12-12 1988-12-12 Dynamic link system Expired - Fee Related JP3293821B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP31185188A JP3293821B2 (en) 1988-12-12 1988-12-12 Dynamic link system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP31185188A JP3293821B2 (en) 1988-12-12 1988-12-12 Dynamic link system

Publications (2)

Publication Number Publication Date
JPH02157936A JPH02157936A (en) 1990-06-18
JP3293821B2 true JP3293821B2 (en) 2002-06-17

Family

ID=18022179

Family Applications (1)

Application Number Title Priority Date Filing Date
JP31185188A Expired - Fee Related JP3293821B2 (en) 1988-12-12 1988-12-12 Dynamic link system

Country Status (1)

Country Link
JP (1) JP3293821B2 (en)

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62241031A (en) * 1986-04-11 1987-10-21 Nec Corp Dynamic link controller for program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
「FACOM OSIV/X8,リンケージエディタ/ローダ使用手引書 65SP−3522−1」p.19〜21,p.76〜77(コモンセクションの統合の欄を参照。),富士通株式会社,昭和58年12月

Also Published As

Publication number Publication date
JPH02157936A (en) 1990-06-18

Similar Documents

Publication Publication Date Title
US5583988A (en) Method and apparatus for providing runtime checking features in a compiled programming development environment
US5353411A (en) Operating system generation method
US7992141B2 (en) Method and apparatus for building executable computer programs using compiled program libraries
EP0665496B1 (en) Method and apparatus for run-time error checking using dynamic patching
US5835701A (en) Method and apparatus for modifying relocatable object code files and monitoring programs
Hauck et al. Burroughs' B6500/B7500 stack mechanism
US5291601A (en) Shared libraries implemented with linking program loader
US6993754B2 (en) Annotations to executable images for improved dynamic optimization functions
JP3354425B2 (en) Method and system for improving executable file execution efficiency
EP0679273B1 (en) Shared library locating system and method
US6637025B1 (en) Dynamic selection/definition of which class/methods should or should not be jit'ed using information stored in a jar file
US7131115B2 (en) Unwinding instrumented program code
JPH06266563A (en) Efficient router for support of plurality of simultaneous object versions
US5553286A (en) System and method for preparing a computer program for execution
JPH02188833A (en) Interface for computer system
JP2002525707A (en) An accurate method for virtual call inlining
US5655073A (en) Debugging method and debugger
US6330691B1 (en) Use of dynamic translation to provide breakpoints in non-writeable object code
JPH01263734A (en) Supply of dynamic link identifier for multi-task environment
US5062039A (en) Sharing of workspaces in interactive processing using workspace name tables for linking of workspaces
JPH07230386A (en) Data processor and method for calling control routine
US6735774B1 (en) Method and apparatus for system call management
EP0406028A2 (en) Incremental compiler for source code development system
US6275985B1 (en) Method and apparatus for developing an application that implements garbage collection efficiently by combining proxy objects with compiler support
US7770152B1 (en) Method and apparatus for coordinating state and execution context of interpreted languages

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees