JPH03158931A - Link method for execution form program - Google Patents

Link method for execution form program

Info

Publication number
JPH03158931A
JPH03158931A JP29750389A JP29750389A JPH03158931A JP H03158931 A JPH03158931 A JP H03158931A JP 29750389 A JP29750389 A JP 29750389A JP 29750389 A JP29750389 A JP 29750389A JP H03158931 A JPH03158931 A JP H03158931A
Authority
JP
Japan
Prior art keywords
item
link
symbol
address
original data
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.)
Pending
Application number
JP29750389A
Other languages
Japanese (ja)
Inventor
Hideaki Kogure
小暮 秀明
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry Co 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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP29750389A priority Critical patent/JPH03158931A/en
Publication of JPH03158931A publication Critical patent/JPH03158931A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To shorten the link time by utilizing a link address obtained at the time of link executed previously, in the case of re-executing newly a link after the link is executed once. CONSTITUTION:At the time of link, a section table 70 and a symbol list table 80 are generated first. Subsequently, that which is defined by a discriminating information item 82 of the symbol list table 80 is recognized first, a symbol table 90 is generated and it is contrived to settle a symbol name in an original form data block 14. Therefore, an item whose reference is shown by the discriminating information item 82 of the symbol list table 80 s recognized, and also, the contents of an address item 83 and a link address item 92 are compared. Accordingly, as for a symbol name in which the contents of the link address item 92 and the address item 83 coincide with each other, it is possible to omit a processing for writing a link address. In such a way, the link is ended at a high speed.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は、相対形式モジュールをリンクして実行′形式
プログラムを得る実行形式プログラムのリンク方法に関
する。
DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a method for linking an executable program by linking relative format modules to obtain an executable program.

(従来の技術) プログラムを効率よく開発し、しかも融通性を持たせる
には、リロケータブル(再配置可能)なプログラムを各
モジュール(機能)毎に作るのが望ましい。リロケータ
ブルなプログラムとは、プログラムを開発しそれをコン
パイルした時点で、まだそれをメモリ上のどこに配置す
るかを決めていないプログラムのことで、最終的にはリ
ンケージエディタ等によって幾つかの必要なプログラム
をつなぎ、そこで配置するアドレスが決められる(リン
ク)。
(Prior Art) In order to efficiently develop programs and provide flexibility, it is desirable to create relocatable programs for each module (function). A relocatable program is a program that has not yet decided where to place it in memory at the time of developing and compiling it, and is eventually created by linkage editor etc. The address to be placed there can be determined (link).

一般に、リロケータブルなプログラムを相対形式モジュ
ールと呼び、さらにリンケージエディタ等によりリンク
されたプログラムを実行形式プログラムと呼んでいる。
Generally, a relocatable program is called a relative format module, and a program linked using a linkage editor or the like is called an executable program.

ここでは、リンケージエディタ等において複数の相対形
式モジュールをリンクし、1つの実行形式プログラムを
得る実行形式プログラムのリンク方法について話を進め
る。
Here, we will discuss how to link executable programs to obtain one executable program by linking multiple relative format modules using a linkage editor or the like.

第2図に、−船釣なリンク方法の概念図を示す。FIG. 2 shows a conceptual diagram of a boat fishing link method.

先ず、リンケージエディタlには、既にコンパイル済み
の3つの相対形式モジュール2,3.4が入力されたも
のとする。リンケージエディタ1は、これらの相対形式
モジュールから1つの実行形式プログラム5を生成する
処理(リンク)を行なうことになる。
First, it is assumed that three relative format modules 2, 3.4, which have already been compiled, are input to the linkage editor l. The linkage editor 1 performs the process (linking) of generating one executable program 5 from these relative format modules.

ところで、相対形式モジュール2.3.4をリンクする
際、シンボリックアドレス(シンボル名)の解決を行な
わなければならない。即ち、シンボル名を具体的なアド
レス(実行形式プログラム上の絶対アドレス)に変換す
る必要がある。このためコンパイルの際、相対形式モジ
ュールには、シンボル名が原形データ(ソースプログラ
ムをコンパイルしたもの)中のどこに存在するかを示す
リロケーション情報が設けられる。
By the way, when linking relative format module 2.3.4, symbolic addresses (symbol names) must be resolved. That is, it is necessary to convert the symbol name into a concrete address (absolute address on the executable program). Therefore, during compilation, the relative format module is provided with relocation information that indicates where the symbol name exists in the original data (compiled source program).

第3図に、相対形式モジュールの構成図を示す。FIG. 3 shows a configuration diagram of the relative format module.

