[go: up one dir, main page]

JP2000010792A - Global register system, method and computer program product - Google Patents

Global register system, method and computer program product

Info

Publication number
JP2000010792A
JP2000010792A JP11146389A JP14638999A JP2000010792A JP 2000010792 A JP2000010792 A JP 2000010792A JP 11146389 A JP11146389 A JP 11146389A JP 14638999 A JP14638999 A JP 14638999A JP 2000010792 A JP2000010792 A JP 2000010792A
Authority
JP
Japan
Prior art keywords
symbol
file
relocation
object file
information
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
JP11146389A
Other languages
Japanese (ja)
Inventor
Stephen Alan Chessin
ステファン・アラン・チェシン
Rodrick Ison Evans
ロドリック・アイソン・エバンス
Michael S Walker
ミカエル・エス・ウォーカー
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.)
Sun Microsystems Inc
Original Assignee
Sun Microsystems Inc
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 Sun Microsystems Inc filed Critical Sun Microsystems Inc
Priority to AU43238/99A priority Critical patent/AU4323899A/en
Priority to PCT/US1999/012063 priority patent/WO1999061970A2/en
Publication of JP2000010792A publication Critical patent/JP2000010792A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

(57)【要約】 【課題】ソースファイルをコンパイル及びリンクし、グ
ローバルシンボルをソースファイル内で参照されるレジ
スタと関連付けるシンボルテーブルを生成するシステ
ム、方法及びコンピュータプログラム製品を提供する。 【解決手段】シンボルテーブルは、初期化子を保持した
再配置エントリを用いて、リンカが、グローバルレジス
タを初期化できるようにする。コンパイラはまた、ソー
スファイルからオブジェクトファイルを生成する。オブ
ジェクトファイルは、グローバルシンボル情報を含んで
いる。リンカは、このオブジェクトファイルを、少なく
とも一つの他のオブジェクトファイル又は共有ライブラ
リとリンクし、実行可能ファイル又は共有ライブラリを
生成する。リンカは、オブジェクトファイルに含まれる
グローバルシンボル情報を使用して、グローバルレジス
タを初期化し、再配置演算を実行する。
(57) Abstract: A system, method and computer program product for compiling and linking a source file and generating a symbol table associating global symbols with registers referenced in the source file. A symbol table enables a linker to initialize a global register using a relocation entry holding an initializer. The compiler also generates an object file from the source file. The object file contains global symbol information. The linker links the object file with at least one other object file or shared library to generate an executable file or shared library. The linker uses the global symbol information included in the object file to initialize a global register and execute a relocation operation.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明の分野は、グローバル
レジスタの使用及び衝突検出のシステム、方法及びコン
ピュータプログラム製品に関し、特に、グローバルレジ
スタの使用の指標及びグローバルレジスタ内の使用衝突
の検出に関する。
FIELD OF THE INVENTION The field of the invention relates to systems, methods and computer program products for global register use and collision detection, and more particularly to global register use indicators and detection of use collisions in global registers.

【0002】[0002]

【従来の技術】特定のコンピュータプログラムシステム
においては、実行中のコンピュータプログラムによって
要求される変数の内容のコピーを一時的に保持するため
に、レジスタが使用される。変数の継続的な値はメモリ
内に格納される。また、コンピュータプログラムシステ
ムにおいて1つ以上のレジスタを、グローバルな適用範
囲の(すなわち、特定のモジュールやサブルーチンによ
って使われるのではなく、コンピュータシステム全体か
ら使われる)ものとして設計し、同じくグローバルな範
囲を持つグローバルレジスタ特定変数の使用に供するこ
とが、役立つことが知られている。
BACKGROUND OF THE INVENTION In certain computer program systems, registers are used to temporarily hold a copy of the contents of a variable required by a running computer program. The continuous value of the variable is stored in memory. Also, one or more registers in a computer program system are designed to be of global scope (ie, used by the entire computer system, rather than by a particular module or subroutine), and the global scope is also designed. It has been found useful to provide for the use of global register specific variables.

【0003】[0003]

【発明が解決しようとする課題】特定のプログラムは、
それぞれ別個にコンパイルされたオブジェクトモジュー
ルからリンクされるので、異なるシンボルが同じグロー
バルレジスタを参照し、変数の不正な参照や不正なスコ
ープが生じる可能性がある。特定のプログラムは、更
に、別個にコンパイルされた1つ以上のライブラリを含
んでおり、誤参照の問題を悪化させる。特定のプログラ
ムの異なる部分のそれぞれが、異なる変数値を格納する
ために用意された一つのグローバルレジスタを使用する
ときに、深刻な技術上の問題が表面化する。このような
使用は、間違った変数値が、間違った時にグローバルレ
ジスタ内にあることから、正しくない結果を引き起こす
傾向にある。
The specific program is:
Since each is linked from a separately compiled object module, different symbols may reference the same global register, resulting in incorrect references to variables and incorrect scope. Certain programs also include one or more separately compiled libraries, exacerbating the problem of misreference. A serious technical problem comes to light when each of the different parts of a particular program uses one global register provided to store different variable values. Such use tends to produce incorrect results because the wrong variable value is in the global register at the wrong time.

【0004】更に、ソフトウェア演算の間にグローバル
値を初期化することに関して、別の技術上の問題が起こ
る。プログラム実行の開始前に、与えられた値でメモリ
内の変数を初期化する機構は知られているが、実行の開
始前に、与えられた値にセットされるグローバル変数を
格納するためのレジスタを初期化する機構は知られてい
ない。
[0004] In addition, another technical problem arises with respect to initializing global values during software operations. Mechanisms for initializing a variable in memory with a given value before the start of program execution are known, but a register for storing a global variable set to a given value before the start of execution The mechanism for initializing is unknown.

【0005】[0005]

【課題を解決するための手段】本発明にしたがうと、別
個にコンパイルされたソフトウエアユニットは、静的及
び動的リンカがコンパイルに起因する使用の衝突を検出
できるように、これらのグローバルレジスタ使用を明示
する。更に、本発明によれば、グローバルレジスタは、
プログラムの実行の開始前に所望の値に初期化される。
本発明の一実施形態によれば、シンボルテーブル型「ST
T_SPARC_REGISTER」が、グローバルシンボルを特定のグ
ローバルレジスタと関連付ける特定のシンボルテーブル
エントリを明示するために確立される。シンボルテーブ
ルエントリの「名前」の部分は、シンボル名又はレジス
タがスクラッチスペースとして使用されることを示すヌ
ル値を格納する文字列を指す。シンボルテーブルエント
リの「値」部分は、このエントリが適用される特定のレ
ジスタを示す。シンボルテーブルエントリの他の部分
は、特定のレジスタ用の初期化子が存在するか否かを示
す。本発明の他の実施形態によれば、再配置型「R_SPAR
C_REGISTER」が、グローバルレジスタの初期値を示す。
SUMMARY OF THE INVENTION In accordance with the present invention, separately compiled software units use these global register usages so that static and dynamic linkers can detect usage conflicts due to compilation. Is specified. Furthermore, according to the present invention, the global register
It is initialized to a desired value before the execution of the program starts.
According to one embodiment of the present invention, the symbol table type "ST
"T_SPARC_REGISTER" is established to specify a particular symbol table entry that associates a global symbol with a particular global register. The “name” portion of the symbol table entry points to a string that stores a symbol name or a null value indicating that the register is used as scratch space. The "value" portion of a symbol table entry indicates the particular register to which this entry applies. The other part of the symbol table entry indicates whether there is an initializer for a particular register. According to another embodiment of the present invention, the relocation type "R_SPAR
“C_REGISTER” indicates the initial value of the global register.

【0006】本発明によれば、コンパイラは、含まれる
オブジェクトファイルがアプリケーションが確保したグ
ローバルレジスタを使う方法を示すように、シンボルテ
ーブルエントリを生成する。静的リンカは、特定のター
ゲットファイルに結合された全てのオブジェクトファイ
ルに関し、生成されたシンボルテーブルを検査し、異な
るソースエレメントにより参照されるグローバルレジス
タが共用できることを保証する。生成された結果オブジ
ェクトファイルは、結果オブジェクトグローバルレジス
タの使用を指標するために、これらのシンボルテーブル
エントリを含んでいる。本発明によれば、リンク時に参
照された共有オブジェクトファイルの何れかが、生成さ
れているオブジェクトファイルと共用できない形でグロ
ーバルレジスタを使用した場合、静的リンカは警告す
る。本発明によれば、アプリケーションが確保したグロ
ーバルレジスタを使用する共有オブジェクトファイル
が、生成されている場合、静的リンカは警告を生成す
る。アプリケーションが確保したグローバルレジスタを
用いてアーカイブライブラリが生成されている場合、本
発明にしたがって、アーカイバにより同様の警告が発行
される。本発明による動的リンカは、選択されたプロセ
スに結合されているすべてのオブジェクトファイルが、
アプリケーションが確保したグローバルレジスタを共用
できることを保証するよう検査する。
According to the present invention, the compiler generates a symbol table entry such that the included object file indicates how to use the global registers reserved by the application. The static linker examines the generated symbol table for all object files bound to a particular target file and ensures that global registers referenced by different source elements can be shared. The generated result object file includes these symbol table entries to indicate the use of the result object global register. According to the present invention, the static linker warns if any of the shared object files referenced during linking use global registers in a manner that cannot be shared with the object file being created. According to the present invention, if a shared object file that uses a global register reserved by an application has been generated, the static linker generates a warning. If the archive library is generated using the global registers secured by the application, a similar warning is issued by the archiver according to the present invention. The dynamic linker according to the present invention allows all object files bound to the selected process to
Check to ensure that the application can share the reserved global registers.

【0007】本発明にしたがうと、ソースファイルのコ
ンパイルとリンクのためのシステムと方法は、特定のソ
ースファイル内で参照又は定義されたグローバルシンボ
ルに関係する変数クラス情報を保持するため、特定のグ
ローバルシンボルを対応するグローバルレジスタに結び
付けるシンボルテーブルを生成するためのコンパイラを
含む。このシンボルテーブル情報は、リンカがクラス定
義を分析してクラス再配置演算を実行出来るようにする
のに十分である。このシンボルテーブル情報は、コンパ
イラが生成したオブジェクトファイル内に含まれる。こ
のコンパイラは、利用衝突の識別と再配置演算の実行を
リンカの演算まで遅らせるようオブジェクトファイルを
特別に生成する。リンカはオブジェクトファイルを他の
オブジェクトファイル及び共有ライブラリにリンクして
それにより実行ファイル又は共有ライブラリのいづれか
を生成する。他のオブジェクトファイルと共有ライブラ
リのリストは空白のこともあり、この場合は、リンカが
実行ファイル又は共有ライブラリを単一のオブジェクト
ファイルから生成する。リンカはオブジェクトファイル
内のクラス情報を利用して利用衝突を識別し再配置演算
を実行する。
[0007] In accordance with the present invention, a system and method for compiling and linking a source file are provided for maintaining variable class information related to global symbols referenced or defined in a particular source file. Includes a compiler for generating a symbol table that links symbols to corresponding global registers. This symbol table information is sufficient to enable the linker to analyze class definitions and perform class relocation operations. This symbol table information is included in the object file generated by the compiler. The compiler creates an object file specifically to delay the use conflict identification and relocation operations until the linker operation. The linker links object files with other object files and shared libraries, thereby generating either executable files or shared libraries. The list of other object files and shared libraries may be empty, in which case the linker generates an executable or shared library from a single object file. The linker uses the class information in the object file to identify a usage conflict and executes a relocation operation.

【0008】[0008]

【発明の実施の形態】図1は、本発明の好適実施形態に
したがうコンパイルのデータフローの図である。詳説す
ると、図1は本発明の一実施形態にしたがって、コンパ
イラ104、静的リンカ114及びランタイムリンカ1
18を含む。コンパイラ104は、ソースファイル10
2からオブジェクトファイル106を生成する。ソース
ファイル102は、本発明の別の実施形態にしたがって
既知のC、C++、又はフォートランコンピュータプログ
ラム言語で書かれている。本発明は、デベロッパがソー
スファイル102の作成のため選んだ特定言語の使用方
法には制限を加えないことに注目するのは重要である。
本発明の一実施形態にしたがって、静的リンカ114
は、レジスタシンボル初期化に用いられる再配置コード
区画を含む。再配置コード区画は、名前=.rela、型=S
HT_RELA、及び属性=無しを有し、従って下表は、有効
である。
FIG. 1 is a diagram of the data flow of a compilation according to a preferred embodiment of the present invention. In particular, FIG. 1 illustrates a compiler 104, a static linker 114, and a runtime linker 1 according to one embodiment of the present invention.
18 inclusive. The compiler 104 generates the source file 10
2 to generate an object file 106. Source file 102 is written in a known C, C ++, or Fortran computer programming language according to another embodiment of the present invention. It is important to note that the present invention places no restrictions on the use of the particular language that the developer has chosen to create the source file 102.
According to one embodiment of the present invention, static linker 114
Contains a rearranged code section used for register symbol initialization. Relocation code section, name = .rela, type = S
HT_RELA, and attribute = none, so the table below is valid.

【0009】[0009]

【表1】 [Table 1]

【0010】.rela: sh_linkは関連シンボルテーブル
のセクションヘッダインデクスを含み、sh_infoは0
で、このセクションはレジスタ再配置を含むのみである
ことを示す。
.Rela: sh_link contains the section header index of the related symbol table, and sh_info contains 0
Indicates that this section only contains register relocations.

【0011】オブジェクトファイル106、同時にゼロ
以上の他のオブジェクトファイル108、及び/又はゼ
ロ以上の共有ライブラリ110は、本発明にしたがっ
て、静的リンカ114に転送される。他のオブジェクト
ファイル108は、本発明のコンパイラ104が以前に
コンパイルしたもので、共有ライブラリ110は静的リ
ンカ114が以前に作成したものである。静的リンカ1
14は実行可能ファイル116を生成する。本発明の一
実施形態によれば、前記静的リンカ114は、他の共有
ライブラリを生成する。理解されるように、共有ライブ
ラリはオブジェクトファイルの形式である。したがっ
て、用語「オブジェクトファイル」と「共有ライブラ
リ」はここでは交換可能で使用する。当業者は理解する
であろうように、実行可能ファイル116は、オブジェ
クトファイル106、108からのコード、データ及び
その他の情報を含み、また共有ライブラリ110への参
照を含んでいる(すなわち、共有ライブラリからのコー
ド、データなどは、実際には実行可能ファイル116に
組み込まれない)。実行時、実行可能ファイル116と
共有ライブラリ110は、ランタイムリンカ118に転
送される。ランタイムリンカ118は次いで実行可能フ
ァイル116に含まれた参照を共有ライブラリに分解
し、そして実行イメージ120を作成する。実行イメー
ジ120は、メインメモリ208に格納され、中央処理
装置204(図2)において実行される。一般的に、静
的リンカ114とランタイムリンカ118の演算は、図
3及び図4に詳説するように、4フェーズに分解され
る。
[0011] The object file 106, simultaneously zero or more other object files 108, and / or zero or more shared libraries 110 are transferred to a static linker 114 in accordance with the present invention. The other object files 108 were previously compiled by the compiler 104 of the present invention, and the shared library 110 was previously created by the static linker 114. Static linker 1
14 generates an executable file 116. According to one embodiment of the present invention, the static linker 114 generates another shared library. As will be appreciated, shared libraries are in the form of object files. Thus, the terms "object file" and "shared library" are used interchangeably herein. As those skilled in the art will appreciate, executable file 116 contains code, data, and other information from object files 106, 108, and also contains references to shared library 110 (ie, shared library 110). The code, data, etc. from are not actually incorporated into the executable file 116). At runtime, the executable 116 and the shared library 110 are transferred to the runtime linker 118. The runtime linker 118 then decomposes the references contained in the executable 116 into a shared library and creates an executable image 120. The execution image 120 is stored in the main memory 208 and executed in the central processing unit 204 (FIG. 2). In general, the operations of the static linker 114 and the runtime linker 118 are broken down into four phases, as detailed in FIGS.