相対形式モジュール2は、ファイルヘッダ12、セクシ
ョンへラダ13、原形データブロック14、リロケーシ
ョン情報15、記号表16の5つから構成されている。
The relative format module 2 is composed of five elements: a file header 12, a section ladder 13, an original data block 14, relocation information 15, and a symbol table 16.

ファイルへラダ12は、セクションへラダ13の個数を
示すセクションヘッダ個数項目21と、相対形式モジュ
ール2中の記号表の位置を示す記号表位置項目22とか
ら構成されている。
The file ladder 12 is composed of a section header number item 21 indicating the number of section header ladders 13, and a symbol table position item 22 indicating the position of the symbol table in the relative format module 2.

セクションへラダ13は、相対形式モジュール2中の原
形データブロック14及びリロケーション情報15の位
置を示す原形データ位置項目31及びリロケーション情
報位置項目33から構成されている。なお、リロケーシ
ョン情報位置項目33は、リロケーション情報15が複
数の場合、それに対応して複数設けられる。
The section ladder 13 is composed of an original data position item 31 and a relocation information position item 33 indicating the positions of the original data block 14 and relocation information 15 in the relative format module 2. Note that, when there is a plurality of relocation information 15, a plurality of relocation information position items 33 are provided corresponding to the plurality of relocation information 15.