【0012】図2は、本発明の好適実施形態にしたがう
コンピュータシステムのプロック図である。コンピュー
タシステム202は、バス206のような通信媒体に接
続された、中央処理装置(CPU)204のような一台
以上の処理装置を含む。メインメモリ(ランダムアクセ
スメモリ(RAM)に限定されない)208は、またバ
ス206に接続される。コンパイラ104及びリンカ1
12は、メインメモリ208に格納される。リンカ11
2は、本発明にしたがって静的リンカ114、及びラン
タイム又は動的リンカ、又はその双方を含む。ソースフ
ァイル102、オブジェクトファイル106と108、
共有ライブラリ110、及び実行イメージ120もまた
メインメモリ208に記憶されるのが好適である。コン
ピュータシステム202はさらに、レジスタ210を含
む。ディスク214のようなコンピュータプログラム製
品は、その上に記録されたコンピュータプログラムロジ
ックを有するコンピュータ読取可能媒体を含み、このコ
ンピュータロジックは、コンピュータシステム202内
で実行されたとき、コンピュータシステム202が本発
明の機能を実行できるように、フロッピディスクドライ
ブ212のような補助記憶装置によって読み込むことが
できる。コンパイラ114及びリンカ112を記述した
コンピュータプログラムロジックは、次いで(図示する
ように)メインメモリ208にロードされて、CPU2
04によって実行される。コンピュータシステム202
に適切な形式は、カリフォルニア州マウンテンビューの
サンマイクロシステムズ(Sun Microsystems)社製のサン
マイクロシステムズワークステーションである。代わり
に任意の他の適切なコンピュータシステムも使用可能で
ある。
FIG. 2 is a block diagram of a computer system according to a preferred embodiment of the present invention. Computer system 202 includes one or more processing devices, such as a central processing unit (CPU) 204, connected to a communication medium, such as a bus 206. A main memory (not limited to random access memory (RAM)) 208 is also connected to bus 206. Compiler 104 and linker 1
12 is stored in the main memory 208. Linker 11
2 includes a static linker 114 and a runtime or dynamic linker, or both, in accordance with the present invention. Source file 102, object files 106 and 108,
The shared library 110 and the execution image 120 are also preferably stored in the main memory 208. Computer system 202 further includes register 210. A computer program product, such as disk 214, includes a computer readable medium having computer program logic recorded thereon, which, when executed within computer system 202, causes The functions can be read by an auxiliary storage device such as a floppy disk drive 212 so that the functions can be performed. The computer program logic describing the compiler 114 and the linker 112 is then loaded into the main memory 208 (as shown) and
04. Computer system 202
A suitable format is a Sun Microsystems workstation from Sun Microsystems, Inc. of Mountain View, California. Alternatively, any other suitable computer system can be used.

【0013】図3は、本発明に関連して使用出来るリン
カプロセスのフローチャートである。フローチャート3
02は、特に、静的リンカ114とランタイムリンカ1
18が開始フェーズ304の後に読取り演算を実行する
処理を行う読取フェーズの実行306、レイアウトフェ
ーズ308、再配置フェーズ310、及び書込フェーズ
312を示す。これらのリンカフェーズ306、30
8、310、及び312は、当業者には良く知られたも
のである。フローチャート302は、終了フェーズ31
4の実行で完了する。
FIG. 3 is a flowchart of a linker process that can be used in connection with the present invention. Flowchart 3
02, in particular, the static linker 114 and the runtime linker 1
Reference numeral 18 denotes an execution 306 of a read phase, a layout phase 308, a rearrangement phase 310, and a write phase 312 for performing a process of executing a read operation after the start phase 304. These linker phases 306, 30
8, 310 and 312 are well known to those skilled in the art. The flowchart 302 is for the end phase 31
4 is completed.

【0014】図4は、本発明の一実施形態にしたがった
リンカプロセスのフローチャート352である。詳説す
ると、開始フェーズ354の完了の後、読取りフェーズ
356が実行され、静的リンカ114及びランタイムリ
ンカ118が読取り演算を実行するために処理を行う。
その後、レイアウトフェーズ358が実行され、再配置
フェーズ360及びメモリへの書込みフェーズ362が
続く。その後、本発明にしたがって、グローバルレジス
タが初期化され、制御は実行可能イメージへ渡され、次
いで、終了フェーズ394で完了する。
FIG. 4 is a flowchart 352 of a linker process according to one embodiment of the present invention. In particular, after completion of the start phase 354, a read phase 356 is performed, where the static linker 114 and the runtime linker 118 perform processing to perform a read operation.
Thereafter, a layout phase 358 is performed, followed by a relocation phase 360 and a write to memory phase 362. Thereafter, in accordance with the present invention, the global registers are initialized, control passes to the executable image, and is then completed in the end phase 394.

【0015】図5は、本発明の好適実施形態にしたがう
コンパイラによるオブジェクトファイル生成のブロック
図である。図5に示すように、オブジェクトファイル1
06は、コードとデータ402、及びシンボル情報40
6を含む。本発明の一実施形態によれば、オブジェクト
ファイル106は、更に、一つの、又は他の、又はこれ
ら双方のシンボルテーブル404及びシンボルテーブル
408を含む。本発明の一実施形態によるシンボル情報
406は、シンボルテーブル408を含んでいる。更
に、本発明の一実施形態によれば、シンボル情報406
は再配置テーブル412を含んでいる。コンパイラ10
4は、コードとデータ402、及びグローバルシンボル
及びグローバルレジスタ情報を含むシンボルテーブル4
08のための情報を生成し、これらの情報406をオブ
ジェクトファイル106に埋め込む。このグローバルシ
ンボル及びグローバルレジスタの情報は、ソースファイ
ル102内で定義及び/又は参照されたグローバルシン
ボルとグローバルレジスタについてのデータを含み、更
にソースファイル102が前記グローバルシンボルとグ
ローバルレジスタの情報を使う方法についての追加情報
をも含む。コンパイラ104によって生成されたグロー
バルシンボルとグローバルレジスタの情報406は、そ
れが静的、動的又はランタイムに拘わらずリンカ112
が、グローバルシンボル衝突とグローバルレジスタ衝突
を識別し、本発明にしたがって再配置を実行する。
FIG. 5 is a block diagram of object file generation by a compiler according to a preferred embodiment of the present invention. As shown in FIG.
06 is code and data 402 and symbol information 40
6 inclusive. According to one embodiment of the present invention, object file 106 further includes one or other, or both, symbol table 404 and symbol table 408. The symbol information 406 according to one embodiment of the present invention includes a symbol table 408. Further, according to one embodiment of the present invention, the symbol information 406
Includes a relocation table 412. Compiler 10
4 is a symbol table 4 including codes and data 402, and global symbols and global register information.
08, and the information 406 is embedded in the object file 106. This global symbol and global register information includes data about global symbols and global registers defined and / or referenced in the source file 102, and further describes how the source file 102 uses the global symbol and global register information. Also includes additional information. The global symbol and global register information 406 generated by the compiler 104, whether it is static, dynamic or runtime,
Identifies global symbol collisions and global register collisions and performs relocation according to the present invention.

【0016】上述のように、本発明によれば、グローバ
ルシンボルの衝突及び再配置を実行するのは、コンパイ
ラ104ではない。その代わり、グローバルシンボル衝
突の識別は、本発明にしたがってコンパイル時からリン
ク時に遅らせられる。図6に示すように、開始フェーズ
504に続くステップ506にしたがって、コンパイラ
104は、グローバルシンボルについての情報及びその
使用法を生成するために用いられる。グローバルシンボ
ル衝突についての前記の情報はシンボル情報406に呼
び出されて、コンパイラ104が作成したオブジェクト
ファイル106の中に埋め込まれる。更に、図6は、本
発明の好適実施形態にしたがうコンパイル/リンクプロ
セスのフローチャートである。さらに詳説すると図6
は、コンパイラ104及びリンカ114、118のうち
適切な一つの高レベル処理をあらわす本発明にしたがう
フローチャート502を描写する。ソースファイル10
4をコンパイルするときコンパイラがステップ506を
実行し、オブジェクトファイル106と108、及び共
有ライブラリ110を処理するときリンカ114、11
8のうち適切な一つがステップ508を実行する。フロ
ーチャート502はステップ504で始まり、この開始
フェーズの完了の後に、制御はステップ506に渡され
る。コンパイラは、グローバルシンボルテーブルエント
リに関する情報を生成して、ここに含まれるオブジェク
トファイルが特定のアプリケーションが確保したグロー
バルレジスタを使う方法を示すようにする。プログラマ
は、したがって、例えば、本発明の一実施形態にしたが
いフラグを用いてコンパイラに、又は本発明の別の実施
形態にしたがいフラグ又は命令を用いてアセンブラに、
選択されたグローバルレジスタのための特定のレジスタ
利用法が何であるかを指示する。ステップ506におい
て、コンパイラ104がオブジェクトファイル106を
ソースファイル102から生成する。ステップ508に
おいて、適切なリンカ114、118が実行ファイル1
16を、次いで実行イメージ120をオブジェクトファ
イル106、108及び共有ファイル110から生成す
る。上述のように、実行ファイル116と実行イメージ
120の生成中に、静的リンカ114とランタイムリン
カ118が、読取フェーズ306、レイアウトフェーズ
308、再配置フェーズ310、及び書込フェース31
2を実行する。本発明にしたがうと、これらのリンカフ
ェーズ306、308、310、及び312は、静的リ
ンカ114とランタイムリンカ118がグローバルシン
ボル衝突を識別して再配置を実行するよう修正される。
静的リンカ114とランタイムリンカ118の作用は下
記でさらに詳しく説明する。ステップ508が完全に実
行された後、ステップ510で示すように、フローチャ
ート502の処理は完了する。静的リンカが、実行ファ
イル又は共有ライブラリに結合されたオブジェクトファ
イルの中のこれらシンボルテーブルエントリを点検し
て、グローバルレジスタが共用できるように使用されて
いることを確認する。本発明にしたがって、出来上がっ
たオブジェクトは、そのシンボルテーブル中に、出来上
がったオブジェクトのグローバルレジスタ使用法を示す
ためのエントリを含む。静的リンカは、リンク中に参照
した共有ライブラリのいずれかが、構築中のオブジェク
トと共有しない方法でグローバルレジスタを用いている
とき、警告する。本発明の一実施形態にしたがうとさら
に、アプリケーションが確保したグローバルレジスタを
利用する共有オブジェクトを構築しようとすると、静的
リンカが警告を発する。アプリケーションが確保したグ
ローバルレジスタを使用するオブジェクトを含んでアー
カイブライブラリが生成されている場合、アーカイバに
より同様の警告が発行される。本発明にしたがう動的リ
ンカは、目標プロセスに結合される全オブジェクトファ
イルがアプリケーションが確保したグローバルレジスタ
が共有可能に使用されていることを点検する。アプリケ
ーションプロセスと両立しないオブジェクトのdlopen()
は、例えば、本発明に従えばエラーで失敗する。
As described above, according to the present invention, it is not the compiler 104 that performs collision and relocation of global symbols. Instead, the identification of global symbol collisions is delayed from compile time to link time in accordance with the present invention. As shown in FIG. 6, according to step 506 following start phase 504, compiler 104 is used to generate information about global symbols and their usage. The above information about global symbol collisions is called into the symbol information 406 and embedded in the object file 106 created by the compiler 104. FIG. 6 is a flowchart of a compile / link process according to a preferred embodiment of the present invention. More specifically, FIG.
Depicts a flowchart 502 according to the present invention, representing the high-level processing of one of the compiler 104 and one of the linkers 114, 118. Source file 10
4 compiles step 506 and the linker 114, 11 when processing the object files 106 and 108 and the shared library 110.
An appropriate one of the eight performs step 508. Flowchart 502 begins at step 504, and after completion of this start phase, control is passed to step 506. The compiler generates information about the global symbol table entries so that the object files contained therein indicate how to use the global registers reserved by a particular application. The programmer may thus, for example, use a flag according to one embodiment of the invention to a compiler or to a assembler using flags or instructions according to another embodiment of the invention
Indicates what the specific register usage for the selected global register is. In step 506, the compiler 104 generates the object file 106 from the source file 102. In step 508, the appropriate linker 114, 118
16 and then an execution image 120 is generated from the object files 106, 108 and the shared file 110. As described above, during the generation of the executable file 116 and the executable image 120, the static linker 114 and the runtime linker 118 configure the read phase 306, layout phase 308, relocation phase 310, and
Execute Step 2. In accordance with the present invention, these linker phases 306, 308, 310, and 312 are modified so that static linker 114 and runtime linker 118 identify global symbol collisions and perform relocation.
The operation of the static linker 114 and the runtime linker 118 will be described in more detail below. After step 508 has been completely executed, the process of flowchart 502 is completed, as indicated by step 510. The static linker checks these symbol table entries in the executable file or object file associated with the shared library to make sure that the global registers are being used for sharing. In accordance with the present invention, the resulting object includes an entry in its symbol table to indicate the global register usage of the resulting object. The static linker warns when any of the shared libraries referenced during linking use global registers in a way that they do not share with the object under construction. In accordance with one embodiment of the present invention, the static linker issues a warning when further attempting to build a shared object that utilizes an application-allocated global register. When an archive library is generated including an object using the global register allocated by the application, a similar warning is issued by the archiver. The dynamic linker according to the present invention checks that all object files bound to the target process use application-allocated global registers in a shareable manner. Dlopen () on objects that are incompatible with the application process
Fails with an error, for example, according to the present invention.

【0017】[0017]

【表2】 [Table 2]

【0018】*OKは、シンボルが同じとき用いる。N
Oはそれらが同一でないとき用いる。二つのシンボルは
下記の一つのみが真であるとき同一である。 A.両者ともグローバルで、同一名称を有する。 B.両者ともローカルで、同一名称を有し、同一オブジ
ェクト内で定義されている。
* OK is used when the symbols are the same. N
O is used when they are not identical. Two symbols are identical when only one of the following is true: A. Both are global and have the same name. B. Both are local, have the same name, and are defined in the same object.

【0019】本発明にしたがうスクラッチシンボルは、
ヌル名がヌル名のみと一致し、本発明にしたがうスクラ
ッチレジスタがグローバルな適用範囲を持つので、シン
ボルとして扱われる。同一レジスタシンボルについての
st_shndxの許容される組合せのマトリクスを下記する。
The scratch symbol according to the present invention is:
Since the null name matches only the null name and the scratch register according to the present invention has a global scope, it is treated as a symbol. For the same register symbol
The matrix of permissible combinations of st_shndx is described below.

【0020】[0020]

【表3】 [Table 3]

【0021】本発明の一実施形態にしたがうシンボル情
報406は、(1)グローバルシンボルの一覧を含むシ
ンボルテーブル408、及び(2)グローバルシンボル
の一覧を含む再配置テーブル412を含む。シンボル情
報406を用いて、ステップ508で適切なリンカ11
4又は118がアプリケーションの使用するグローバル
シンボルの正確なレイアウトを決定し、次いで要求され
た再配置を履行する。シンボルテーブル408は複数の
エントリを含み、各エントリが一つのシンボルに対応す
る。これらのエントリは、再配置プロセス中にリンカ1
14と118が使用する。
The symbol information 406 according to one embodiment of the present invention includes (1) a symbol table 408 containing a list of global symbols, and (2) a relocation table 412 containing a list of global symbols. Using the symbol information 406, the appropriate linker 11
4 or 118 determines the exact layout of the global symbols used by the application and then implements the required relocation. The symbol table 408 includes a plurality of entries, each entry corresponding to one symbol. These entries are used by linker 1 during the relocation process.
14 and 118 use.