原形データブロック14は、ソースプログラムに基づい
た機械語(原形データ)からなるブロックである。なお
、このブロック中のシンボル名に相当する部分には、空
白(例えば°’oo”)、が格納されている。
The original data block 14 is a block consisting of machine language (original data) based on a source program. Note that a blank space (for example, °'oo'') is stored in the part corresponding to the symbol name in this block.

リロケーション情報15は、原形データブロック14中
のシンボル名の位置を示す修飾位置項目51と、この修
飾位置項目51に対応した記号表16の所定の位置を示
す記号表位置項目52から構成されている。このリロケ
ーション情報15は、後に説明する参照のシンボル名に
対応して設けられるもので、原形データブロック14中
に参照のシンボル名が複数存在した場合、このりロケー
ション情報15も複数項目設けられる。
The relocation information 15 is composed of a modification position item 51 indicating the position of the symbol name in the original data block 14, and a symbol table position item 52 indicating a predetermined position in the symbol table 16 corresponding to this modification position item 51. . This relocation information 15 is provided corresponding to a reference symbol name, which will be explained later, and if a plurality of reference symbol names exist in the original data block 14, a plurality of items of location information 15 are also provided.

記号表16は、原形データブロック14中に存在するシ
ンボル名を示すシンボル名項目61と、このシンボル名
が当該原形データブロック中で定義されたものか、それ
とも他の相対形式モジュールの原形データブロック中で
定義されたものを参照するのかを示す識別情報項目62
と、シンボル名が置かれる原形データブロック14上の
位置(定義のシンボル名の場合のみ)を示すアドレス項
目63から構成されている。この記号表16の内容は、
シンボル名毎、即ち原形データブロック14中に存在す
るシンボル名の数に対応して各項目が設けられる。
The symbol table 16 includes a symbol name field 61 indicating the symbol name existing in the original data block 14, and whether this symbol name is defined in the original data block or in the original data block of another relative format module. Identification information item 62 indicating whether to refer to something defined in
and an address item 63 indicating the position on the original data block 14 where the symbol name is placed (only in the case of a defined symbol name). The contents of this symbol table 16 are:
Each item is provided for each symbol name, that is, corresponding to the number of symbol names existing in the original data block 14.

さて、原形データブロック14中には、先に説明したよ
うにシンボル名が存在する。このシンボル名には、定義
と参照の2種のものがある。定義のシンボル名とは、相
対形式モジュール2の原形データブロック14中で定義
されたシンボル名を指す。また参照のシンボル名とは、
相対形式モジュール2以外、例えば相対形式モジュール
3゜4の何れかにおいて定義されたシンボル名で、相対
形式モジュール2(原形データブロック14)がこの参
照のシンボル名を利用する場合、他の相対形式モジュー
ル中のシンボル名を参照する形になるためこのような呼
び方がなされている。
Now, in the original data block 14, symbol names exist as described above. There are two types of symbol names: definition and reference. The symbol name of the definition refers to the symbol name defined in the original data block 14 of the relative format module 2. Also, the symbol name of the reference is
A symbol name defined in a relative format module 3 or 4 other than the relative format module 2, and when the relative format module 2 (original data block 14) uses the symbol name of this reference, other relative format modules It is called this way because it refers to the symbol name inside.

ところで、リロケーション情報位置項目33と、リロケ
ーション情報15の修飾位置項目51は一対一に対応し
て設けられている。そして、このリロケーション情報位
置項目33及びリロケーション情報15は、原形データ
ブロック14中の参照のシンボル名に対してのみ設けら
れている。
By the way, the relocation information position item 33 and the modification position item 51 of the relocation information 15 are provided in one-to-one correspondence. The relocation information position item 33 and the relocation information 15 are provided only for reference symbol names in the original data block 14.

一方、記号表16の各項目は、原形データブロック14
中のシンボル名の全てに対応して設けられている。そし
て、アドレス項目63の内容については、定義のシンボ
ル名の場合、原形データブロック14中の位置を示すモ
ジュールアドレスが格納される。
On the other hand, each item in the symbol table 16 corresponds to the original data block 14.
It is provided corresponding to all the symbol names inside. Regarding the content of the address item 63, in the case of a definition symbol name, a module address indicating the position in the original data block 14 is stored.

さて、第4図に従来のリンク方法の説明図を示す。Now, FIG. 4 shows an explanatory diagram of a conventional linking method.

図には、リンケージエディタ1と相対形式モジュール2
,3.4と実行形式プログラム5を示した。なお、相対
形式モジュール2のみその内部の構成を示したが、相対
形式モジュール3.4についても同様である。
The figure shows linkage editor 1 and relative format module 2.
, 3.4 and executable program 5 are shown. Although the internal configuration of only the relative format module 2 is shown, the same applies to the relative format modules 3.4.

先ず初めに、リンケージエディタ1は、相対形式モジュ
ール2のファイルへラダ12を読取り、セクションヘッ
ダ個数項目21及び記号表位置項目22を認識する。こ
れにより相対形式モジュール2のセクションヘッダ13
及び記号表16を認識することができる。さらにリンケ
ージエディタ1は、セクションへラダ13及び記号表1
6を複写し、セクションテーブル70(原形データの位
置項目71、リロケーション情報位置項目73、記号表
テーブルポインタ項目74)及び記号表テーフ゛ル80
(シンボルテーフ゛ルボインタ項目81、識別情報項目
82、アドレス項目83)を°生成する。ここで、リン
ケージエディタ1内で新たに生成される記号表テーブル
ポインタ項目74とは、リンケージエディタ1内におけ
る記号表テーブル80の位置を示すアドレス等を格納す
る項目である。また、シンボルテーブルポインタ項目8
1は、後に説明するシンボルテーブル90の特定の位置
を指すアドレスを格納する項目である。
First, the linkage editor 1 reads the ladder 12 into the file of the relative format module 2 and recognizes the section header number item 21 and the symbol table position item 22. This results in section header 13 of relative format module 2.
and symbol table 16 can be recognized. Furthermore, linkage editor 1 adds section ladder 13 and symbol table 1
6, and section table 70 (original data position item 71, relocation information position item 73, symbol table pointer item 74) and symbol table table 80.
(Symbol table pointer item 81, identification information item 82, address item 83) are generated. Here, the symbol table pointer item 74 newly generated within the linkage editor 1 is an item that stores an address indicating the position of the symbol table table 80 within the linkage editor 1. Also, symbol table pointer item 8
1 is an item that stores an address pointing to a specific position in the symbol table 90, which will be explained later.

さて、リンケージエディタlはリロケーション情報位置
項目73を参照して記号表テーブル80に対応したシン
ボルテーブル90の作成を行なうことになる。
Now, the linkage editor l will create a symbol table 90 corresponding to the symbol table table 80 by referring to the relocation information position item 73.

まず、記号表テーブル8oを生成する際にシンボルテー
ブルポインタ項目81の項目に該当したシンボル名項目
61の内容を数値情報化してハツシュ表75を参照する
。この結果、所定のアドレスが生成され、このアドレス
に対応したシンボルテーブル90の項目が無ければ記号
表テーブルポインタ項目91及びリンクアドレス項目9
2を生成する。記号表テーブルポインタ項目91は、こ
のシンボルテーブル90が管理するシンボル名の定義さ
れた記号表テーブル80を特定するアドレスを格納する
項目である。リンクアドレス項目92は、実行形式プロ
グラム5上で定義のシンボル名がおかれる位置を示すア
ドレスを格納する項目である。
First, when generating the symbol table table 8o, the content of the symbol name item 61 corresponding to the item of the symbol table pointer item 81 is converted into numerical information, and the hash table 75 is referred to. As a result, a predetermined address is generated, and if there is no item in the symbol table 90 corresponding to this address, a symbol table pointer item 91 and a link address item 9 are generated.
Generate 2. The symbol table pointer item 91 is an item that stores an address that specifies the symbol table table 80 in which symbol names managed by this symbol table 90 are defined. The link address item 92 is an item that stores an address indicating a position where a defined symbol name is placed on the executable program 5.

シンボルテーブル90を生成する処理は、記号表テーブ
ル80の識別情報項目82が定義を示していた場合には
、シンボルテーブル90の内容を生成する。また識別情
報項目82が参照を示していた場合、シンボルテーブル
90が生成されていなければ記号表テーブルポインタ項
目91、リンクアドレス項目92の項目確保だけを行な
う。
The process of generating the symbol table 90 generates the contents of the symbol table 90 when the identification information item 82 of the symbol table table 80 indicates a definition. Further, when the identification information item 82 indicates reference, only the symbol table pointer item 91 and link address item 92 are secured if the symbol table 90 has not been generated.

相対形式モジュール3.4についても同様にシンボルテ
ーブルを作成する。全てのシンボルテーブルが作成でき
たならば、リンケージエディタは、各シンボルについて
のアドレスを決定する。
A symbol table is similarly created for relative format module 3.4. Once all symbol tables have been created, the linkage editor determines the address for each symbol.

その後、リンケージエディタは、相対形式モジュールの
原形データを読込み、決定したリンクアドレス(絶対ア
ドレス)による修飾を行ない、その原形データを実行形
式プログラム5中の所定の位置に出力する。全ての相対
形式モジュールについてこの原形データの読み込み、修
飾、出力が完了したならば、リンクを終了する。
Thereafter, the linkage editor reads the original data of the relative format module, modifies it with the determined link address (absolute address), and outputs the original data to a predetermined position in the executable program 5. When reading, modifying, and outputting the original data for all relative format modules is completed, the link ends.

(発明が解決しようとする課題) さて、実行形式プログラム5を実際に動作させてみて不
都合が生じる場合が多々ある。この場合、リンクを行な
った相対形式モジュール(ソースプログラム)の変更を
行ない、変更を行なったソースプログラムについてはコ
ンパイルを再度行ない、さらに先に説明したような手順
によりリンクをやり直すことになる。
(Problems to be Solved by the Invention) When the executable program 5 is actually operated, problems often arise. In this case, the linked relative format module (source program) is changed, the modified source program is compiled again, and the link is redone using the procedure described above.

この新たなリンクの際、プログラムの変更は些細であっ
ても、リンクする相対形式モジュール全てについて初め
からリンクの処理を施していた。
At the time of this new link, even if the change in the program was trivial, link processing was performed on all relative format modules to be linked from the beginning.

即ち、シンボルテーブル90の作成から、原形0 データの読み込み、修飾、出力を全てのシンボル名につ
いて行なっていた。しかし、原形データの修飾結果は、
即ちリンクアドレスの内容は先に行なわれたリンクの際
と殆ど変わることがない。これは殆どの場合、プログラ
ムの変更が一部の修正に留まり、他のモジュールに影響
することが少ないからである。このため、リンクの結果
が殆ど変化しないにも係わらず、原形データのリンクア
ドレスの修飾等の、非常に時間のかかる処理を強いられ
、実行形式プログラム5を容易に作成して迅速に実行さ
せるといった作業を効率的に行なう障害となっていた。
That is, from the creation of the symbol table 90, reading, modification, and output of original form 0 data are performed for all symbol names. However, the modification result of the original data is
That is, the content of the link address is almost unchanged from the previous link. This is because in most cases, changes to the program are limited to only a few modifications and have little effect on other modules. For this reason, even though the link result hardly changes, very time-consuming processes such as modifying the link address of the original data are forced, and it is difficult to easily create the executable program 5 and run it quickly. This was an obstacle to working efficiently.

また、原形データの修飾は一般に非常に多いため、この
修飾を行なうハードウェアの負担にもなっていた。
Furthermore, since there are generally many modifications to the original data, this also places a burden on the hardware that performs this modification.

本発明は以上の点に着目してなされたもので、−旦リン
クを行なった後に原形データブロック14内にリンクア
ドレスを書込んでおき、再度リンクを行なう際、原形デ
ータブロック14に記録されたリンクアドレスを利用し
て、リンクを速やかに終了させることのできる実行形式
プログラムのリンク方法を提供することを目的とするも
のである。
The present invention has been made with attention to the above points. The object of the present invention is to provide a method for linking executable programs that can quickly terminate linking by using a link address.

(課題を解決するための手段) 本発明の実行形式プログラムのリンク方法は、コンパイ
ル済みのプログラムである原形データを含む複数の相対
形式モジュールをリンクして実行形式プログラムを得る
場合に原形データ中にリンクアドレスを書込んでおき、
既に前記リンクを終えて参照していたものであって、前
記何れかの相対形式モジュールを修正して再度前記リン
クを行なう時、前記リンケージエディタ内で生成だ新た
な前記リンクアドレスを、当該相対形式モジュールの各
原形データ中に既に書込まれたリンクアドレスと比較し
、不一致の場合のみ新たなリンクアドレスを当該原形デ
ータ中に書込み、一致する場合は各原形データをそのま
ま利用することを特徴とするものである。
(Means for Solving the Problems) The method for linking an executable program of the present invention is such that when an executable program is obtained by linking a plurality of relative format modules containing original data that are compiled programs, Write the link address and
If you have already completed the link and are referring to it, and you modify any of the relative format modules and perform the link again, the new link address generated in the linkage editor will be changed to the relative format. It is characterized in that it compares the link address already written in each original data of the module, writes a new link address into the original data only if they do not match, and uses each original data as is if they match. It is something.

(作用) 以上の方法は、コンパイル済みのプログラムである原形
データを含む複数の相対形式モジュール1 をリンクして実行形式プログラムを得る場合に、各相対
形式モジュールに、リンクの際解決した、シンボル名を
置くべき実行形式プログラム上の位置を示すリンクアド
レスを書込んでおく。そして、再度リンクを行なう場合
、新たにリンケージエディタ内で生成されて、前記原形
データの中に書込むべきリンクアドレスを、当該相対形
式モジュールの各原形データ中に既に書込まれたリンク
アドレスと比較し、不一致の場合のみ新たなリンクアド
レスを当該原形データ中に書込むものである。
(Operation) In the above method, when an executable program is obtained by linking multiple relative format modules 1 containing original data that are compiled programs, each relative format module is given the symbol name resolved at the time of linking. Write the link address indicating the location in the executable program where the file should be placed. When linking is performed again, the link address newly generated in the linkage editor and to be written in the original data is compared with the link address already written in each original data of the relative format module. However, only if there is a mismatch, a new link address is written into the original data.

(実施例) 第1図に、本発明に係るリンク方法の説明図を示す。(Example) FIG. 1 shows an explanatory diagram of a linking method according to the present invention.

図は、基本的には先に第4図において説明したものと同
一である。従って同一部分に同一符号を付し、重複する
説明を適宜省略する。
The diagram is basically the same as that previously described in FIG. 4. Therefore, the same parts are given the same reference numerals, and redundant explanations will be omitted as appropriate.

相対形式モジュール2のセクションへラダ13には、原
形、データリンク位置項目32が新たに設けられている
。この原形データリンク位置項目2 32は、原形データブロック14が実行形式プログラム
5に複写された際、実行形式プログラム5上の何れの位
置に複写されたかを示すリンク位置(アドレス)を格納
する項目である。
In the section ladder 13 of the relative format module 2, original format and data link position items 32 are newly provided. This original data link position item 2 32 is an item that stores a link position (address) indicating at which position on the executable program 5 the original data block 14 is copied to the executable program 5. be.

また記号表16のアドレス項目63には、リンク時にリ
ンケージエディタ1の制御により、記号表テーブル80
のアドレス項目83の内容が書込まれる。
Also, in the address field 63 of the symbol table 16, the symbol table table 80 is
The contents of the address field 83 are written.

先ず初めに、リンケージエディタ1は、相対形式モジュ
ール2のファイルへラダ12を読取り、セクションヘッ
ダ個数項目21及び記号表位置項目22を認識する。こ
れにより相対形式モジュール2のセクションへラダ13
及び記号表16を認識することができる。さらにリンケ
ージエディタ1は、セクションへラダ13及び記号表1
6を複写し、セクションテーブル70(原形データの位
置項目71、原形データリンク位置項目72、リロケー
ション情報位置項目73、記号表テーブルのポインタ項
目74)及び記号表テーブル8゜(シンボルテーブルポ
インタ項目81、識別情報 3 4 項目82、アドレス項目83)を生成する。
First, the linkage editor 1 reads the ladder 12 into the file of the relative format module 2 and recognizes the section header number item 21 and the symbol table position item 22. This will take you to the relative format module 2 section Ladder 13
and symbol table 16 can be recognized. Furthermore, linkage editor 1 adds section ladder 13 and symbol table 1
6 and copy section table 70 (original data position item 71, original data link position item 72, relocation information position item 73, symbol table pointer item 74) and symbol table table 8° (symbol table pointer item 81, Identification information 3 4 item 82 and address item 83) are generated.

さて、リンケージエディタ1はリロケーション情報位置
項目73を参照して記号表テーブル80に対応したシン
ボルテーブル90の作成を行なうことになる。
Now, the linkage editor 1 refers to the relocation information position item 73 to create a symbol table 90 corresponding to the symbol table table 80.

この際まず初めに、識別情報項目82の内容が定義を示
している項目についてのみシンボルテーブル90を生成
する処理を行なう。
At this time, first, a process is performed to generate the symbol table 90 only for items whose contents in the identification information item 82 indicate definitions.

シンボルテーブル90の作成は、記号表テーブル80を
生成する際にシンボルテーブルポインタ項目81の項目
に該当したシンボル名項目61の内容を数値情報化して
ハツシュ表75を参照する。この結果、所定のアドレス
が生成され、このアドレスに対応したシンボルテーブル
90の項目が無ければ記号表テーブルポインタ項目91
及びリンクアドレス項目92を生成する。記号衣テーブ
ルポインタ項目91は、このシンボルテーブルが管理す
るシンボル名の定義された記号表テーブル80を特定す
るアドレスを格納する項目である。リンクアドレス項目
92は、実行形式プログラム5上で定義のシンボル名か
置かれる位置を示すアドレスを格納する項目である。
To create the symbol table 90, when creating the symbol table table 80, the contents of the symbol name item 61 corresponding to the item of the symbol table pointer item 81 are converted into numerical information, and the hash table 75 is referred to. As a result, a predetermined address is generated, and if there is no item in the symbol table 90 corresponding to this address, the symbol table pointer item 91
and a link address item 92 is generated. The symbol table pointer item 91 is an item that stores an address specifying the symbol table table 80 in which symbol names managed by this symbol table are defined. The link address item 92 is an item that stores an address indicating a position where a defined symbol name is placed on the executable program 5.

識別情報項目82の内容が定義を示した項目に対応して
シンボルテーブル90を作成した後は、識別情報項目8
2の内容が参照を示した項目についてシンボルテーブル
90を参照する。この場合、先ずアドレス項目83とリ
ンクアドレス項目92との比較を行なう。この結果不一
致であった場合のみ、リンクアドレス項目92内のリン
クアドレスを、アドレス項目83へと書込み、さらに原
形データブロック14内の該当するシンボル名の位置に
書込む。そして、原形データブロック14内の全てのシ
ンボル名にリンクアドレスが割り振られることにより、
相対形式モジュール2に対するシンボル名の解決の処理
が終了したことになる。シンボル名の解決を図ると、リ
ンケージエディタ1は、記号表テーブル80のアドレス
項目83の内容を、記号表16のアドレス項目63へと
書込む。相対形式モジュール3.4についても同様の手
順によりシンボル名の解決を図る。
After creating the symbol table 90 corresponding to the item for which the contents of the identification information item 82 indicate the definition, the identification information item 8
The symbol table 90 is referred to for the item for which the content of 2 indicates reference. In this case, address item 83 and link address item 92 are first compared. Only if this results in a mismatch, the link address in the link address field 92 is written to the address field 83 and further written to the position of the corresponding symbol name in the original data block 14. Then, by allocating link addresses to all symbol names in the original data block 14,
This means that the symbol name resolution processing for relative format module 2 has been completed. After resolving the symbol name, the linkage editor 1 writes the contents of the address item 83 of the symbol table table 80 to the address item 63 of the symbol table 16. The symbol name is resolved using the same procedure for the relative format module 3.4.

 5 リンケージエディタ1はリンクすべき全ての相対形式モ
ジュールについてシンボル名の解決を図ると、次に、原
形データブロック14を複写する実行形式プログラム5
上の位置(原形データリンク位置)を割り出す。そして
原形データリンク位置項目72の内容と比較する。この
比較の結果が不一致であった場合には、原形データリン
ク位置項目72の内容を書換え、さらにセクションへラ
ダ13の原形データリンク位置項目32の内容を書換え
る。そして、リンケージエディタlは、各装置形式モジ
ュール中の原形データを実行形式プログラム5中の所定
の位置に複写しリンクを終了する。
5 After the linkage editor 1 resolves symbol names for all relative format modules to be linked, the linkage editor 1 then creates an executable program 5 that copies the original data block 14.
Determine the upper position (original data link position). Then, it is compared with the contents of the original data link position item 72. If the result of this comparison is a mismatch, the contents of the original form data link position item 72 are rewritten, and the contents of the original form data link position item 32 of the ladder 13 to the section are also rewritten. Then, the linkage editor 1 copies the original data in each device format module to a predetermined position in the executable format program 5, and completes the linkage.

さて、実行形式プログラム5を実際に動作させてみて不
都合が生じた場合、リンクを行なった相対形式モジュー
ル(ソースプログラム)の変更を行ない、変更を行なっ
たソースプログラムについてはコンパイルを再度行ない
、さらに先に説明したような手順によりリンクをやり直
すことになる。
Now, if any problem occurs when you actually run executable program 5, change the relative format module (source program) that was linked, compile the modified source program again, and continue. You will need to redo the link using the steps described in .

1 に のリンクの際、セクションテーブル70及び記号表テー
ブル80の生成を先ず行なう。そして、記号表テーブル
80の識別情報項目82が定義を示しているものについ
てのみ先に認識し、シンボルテーブル90の作成を行な
い原形データブロック14中のシンボル名の解決を図る
。その後、記号表テーブル80の識別情報項目82が参
照を示している項目を認識し、さらに、アドレス項目8
3とリンクアドレス項目92の内容の比較を行なう。こ
の結果、不一致であった項目についてのみリンクアドレ
ス項目92の内容を、アドレス項目83へと書込み、さ
らに原形データブロック14中の該当するシンボル名の
位置に書込む。
1, the section table 70 and symbol table table 80 are first generated. Then, only those whose definitions are indicated by the identification information items 82 of the symbol table table 80 are recognized first, and a symbol table 90 is created to resolve the symbol names in the original data block 14. Thereafter, the item to which the identification information item 82 of the symbol table table 80 indicates the reference is recognized, and the address item 8
3 and the contents of the link address item 92 are compared. As a result, the contents of the link address item 92 are written into the address item 83 only for items that do not match, and are further written into the position of the corresponding symbol name in the original data block 14.

即ち、リンクアドレス項目92とアドレス項目83の内
容が一致したシンボル名については、リンクアドレスを
書込むといった処理を省く。これは、記号表16のアド
レス項目63に先にリンクを行なった際のリンクアドレ
スが残っており、これが新たなリンクの際にも利用でき
るためである。なお、記号表16のアドレス項目63に
リン 7 8 クアドレスが残っているということは、原形データブロ
ック14中の該当箇所にもリンクアドレスが残っている
ことを指す。
That is, for symbol names whose contents in the link address field 92 and the address field 83 match, the process of writing the link address is omitted. This is because the link address from the previous link remains in the address field 63 of the symbol table 16, and can be used when creating a new link. Note that the fact that the link address remains in the address field 63 of the symbol table 16 means that the link address also remains in the corresponding location in the original data block 14.

次に、原形データブロック14中のシンボル名及び相対
形式モジュール3.4のシンボル名についても解決した
場合、原形データブロック14を複写する実行形式プロ
グラム5上の位置を割り出し、原形データリンク位置項
目72の内容と比較する。この比較の結果が不一致であ
った場合には、先の説明のように、セクションテーブル
70の原形データリンク位置項目72の内容を書換え、
さらに原形データリンク位置項目32の内容を書換える
Next, when the symbol name in the original data block 14 and the symbol name in the relative format module 3.4 are also resolved, the position on the executable program 5 where the original data block 14 is to be copied is determined, and the original data link position item 72 is determined. Compare with the contents of If the result of this comparison is a mismatch, the content of the original form data link position item 72 of the section table 70 is rewritten as described above, and
Furthermore, the contents of the original form data link position item 32 are rewritten.

なお、割り出した原形データリンク位置と、原形データ
リンク位置項目72の内容が一致するということは、先
のリンクの際と同一の実行形式プログラム5の位置へと
原形データブロックI4を複写することを意味する。
Note that the fact that the determined original data link position and the content of the original data link position item 72 match means that the original data block I4 should be copied to the same location of the executable program 5 as in the previous link. means.

最後に、原形データブロック14を実1行形式プログラ
ム5上に複写してリンクを終了する。
Finally, the original data block 14 is copied onto the executable one-line program 5 to complete the linking.

以上のように、相対形式モジュール2にリンクの履歴、
即ちリンクアドレス等を残しておき、新たなリンクの際
、このリングアドレスが利用できるか否かを判断し、利
用できる場合には、原形データブロック14への情報を
そのまま利用する。
As mentioned above, link history in relative format module 2,
That is, the link address and the like are left, and when creating a new link, it is determined whether this ring address can be used or not, and if it can be used, the information for the original data block 14 is used as is.

(発明の効果) 以上説明した本発明の実行形式プログラムのリンク方法
は、−旦リンクを実行した後、新たにリンクを仕直す場
合、先に行なったリンクの際に得たリンクアドレスを利
用するため、リンク時間の短縮を図ることができる。従
って、速やかに実行形式プログラムを得ることができる
。また、原形データブロック中のリンクアドレス修飾と
いった処理が大幅に削減されるため、ハードウェアの負
担を軽減することができる。
(Effects of the Invention) The method for linking an executable program of the present invention described above is as follows: - When linking is executed once and then a new link is to be performed, the link address obtained during the previous link is used. Therefore, the link time can be shortened. Therefore, an executable program can be obtained quickly. Further, since processing such as link address modification in the original data block is significantly reduced, the burden on the hardware can be reduced.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明に係るリンク方法の説明図、第2図は一
般的なリンク方法の概念図、第3図は相対形式モジュー
ルの構成図、第4図は従来のリン 9 0 夕方法の説明図である。 1・・・リンケージエディタ、 2.3.4・・・相対形式モジュール、5・・・実行形
式プログラム、 12・・・ファイルヘッダ、 13・・・セクションヘッダ、 14・・・原形データブロック、 15・・・リロケーション情報、16・・・記号衣、7
0・・・セクションテーブル、75・・・ハツシュ表、
80・・・記号衣テーブル、 90・・・シンボルテーブル。
Fig. 1 is an explanatory diagram of the linking method according to the present invention, Fig. 2 is a conceptual diagram of a general linking method, Fig. 3 is a configuration diagram of a relative format module, and Fig. 4 is a diagram of the conventional linking method. It is an explanatory diagram. 1... Linkage editor, 2.3.4... Relative format module, 5... Executable format program, 12... File header, 13... Section header, 14... Original data block, 15 ...Relocation information, 16...Symbol clothing, 7
0...Section table, 75...Hatsh table,
80...Symbol table, 90...Symbol table.

Claims (1)

【特許請求の範囲】 コンパイル済みのプログラムである原形データを含む複
数の相対形式モジュールをリンクして実行形式プログラ
ムを得る場合に前記原形データ中にリンクアドレスを書
込んでおき、 既に前記リンクを終えて参照していたものであって、前
記何れかの相対形式モジュールを修正して再度前記リン
クを行なう時、 前記リンケージエディタ内で生成された新たな前記リン
クアドレスを、当該相対形式モジュールの各原形データ
中に既に書込まれたリンクアドレスと比較し、不一致の
場合のみ新たな前記リンクアドレスを当該原形データ中
に書込むことを特徴とする実行形式プログラムのリンク
方法。
[Claims] When an executable program is obtained by linking a plurality of relative format modules including original data, which are compiled programs, a link address is written in the original data, and the linking has already been completed. When you modify any of the relative format modules and perform the link again, the new link address generated in the linkage editor is added to each original format of the relative format module. A method for linking an executable program, characterized in that the link address is compared with a link address already written in the data, and only if there is a mismatch, a new link address is written in the original data.
JP29750389A 1989-11-17 1989-11-17 Link method for execution form program Pending JPH03158931A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP29750389A JPH03158931A (en) 1989-11-17 1989-11-17 Link method for execution form program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP29750389A JPH03158931A (en) 1989-11-17 1989-11-17 Link method for execution form program

Publications (1)

Publication Number Publication Date
JPH03158931A true JPH03158931A (en) 1991-07-08

Family

ID=17847359

Family Applications (1)

Application Number Title Priority Date Filing Date
JP29750389A Pending JPH03158931A (en) 1989-11-17 1989-11-17 Link method for execution form program

Country Status (1)

Country Link
JP (1) JPH03158931A (en)

Similar Documents

Publication Publication Date Title
US5367683A (en) Smart recompilation of performing matchup/difference after code generation
JP3606561B2 (en) Method, system, program, and data structure for converting first bit architecture instructions to second bit architecture instructions
US20090049437A1 (en) Method for configuring a computer program
US5625822A (en) Using sorting to do matchup in smart recompilation
US5446899A (en) Hint generation in smart recompilation
JPH06309204A (en) Method and device for data processing
US5535392A (en) Using hint generation to cause portions of object files to remain the same
US6086622A (en) Method and apparatus for converting an architecture of a program and method, and apparatus for debugging a program by using them
JP2006146613A (en) Program conversion method
JPH03158931A (en) Link method for execution form program
Egger et al. Formal specification of a safe PLC language and its compiler
JP3266097B2 (en) Automatic reentrant method and system for non-reentrant program
JPH06110733A (en) Test case generating device of program
JP2609820B2 (en) Program management method
JP2000020318A (en) Device for reducing memory access instruction and storage medium
JP2014157384A (en) Parallelization design support system, program, and method
JP3114199B2 (en) List output method of language processing system
JP2016151973A (en) Management control system, development support device therefor, and management device
JP5109808B2 (en) Additional executable information generating apparatus, information processing apparatus, and program
WO2022042854A1 (en) A method of programming a software module associated with a firmware unit of a device
JP2003076547A (en) System and method for automatically generating control software
JPH01305433A (en) Object program generating system
CN111052077A (en) Conversion device and conversion method
JPH06119203A (en) Debugging line deleting device
JPS62221037A (en) Compiling method