【0022】図7は、本発明の好適実施形態にしたがう
リンク処理の詳細フローチャートである。リンカは一般
に、4つのフェーズ、すなわち読取フェーズ306、レ
イアウトフェーズ308、再配置フェーズ310、及び
書込フェーズ312(図3)にしたがって処理を行う。
本発明において、これらのリンカフェーズ306、30
8、310及び312は、適切なリンカがグローバルシ
ンボル衝突を識別するように修正されている。この修正
を図7のフローチャート602に示す。詳説すると、ス
テップ606は、好ましくは、読取フェーズ306の中
で実行される。ステップ608は、好ましくは、読取フ
ェーズ306とレイアウトフェーズ308との間で実行
される。ステップ610によれば、ステップ612及び
614で識別されたグローバルシンボル衝突は、好まし
くは、レイアウトフェーズ308と再配置フェーズ31
0の間で実行される。ステップ616は、好ましくは、
再配置フェーズ310の間で実行される。ここでフロー
チャート602を説明する。フローチャート602はス
テップ604で開始され、制御は直ちにステップ606
に渡される。ステップ606において、適切なリンカ
は、オブジェクトファイル106、108と共有ライブ
ラリ110を読み取って、これらのファイルに含まれる
グローバルシンボル情報406を統合する。特に、適切
なリンカは、統合されたシンボルテーブルを生成するた
めに、これらのファイルに含まれるグローバルシンボル
テーブル408を統合する。同様に、適切なリンカは、
再配置テーブル412を統合して、統合再配置テーブル
を生成する。ステップ608において、適切なリンカは
グローバルシンボル衝突を識別する。詳説すると、適切
なリンカが統合テーブルを処理して各シンボルのレイア
ウト(例えば、各シンボルのサイズとアラインメント、
フィールド数、フィールドのデータ型、シンボルのトッ
プからフィールドの各々までのバイト数、など)を決定
する。適切なリンカは各シンボル毎に別個のデータ構造
体を作成し、このシンボル固有情報を前記データ構造体
に記憶する。これらデータ構造体は、参照の目的で「レ
イアウトデータ構造体」と呼ぶ。ステップ608が完了
すると、適切なリンカは、従来のコンパイラが作成した
従来から知られているシンボル関連情報のすべてを知悉
する。ステップ612において、適切なリンカは統合シ
ンボルテーブル内のシンボルを評価する。詳説すると、
適切なリンカは統合シンボルテーブルの各エントリ内の
シンボルの値を決定して、この値をエントリの値フィー
ルドに記憶する。例えば、図8の例示シンボルテーブル
408を考える。適切なリンカは、特定のクラスノ適切
なレイアウトデータ構造体を参照してエントリ714及
び718の値を決定する。適切なリンカは、これらの値
をこれらエントリ714及び718の値フィールドに記
憶する。リンカ112が他のシンボル型の値を計算する
方法は上述した。ステップ614において、適切なリン
カはグローバルレジスタ構造体を初期化する。詳説する
と、ステップ614の間に適切なリンカは、テーブル及
びテーブルポインタ情報テーブルを生成して、これらの
テーブルを既に割り当てられたアプリケーションデータ
構造体内に記憶する。ステップ616において、適切な
リンカは統合再配置テーブルのエントリに規定された再
配置を実行する。適切なリンカがこの機能を果たす方法
は上述した。ステップ616が完全に実行された後、ス
テップ618で示すように、フローチャート602の処
理は完了する。当業者は理解するであろうように、適切
なリンカの上述の作用は、実例においては、静的リンカ
114とランタイムリンカ118が集合的に実行する。
上述の作用を静的リンカ114がおこなうかランタイム
リンカ118がおこなうかは、本発明において重要では
ない。しかし、静的リンカ114が実行可能及び共有オ
ブジェクトを予備リンクすることを試みて、実行可能及
び共有オブジェクトがそれらの創成時と同じ状態にある
とき、ランタイムリンカ118はファイルをロードして
起動するだけで済むようにするのが好適である。実例に
おいて、ランタイムリンカ118は、静的リンカのおこ
なった多くの再配置を読み取らなければならない。
FIG. 7 is a detailed flowchart of the link processing according to the preferred embodiment of the present invention. The linker generally operates according to four phases: a read phase 306, a layout phase 308, a relocation phase 310, and a write phase 312 (FIG. 3).
In the present invention, these linker phases 306, 30
8, 310 and 312 have been modified so that the appropriate linker identifies global symbol collisions. This correction is shown in the flowchart 602 of FIG. Specifically, step 606 is preferably performed during read phase 306. Step 608 is preferably performed between read phase 306 and layout phase 308. According to step 610, the global symbol collision identified in steps 612 and 614 preferably includes the layout phase 308 and the rearrangement phase 31
Executed between 0. Step 616 preferably includes
Performed during the relocation phase 310. Here, the flowchart 602 will be described. Flowchart 602 begins at step 604, where control immediately proceeds to step 606.
Passed to. In step 606, the appropriate linker reads the object files 106, 108 and the shared library 110 and integrates the global symbol information 406 contained in these files. In particular, a suitable linker integrates the global symbol tables 408 contained in these files to generate an integrated symbol table. Similarly, a suitable linker is
The relocation table 412 is integrated to generate an integrated relocation table. In step 608, the appropriate linker identifies a global symbol collision. To elaborate, the appropriate linker processes the integration table to lay out each symbol (eg, the size and alignment of each symbol,
Field number, field data type, number of bytes from the top of the symbol to each of the fields, etc.). Suitable linkers create a separate data structure for each symbol and store this symbol-specific information in said data structure. These data structures are referred to as "layout data structures" for reference purposes. Upon completion of step 608, the appropriate linker knows all of the conventionally known symbol related information created by the conventional compiler. At step 612, the appropriate linker evaluates the symbols in the integrated symbol table. To elaborate,
A suitable linker determines the value of the symbol in each entry of the integrated symbol table and stores this value in the value field of the entry. For example, consider the example symbol table 408 of FIG. The appropriate linker determines the values of entries 714 and 718 with reference to the specific Krasno appropriate layout data structure. The appropriate linker stores these values in the value fields of these entries 714 and 718. The manner in which the linker 112 calculates values for other symbol types has been described above. In step 614, the appropriate linker initializes a global register structure. In particular, during step 614, the appropriate linker generates tables and table pointer information tables and stores these tables in the already allocated application data structure. In step 616, the appropriate linker performs the relocation specified in the entry of the consolidated relocation table. The manner in which a suitable linker performs this function has been described above. After step 616 has been completely executed, the process of flowchart 602 is completed, as indicated by step 618. As those skilled in the art will appreciate, the above-described operation of a suitable linker is illustratively performed collectively by the static linker 114 and the runtime linker 118.
It is not important in the present invention whether the static linker 114 or the runtime linker 118 performs the above operation. However, when the static linker 114 attempts to prelink executable and shared objects, and the executable and shared objects are in the same state as when they were created, the runtime linker 118 only loads and starts the file. It is preferable that the process be completed. In an example, the runtime linker 118 must read many relocations made by the static linker.

【0023】図8は、本発明の好適実施形態によるコン
パイラによって生成されたシンボルテーブルの例であ
る。図8は、特に、例示シンボルテーブル408中の第
1及び第2のシンボルテーブルエントリ714及び71
8を示している。シンボルテーブル408の各エントリ
は、シンボル型を識別する情報及びこのクラスのシンボ
ルの値を示す情報を含んでいる。特定のシンボルのエン
トリは、追加的に、例えば、シンボル名、シンボルサイ
ズ、シンボル結合、及びシンボルセクションインデクス
等のフィールドを更に含むことができる。シンボル名は
適切なときメンバー名を含む。シンボル型のリストは、
実装に特有で、コンピュータプログラミング言語及び目
標マシンのような数多くの要因に左右される。シンボル
型の例は当業者には明らかであろう。
FIG. 8 is an example of a symbol table generated by a compiler according to a preferred embodiment of the present invention. FIG. 8 specifically illustrates the first and second symbol table entries 714 and 71 in the example symbol table 408.
8 is shown. Each entry of the symbol table 408 includes information for identifying a symbol type and information indicating a value of a symbol of this class. The entry for a particular symbol may additionally include fields such as, for example, the symbol name, symbol size, symbol combination, and symbol section index. Symbol names include member names where appropriate. The list of symbol types is
It is implementation specific and depends on many factors, such as the computer programming language and the target machine. Examples of symbol types will be apparent to those skilled in the art.

【0024】下記に説明するように、適切なリンカは、
再配置テーブル412中の再配置エントリの処理の前
に、本発明のシンボルテーブル408内のシンボルの値
を計算する。各再配置エントリの処理において、その値
はシンボルテーブルから読み出され、再配置エントリの
型にしたがう与えられたアドレスへ格納される。図8の
例を参照されたい。再配置テーブル412内の再配置エ
ントリの処理に先立って、適切なリンカはシンボルテー
ブル408中のシンボルエントリ714、718を評価
し、各シンボルエントリに関連付けられた値を読む。適
切なリンカは、そして、読み取った値をシンボルエント
リ714の値フィールドへ入れる。本発明の一実施形態
によれば、適切なリンカは、シンボルエントリ718の
値フィールドへこの値(8バイト)を入れる。特定の再
配置エントリの処理の間、本発明による適切なリンカ
は、特定のアドレスにある命令の中の位置ホルダをシン
ボルエントリ714の中の値で置き換える。これは再配
置エントリ714中のポインタがシンボルエントリ71
4を指す場合である。同様に、再配置テーブル412に
ついての特定の再配置エントリ処理の間に、適切なリン
カは、特定のアドレスにある命令の中の0(すなわち"
0")のような位置ホルダをシンボルエントリ714内
に用意された値で置き換える。本発明の一実施形態によ
るシンボルテーブル内の登録シンボルは、下記に示すよ
うに、特有の追加的のシンボル型及び値によって示され
る。
As explained below, a suitable linker is
Before processing the relocation entry in the relocation table 412, the value of the symbol in the symbol table 408 of the present invention is calculated. In processing each relocation entry, its value is read from the symbol table and stored at a given address according to the type of the relocation entry. See the example in FIG. Prior to processing the relocation entries in relocation table 412, the appropriate linker evaluates symbol entries 714, 718 in symbol table 408 and reads the value associated with each symbol entry. The appropriate linker then places the read value in the value field of symbol entry 714. According to one embodiment of the present invention, a suitable linker places this value (8 bytes) in the value field of symbol entry 718. During processing of a particular relocation entry, a suitable linker according to the present invention replaces the position holder in the instruction at the particular address with the value in the symbol entry 714. This is because the pointer in the relocation entry 714 is the symbol entry 71
4. Similarly, during the processing of a particular relocation entry for the relocation table 412, the appropriate linker will return 0 (ie, "") in the instruction at the particular address.
0 ") is replaced with the value provided in the symbol entry 714. The registered symbols in the symbol table according to one embodiment of the present invention have specific additional symbol types and Indicated by value.

【0025】[0025]

【表4】 [Table 4]

【0026】本発明の一実施形態にしたがうレジスタシ
ンボル用のシンボルテーブルエントリは下記エレメント
を含む。 st_name: シンボル名の文字列テーブルへのインデク
ス。文字列テーブル内のヌル名を指す0のインデクス値
は、レジスタがスクラッチ用に使用されていることを示
す。スクラッチレジスタはビンディングSTB_GLOBALを有
していなければならない。 st_value: レジスタメンバー。レジスタメンバーは、
整数レジスタについてのSPARCアーキテクチャマニ
ュアルの中の割当に相当する。 st_size: 未使用(0) st_info: ELF64_ST_INF0(バインド型)。バインドは普
通STB_GLOBALであるが、実際に宣言された名前の適用範
囲を反映する(つまり、STB_WEAK又はSTB_LOCALになるこ
とがある)。型はSTB_REGISTER(13)でなければならな
い。 st_other: 未使用(0) st_shndx: このオブジェクトがこのレジスタシンボル
を初期化するなら、SHN_ABS,そうでなければ、SHN_UNDE
F。SHN_ABSレジスタシンボル用の初期化子は、特別レジ
スタ再配置型を用いて規定する。
A symbol table entry for a register symbol according to one embodiment of the present invention includes the following elements: st_name: Index of the symbol name into the string table. An index value of 0 pointing to a null name in the string table indicates that the register is being used for scratch. The scratch register must have the binding STB_GLOBAL. st_value: Register member. Register members are
Corresponds to the assignment in the SPARC Architecture Manual for integer registers. st_size: Not used (0) st_info: ELF64_ST_INF0 (Bind type). The binding is usually STB_GLOBAL, but reflects the scope of the actual declared name (that is, it can be STB_WEAK or STB_LOCAL). The type must be STB_REGISTER (13). st_other: Unused (0) st_shndx: SHN_ABS if this object initializes this register symbol, SHN_UNDE otherwise
F. The initializer for the SHN_ABS register symbol is specified using a special register relocation type.

【0027】特定のグローバルレジスタについてのエン
トリの欠落は、その特定のグローバルレジスタをオブジ
ェクトが使用していないことを意味する。本発明にした
がうオブジェクトは、一つ以上のアプリケーションが確
保したグローバルレジスタを使用し、この適当なシンボ
ルテーブルエントリの使用法を示す。本発明の一実施形
態にしたがうと下記の動的配列タグが、更にシンボルテ
ーブルに加えられる。
A missing entry for a particular global register means that the object is not using that particular global register. Objects in accordance with the present invention use global registers reserved by one or more applications to indicate the use of this appropriate symbol table entry. According to one embodiment of the present invention, the following dynamic array tags are further added to the symbol table.

【0028】[0028]

【表5】 [Table 5]

【0029】本発明によるコンパイラ104は、従っ
て、リンク時に再配置されるコードを生成する。特に、
ソースファイルの中で変数が参照されると、コンパイラ
104は、シンボルテーブル408及び再配置テーブル
412の双方を生成する。本発明の一実施形態によれ
ば、シンボル及び再配置テーブルの生成は、グローバル
レジスタ衝突を識別し、生成される実行イメージの実行
に先立ってグローバルレジスタを初期化するために用い
られる特別のグローバルレジスタ再配置型によって達成
される。
The compiler 104 according to the present invention therefore produces code that is relocated at link time. In particular,
When a variable is referenced in the source file, the compiler 104 generates both the symbol table 408 and the relocation table 412. According to one embodiment of the present invention, the generation of the symbol and relocation table identifies a special global register used to identify global register conflicts and initialize the global register prior to execution of the generated execution image. Achieved by the relocation type.

【0030】図9は、本発明の一実施形態による再配置
テーブルの例である。再配置テーブル412は、リンク
時に適切なリンカによって実行されるべき再配置のリス
トを含んでいる。再配置テーブル412の各エントリ
は、再配置型、命令又は再配置される必要があるデータ
エレメントの何れかのアドレス、及びシンボルテーブル
408内のエントリのポインタを含んでいる。下記再配
置型は、本発明に従って再配置テーブルへ追加される。
FIG. 9 is an example of a relocation table according to an embodiment of the present invention. Relocation table 412 contains a list of relocations to be performed by the appropriate linker at link time. Each entry in relocation table 412 includes the relocation type, the address of either the instruction or the data element that needs to be relocated, and a pointer to the entry in symbol table 408. The following relocation types are added to the relocation table according to the present invention.

【表6】 [Table 6]

【0031】本発明の各種実施形態を上述したが、これ
らは例示としてのみ与えられるものであって限定するも
のではないことを理解しなければならない。そこで、本
発明の外延と適用範囲は上述の実施形態のいずれかによ
り限定されるものではなく、特許請求の範囲及びその等
価物にしたがってのみ定義されるべきである。
While various embodiments of the present invention have been described above, it should be understood that they have been presented by way of example only, and not limitation. Thus, the breadth and scope of the present invention should not be limited by any of the above-described embodiments, but should be defined only in accordance with the following claims and their equivalents.

【0032】[0032]

【発明の効果】本発明によれば、プログラムの実行の開
始前に所定の選択された値にセットされる必要があるグ
ローバル変数を格納するためのレジスタが初期化され
る。
According to the present invention, prior to the start of execution of a program, a register for storing a global variable which needs to be set to a predetermined selected value is initialized.

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

【図1】本発明の好適実施形態にしたがうコンパイルデ
ータフローの図である。
FIG. 1 is a diagram of a compiled data flow according to a preferred embodiment of the present invention.

【図2】本発明の好適実施形態によるコンピュータシス
テムのブロック図である。
FIG. 2 is a block diagram of a computer system according to a preferred embodiment of the present invention.

【図3】本発明に関連して使用されるリンカプロセスの
フローチャートである。
FIG. 3 is a flowchart of a linker process used in connection with the present invention.

【図4】本発明の一実施形態によるリンカプロセスのフ
ローチャートである。
FIG. 4 is a flowchart of a linker process according to one embodiment of the present invention.

【図5】本発明の好適実施形態にしたがうコンパイラに
より生成されたオブジェクトファイルのブロック図であ
る。
FIG. 5 is a block diagram of an object file generated by a compiler according to a preferred embodiment of the present invention.

【図6】本発明の好適実施形態にしたがうコンパイル/
リンクプロセスのフローチャートである。
FIG. 6 shows a compile / process according to a preferred embodiment of the present invention.
It is a flowchart of a link process.

【図7】本発明の好適実施形態にしたがうリンクプロセ
スの詳細フローチャートである。
FIG. 7 is a detailed flowchart of a link process according to a preferred embodiment of the present invention;

【図8】本発明の好適実施形態にしたがうコンパイラに
より生成されたシンボルテーブルの一例を示す図であ
る。
FIG. 8 is a diagram illustrating an example of a symbol table generated by a compiler according to a preferred embodiment of the present invention.

【図9】本発明の一実施形態による再配置テーブルを示
す図である。
FIG. 9 is a diagram showing a relocation table according to an embodiment of the present invention.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 ロドリック・アイソン・エバンス アメリカ合衆国 94025 カリフォルニア 州 メンロパーク アルボアロード 252 (72)発明者 ミカエル・エス・ウォーカー アメリカ合衆国 94022 カリフォルニア 州 ロスアルトス ロスニノスウェイ 638 ────────────────────────────────────────────────── ─── Continuing on the front page (72) Inventor Rodrick Isson Evans United States 94025 Menlo Park, Arboa Road, California 252 (72) Inventor Michael S. Walker United States 94022 Los Altos, Los Angeles Los Angeles 638 California

Claims (18)

【特許請求の範囲】[Claims] 【請求項1】 ソースファイルをコンパイル及びリンク
する方法であって、 コンパイラにより、前記ソースファイル内で参照される
グローバル変数に関係するグローバルレジスタ情報を生
成するステップと、 前記コンパイラにより、前記ソースファイルから前記グ
ローバルレジスタ情報を備えるオブジェクトファイルを
生成するステップと、 変数衝突を識別し再配置演算を実行するために、前記オ
ブジェクトファイルに含まれるグローバルレジスタ情報
を用いて、実行可能ファイルを生成するステップと、を
備えた方法。
1. A method of compiling and linking a source file, comprising: generating global register information relating to global variables referenced in the source file by a compiler; Generating an object file comprising the global register information; generating an executable file using the global register information included in the object file to identify variable collisions and perform a relocation operation; Method with.
【請求項2】 請求項1記載の方法であって、前記実行
可能ファイルを生成するために、前記オブジェクトファ
イルを他のオブジェクトファイルにリンクするステップ
を含む方法。
2. The method of claim 1, comprising linking the object file to another object file to generate the executable file.
【請求項3】 請求項1記載の方法であって、前記実行
可能ファイルを生成するために、前記オブジェクトファ
イルを共有ライブラリにリンクするステップを含む方
法。
3. The method of claim 1, comprising linking the object file to a shared library to generate the executable file.
【請求項4】 請求項1記載の方法であって、 前記ソースファイル内で参照される各シンボル毎にシン
ボルエントリを備えるシンボルテーブルを生成するステ
ップであって、該各シンボルエントリが、シンボル型を
識別するための情報を備えるシンボル型フィールド、及
び前記シンボル型の値の記憶を可能とする値フィールド
を含むものを備えた方法。
4. The method according to claim 1, further comprising: generating a symbol table having a symbol entry for each symbol referenced in the source file, wherein each symbol entry has a symbol type. A method comprising: a symbol type field with information for identification; and a value field enabling storage of a value of said symbol type.
【請求項5】 請求項4記載の方法であって、 前記シンボルテーブルからシンボルエントリを選択する
ステップと、 前記選択されたシンボルエントリのシンボル型に含まれ
る情報を識別することにより、前記選択されたシンボル
エントリのシンボル型の値を判断するステップと、 前記選択されたシンボルエントリの前記値フィールド
に、前記値を格納するステップと、を備えた方法。
5. The method of claim 4, wherein selecting the symbol entry from the symbol table; and identifying information included in a symbol type of the selected symbol entry, the selected symbol entry. Determining a symbol type value of a symbol entry; and storing the value in the value field of the selected symbol entry.
【請求項6】 請求項5記載の方法であって、 複数の再配置エントリを備える再配置テーブルを生成す
るステップであって、前記再配置エントリのそれぞれ
が、再配置型を識別する情報を備える再配置型フィール
ド、再配置で必要とされる前記オブジェクトファイル内
の命令及びデータのうちの一つのアドレスを備えるアド
レスフィールド、及び前記シンボルテーブル内の特定の
シンボルエントリへのポインタを含み、前記特定のシン
ボルエントリが、前記特定のシンボルエントリの前記シ
ンボル型フィールド及び値フィールドに含まれる情報に
より示されるシンボル型のものであるもの、を更に備え
る方法。
6. The method of claim 5, wherein generating a relocation table comprising a plurality of relocation entries, wherein each of the relocation entries comprises information identifying a relocation type. A relocation type field, an address field including an address of one of instructions and data in the object file required for relocation, and a pointer to a specific symbol entry in the symbol table. The method further comprising: wherein the symbol entry is of a symbol type indicated by information contained in the symbol type and value fields of the particular symbol entry.
【請求項7】 請求項6記載の方法であって、 前記再配置テーブル内の前記再配置エントリにしたがっ
てリンカを用いて再配置演算を実行するステップを更に
備えた方法。
7. The method of claim 6, further comprising performing a relocation operation using a linker according to the relocation entry in the relocation table.
【請求項8】 ソースファイルをコンパイル及びリンク
するシステムであって、 前記ソースファイル内で参照されるグローバル変数に関
係する情報を生成する情報生成手段を備えるコンパイラ
と、 前記ソースファイルから前記情報を備えるオブジェクト
ファイルを生成するよう構成されたオブジェクトファイ
ル生成手段と、 シンボル衝突を識別し再配置演算を実行するために、前
記オブジェクトファイルに含まれる前記情報を用いるよ
う構成されたリンカと、を備えたシステム。
8. A system for compiling and linking a source file, comprising: a compiler including information generating means for generating information related to a global variable referred to in the source file; and providing the information from the source file. A system comprising: an object file generating means configured to generate an object file; and a linker configured to use the information contained in the object file to identify symbol collisions and perform a relocation operation. .
【請求項9】 請求項8記載のシステムであって、 ソースファイル内の参照に関連付けられた適切なシンボ
ルのためのシンボルエントリを備えるシンボルテーブル
を生成するよう構成された生成機構であって、各シンボ
ルエントリが、シンボル型を識別する情報を備えるシン
ボル型フィールド、及び前記シンボル型の値を備える値
フィールドを含むもの、を更に備えるシステム。
9. The system of claim 8, wherein the generating mechanism is configured to generate a symbol table comprising a symbol entry for an appropriate symbol associated with a reference in the source file. The system wherein the symbol entry further comprises: a symbol type field comprising information identifying the symbol type; and a value field comprising a value of the symbol type.
【請求項10】 請求項9記載のシステムであって、前
記リンカが、 シンボル型の値を判断するよう構成された判断機構と、 前記選択されたシンボルエントリの前記値フィールド内
に、前記値を格納する手段と、を備えたシステム。
10. The system of claim 9, wherein the linker is configured to determine a value of a symbol type, and the linker stores the value in the value field of the selected symbol entry. Means for storing.
【請求項11】 請求項10記載のシステムであって、 複数の再配置エントリを備える再配置テーブルを生成す
るよう構成された生成機構であって、前記再配置エント
リのそれぞれが、再配置型を識別する情報を備える再配
置型フィールド、再配置で必要とされる前記オブジェク
トファイル内の命令及びデータのうちの一つのアドレス
を備えるアドレスフィールド、及び前記シンボルテーブ
ル内の特定のシンボルエントリへのポインタを含み、前
記特定のシンボルエントリが、シンボルエントリに含ま
れる情報により示されるシンボル型のものであるもの、
を更に備えるシステム。
11. The system according to claim 10, wherein the generation mechanism is configured to generate a relocation table including a plurality of relocation entries, wherein each of the relocation entries has a relocation type. A relocation type field having identifying information, an address field having an address of one of instructions and data in the object file required for relocation, and a pointer to a specific symbol entry in the symbol table. Wherein the specific symbol entry is of a symbol type indicated by information included in the symbol entry;
A system further comprising:
【請求項12】 請求項11記載のシステムであって、 前記リンカが、前記再配置エントリにしたがって再配置
演算を実行するよう構成された再配置演算子を備えたシ
ステム。
12. The system of claim 11, wherein the linker comprises a relocation operator configured to perform a relocation operation according to the relocation entry.
【請求項13】 請求項8記載のシステムであって、 前記リンカが、実行可能ファイルを生成するために、前
記オブジェクトファイルを他のオブジェクトファイルに
リンクするよう構成されているシステム。
13. The system of claim 8, wherein the linker is configured to link the object file with another object file to generate an executable file.
【請求項14】 請求項8記載のシステムであって、 前記リンカが、実行可能ファイルを生成するために、前
記オブジェクトファイルを共有ライブラリにリンクする
よう構成されているシステム。
14. The system of claim 8, wherein the linker is configured to link the object file to a shared library to generate an executable.
【請求項15】 コンピュータシステムがソースファイ
ルをコンパイル及びリンクできるようにするコンピュー
タプログラムロジックを記録したコンピュータ読み取り
可能媒体を備えるコンピュータプログラム製品であっ
て、 コンパイル時において、前記ソースファイル内で参照さ
れるグローバル変数に関係する情報を、前記コンピュー
タシステムが生成できるようにするシンボル情報生成機
構と、 コンパイル時において、前記ソースファイルからオブジ
ェクトファイルを、前記コンピュータシステムが生成で
きるようにするオブジェクトファイル生成機構と、 リンク時において、前記コンピュータシステムが、前記
オブジェクトファイルを存在する他のオブジェクトファ
イル又は共有ライブラリとリンクして、実行可能ファイ
ルを生成できるようにするリンク機構であって、シンボ
ル衝突を解消し再配置演算を実行するために、前記オブ
ジェクトファイル内に含まれる前記情報を利用する手段
を備えるものと、を備えたコンピュータプログラム製
品。
15. A computer program product comprising a computer readable medium having computer program logic recorded thereon for enabling a computer system to compile and link a source file, wherein at compile time a global program referenced in the source file is provided. A symbol information generation mechanism for enabling the computer system to generate information relating to variables; an object file generation mechanism for enabling the computer system to generate an object file from the source file at compile time; At times, the computer system can link the object file with other existing object files or shared libraries to produce an executable file. A link mechanism for resolving symbol collisions and performing a rearrangement operation, the link mechanism including means for using the information included in the object file.
【請求項16】 プロセッサと、前記プロセッサが、ソ
ースファイルをコンパイルしリンクできるようにするコ
ントローラを備えたコンピュータシステムであって、前
記コントローラが、 コンパイル時において、前記ソースファイル内で参照さ
れるグローバル変数に関係する情報を、前記プロセッサ
が生成できるようにするシンボル情報生成機構と、 コンパイル時において、前記ソースファイルから、前記
情報を備えるオブジェクトファイルを、前記プロセッサ
が生成できるようにするオブジェクトファイル生成手段
と、 実行可能ファイルを生成するために、リンク時におい
て、前記プロセッサが、前記オブジェクトファイルを他
のオブジェクトファイル及び共有ライブラリの少なくと
も一つとリンクできるようにするリンカであって、シン
ボル衝突を識別し、再配置演算を実行するために、前記
オブジェクトファイルに含まれる前記情報を利用する手
段を備えたものと、を備えたコンピュータシステム。
16. A computer system comprising: a processor; and a controller that enables the processor to compile and link a source file, the controller comprising, at compile time, a global variable referenced in the source file. A symbol information generation mechanism that enables the processor to generate information related to the object; and an object file generation unit that enables the processor to generate an object file including the information from the source file at the time of compilation. A linker enabling the processor to link the object file with at least one of another object file and a shared library at link time to generate an executable file, the linker comprising: Means for utilizing the information contained in the object file to identify a bol collision and perform a relocation operation.
【請求項17】 プロセッサがソースファイルをコンパ
イルしリンクできるようにするコントローラであって、 コンパイル時において、前記ソースファイル内で参照さ
れるグローバルシンボルに関係する情報を、前記プロセ
ッサが生成できるようにする情報生成手段と、 コンパイル時において、前記ソースファイルから、前記
情報を備えるオブジェクトファイルを、前記プロセッサ
が生成できるようにするオブジェクトファイル生成手段
と、 実行可能ファイルを生成するために、リンク時におい
て、前記プロセッサが、前記オブジェクトファイルを他
のオブジェクトファイル及び共有ライブラリの少なくと
も一つとリンクできるようにするリンク手段であって、
シンボル衝突を識別し、再配置演算を実行するために、
前記オブジェクトファイルに含まれる前記情報を利用す
る手段を備えたものと、を備えるコントローラ。
17. A controller that enables a processor to compile and link a source file, wherein the processor can generate, at compile time, information relating to global symbols referenced in the source file. An information generating means, an object file generating means for enabling the processor to generate an object file having the information from the source file at the time of compiling, and an object file generating means for generating an executable file. Link means for enabling the processor to link the object file with at least one of another object file and a shared library,
To identify symbol collisions and perform relocation operations,
A means for using the information contained in the object file.
【請求項18】 ソースファイルをコンパイル及びリン
クするためのシステムであって、 前記ソースファイル内で参照されるグローバル変数に関
係する情報を生成する情報生成手段を備えたコンパイラ
と、 前記ソースファイルから、前記情報を備えるオブジェク
トファイルを生成するオブジェクトファイル生成手段
と、 実行可能ファイルを生成するために、前記オブジェクト
ファイルを、存在する他のオブジェクトファイル及び共
有ライブラリにリンクするリンカであって、シンボル衝
突を識別し、再配置演算を実行するために、前記オブジ
ェクトファイルに含まれる前記情報を利用する手段を備
えたものと、を備えるシステム。
18. A system for compiling and linking a source file, comprising: a compiler having information generating means for generating information related to a global variable referred to in the source file; Object file generating means for generating an object file comprising said information; and a linker for linking said object file to other existing object files and a shared library to generate an executable file, wherein said linker identifies symbol collisions. And means for utilizing the information contained in the object file to perform a relocation operation.
JP11146389A 1998-05-29 1999-05-26 Global register system, method and computer program product Pending JP2000010792A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
AU43238/99A AU4323899A (en) 1998-05-29 1999-05-28 Global register systems, methods, and computer program products
PCT/US1999/012063 WO1999061970A2 (en) 1998-05-29 1999-05-28 Global register systems, methods, and computer program products

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US8735298P 1998-05-29 1998-05-29
US09/087352 1998-05-29

Publications (1)

Publication Number Publication Date
JP2000010792A true JP2000010792A (en) 2000-01-14

Family

ID=22204680

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11146389A Pending JP2000010792A (en) 1998-05-29 1999-05-26 Global register system, method and computer program product

Country Status (1)

Country Link
JP (1) JP2000010792A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017047662A (en) * 2015-09-04 2017-03-09 株式会社ソディック Injection molding machine
CN110688320A (en) * 2019-09-30 2020-01-14 潍柴动力股份有限公司 Detection method, device and terminal device for global variable

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017047662A (en) * 2015-09-04 2017-03-09 株式会社ソディック Injection molding machine
CN110688320A (en) * 2019-09-30 2020-01-14 潍柴动力股份有限公司 Detection method, device and terminal device for global variable
CN110688320B (en) * 2019-09-30 2023-05-23 潍柴动力股份有限公司 Detection method, device and terminal equipment of global variables

Similar Documents

Publication Publication Date Title
US6298479B1 (en) Method and system for compiling and linking source files
EP0752647B1 (en) Method and apparatus for internal versioning of objects using a map file
KR100518584B1 (en) Shared library system and method for constructing the system
US5481713A (en) Method and apparatus for patching code residing on a read only memory device
US9436457B2 (en) Generating and applying patches to computer program code concurrently with its execution
US5546586A (en) Method and apparatus for vectorizing the contents of a read only memory device without modifying underlying source code
US6351848B1 (en) Unitary data structure systems, methods, and computer program products, for global conflict determination
US20030088860A1 (en) Compiler annotation for binary translation tools
US20040003388A1 (en) Preparation of a software configuration using an XML type programming language
US9378008B2 (en) Method and system for creating, applying, and removing a software fix
JP2002527815A (en) Program code conversion method
JPH08179940A (en) Method and computer system for debugging computer application programs
JPH06266683A (en) Parallel processor
JPH05224948A (en) Method and system for processing computer program
US7913243B2 (en) Method and system for generating and applying patches to a computer program concurrently with its execution
US7593791B2 (en) Method and device for adaptation of functions for controlling operating sequences
JPH0926884A (en) Method and apparatus for making necessary flow information available during tasks requiring binary operations
US7457927B2 (en) Memory dump of a computer system
US6026242A (en) Methods, computer program products, and apparatus for initializing global registers
US20020087956A1 (en) System and method for linear processing of software modules
US20010054177A1 (en) Information processing apparatus
CN115700470A (en) File loading processing method and device, computer storage medium and electronic equipment
EP1672488A2 (en) Compile time linking via hashing technique
JP2000010792A (en) Global register system, method and computer program product
WO1999061970A2 (en) Global register systems, methods, and computer program products