JPH10283194A - Program linkage editor method and machine readable record medium recording program linkage editor program - Google Patents

Program linkage editor method and machine readable record medium recording program linkage editor program

Info

Publication number
JPH10283194A
JPH10283194A JP8520797A JP8520797A JPH10283194A JP H10283194 A JPH10283194 A JP H10283194A JP 8520797 A JP8520797 A JP 8520797A JP 8520797 A JP8520797 A JP 8520797A JP H10283194 A JPH10283194 A JP H10283194A
Authority
JP
Japan
Prior art keywords
section
global pointer
program
global
pointer
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
JP8520797A
Other languages
Japanese (ja)
Inventor
Akira Yokozawa
彰 横澤
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP8520797A priority Critical patent/JPH10283194A/en
Publication of JPH10283194A publication Critical patent/JPH10283194A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PROBLEM TO BE SOLVED: To reduce the number of instructions which are needed for access by having an inherent global pointer in each task. SOLUTION: An assembler program is inputted (S101), a list of global pointers which are used in a global pointer section is generated (S102), an offset to a label is decided for each section of the global pointer section (S103), the size of each section is decided in each section (S104), plural sections that are related to each global pointer are continuously arranged and a leading address of the section is decided (S105), the value of each global pointer is decided (S106), an address and an offset based on a relocation address are generated and the relocation address is calculated (S107), and a generated executable object is outputted (S108).

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、プログラム結合編
集方法及びプログラム結合編集プログラムを記録した機
械読み取り可能な記録媒体に関し、特に、一括して結合
編集するプログラム作成において、タスク毎に固有のグ
ローバルポインタを持つことを可能にする技術に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program combination editing method and a machine-readable recording medium recording a program combination editing program. Technology that makes it possible to have

【0002】[0002]

【従来の技術】論理アドレス空間の一部のオペランドア
クセスが、少ない命令数で可能になっている場合に、マ
ルチタスクのタスクが各々固有のグローバルポインタを
持つことにより、総命令数の削減を可能にすることがで
きるマイコンのアーキテクチャが従来から知られてい
る。このような特徴をもつマイコンの例としては、MI
PSアーキテクチャがある(参考文献:Erin Farquhar
and Philip Bunce "The MIPS Programmer's Handbook",
1994 )。
2. Description of the Related Art When a part of the logical address space can be accessed with a small number of instructions, the total number of instructions can be reduced by each multitask task having a unique global pointer. A microcomputer architecture that can be used is conventionally known. An example of a microcomputer having such characteristics is MI
There is a PS architecture (Reference: Erin Farquhar
and Philip Bunce "The MIPS Programmer's Handbook",
1994).

【0003】このMIPSアーキテクチャにおける具体
的な命令の処理動作について図17を用いて説明する。
図17の右上の四角で囲まれた命令列は、32ビットの
アドレスで指定されるメモリ上の変数の値をレジスタt
0にロードする場合の命令列である。この命令列の一列
目の命令である、 lui AT,0x1234 は、即値「0x1234」(「0x」は16進表示であ
ることを示す)を「AT」なるラベルが付されたジェネ
ラルレジスタ(GR)の上位16ビットに格納する命令
である。また、2列目の命令である、 lw t0,0(AT) は、ラベル「AT」のジェネラルレジスタに格納された
値にオフセット「0」を加えた値に対応するメモリ番地
に格納された値を、ラベル「t0」のジェネラルレジス
タに格納する命令である。従って、メモリ番地「0x1
2340000」に格納された値がラベル「t0」のジ
ェネラルレジスタに格納される。
A specific instruction processing operation in the MIPS architecture will be described with reference to FIG.
The instruction sequence enclosed by the upper right square in FIG. 17 stores the value of the variable on the memory designated by the 32-bit address in the register t.
This is an instruction sequence for loading to 0. The lui AT, 0x1234, which is the first instruction in this instruction sequence, is a general register (GR) labeled with the immediate value "0x1234"("0x" indicates hexadecimal notation) and "AT". Is an instruction to be stored in the upper 16 bits. The instruction in the second column, lw t0,0 (AT), is a value stored in a memory address corresponding to a value obtained by adding an offset “0” to a value stored in a general register with a label “AT”. Is stored in the general register labeled “t0”. Therefore, the memory address “0x1
The value stored in “2340000” is stored in the general register labeled “t0”.

【0004】アセンブラのソースプログラムは、同図1
7左上の四角で囲まれた命令列の様に見かけ上1命令で
記述することができるが、機械語命令として実際に生成
されるのは、同図右上の2命令である。
The source program of the assembler is shown in FIG.
Although it can be described by one instruction apparently like an instruction sequence enclosed by a square at the upper left of FIG. 7, two instructions at the upper right of the figure are actually generated as machine language instructions.

【0005】一方、図18は、グローバルポインタを使
ってアクセスできる場合の命令の処理動作を説明するた
めの図である。図18の右上の四角で囲まれた命令列
は、32ビットのアドレスで指定されるメモリ上の変数
の値をレジスタt0にロードする場合の命令列である。
この命令列の一列目の命令である、 lui gp,0x1234 は、即値「0x1234」(「0x」は16進表示であ
ることを示す)を「gp」なるラベルが付されたジェネ
ラルレジスタ(GR)の上位16ビットに格納する命令
である。この命令は、一般的には、プログラムの最初で
定義される。また、その下に記述された命令である、 lw t0,0(gp) は、ラベル「gp」のジェネラルレジスタに格納された
値にオフセット「0」を加えた値に対応するメモリ番地
に格納された値を、ラベル「t0」のジェネラルレジス
タに格納する命令である。従って、メモリ番地「0x1
2340000」に格納された値がラベル「t0」のジ
ェネラルレジスタに格納される。
FIG. 18 is a diagram for explaining an instruction processing operation when access is possible using a global pointer. The instruction sequence enclosed by the upper right square in FIG. 18 is an instruction sequence for loading the value of the variable on the memory specified by the 32-bit address into the register t0.
Lui gp, 0x1234, which is the first instruction in this instruction sequence, is a general register (GR) labeled with the immediate value “0x1234” (“0x” indicates hexadecimal notation) and “gp”. Is an instruction to be stored in the upper 16 bits. This instruction is generally defined at the beginning of the program. The instruction described below, lw t0,0 (gp), is stored in a memory address corresponding to a value obtained by adding an offset “0” to the value stored in the general register of the label “gp”. The stored value is stored in the general register labeled “t0”. Therefore, the memory address “0x1
The value stored in “2340000” is stored in the general register labeled “t0”.

【0006】MIPSアーキテクチャでは、レジスタの
ベースアドレスから、16ビットの相対アドレスの範囲
については、このようにプログラムの最初等でグローバ
ルポインタを定義しておけば、1命令でアクセスするこ
とができるので、総命令数を減少させることができる。
In the MIPS architecture, the range of the relative address of 16 bits from the base address of the register can be accessed by one instruction by defining the global pointer at the beginning of the program as described above. The total number of instructions can be reduced.

【0007】従来、上述のようなアーキテクチャ上の特
徴を持つマイコン用の結合編集(リンケージ)方法に
は、一つの結合編集の単位において、一つのグローバル
ポインタに対応するものがあった。図19は、従来の結
合編集方法のフローチャートを示す図である。まず、再
配置可能ファイルを入力する(ステップS301)。続
いて、セクション毎に、セクション内のラベルに対し、
オフセットを決定し(ステップS302)、セクション
毎に、各セクションの大きさを決定する(ステップS3
03)。続いて、グローバルポインタに関わる複数のセ
クションを連続して配置し、セクションの先頭アドレス
を決定する(ステップS304)。続いて、グローバル
ポインタの値を決定し(ステップS305)、再配置情
報に基づくアドレスとオフセットを生成し、再配置アド
レスの計算を行う(ステップS306)。最後に、生成
された事項可能オブジェクトの出力を行う(ステップS
307)。
Conventionally, there has been a combination editing (linkage) method for a microcomputer having the above-described architectural features, which corresponds to one global pointer in one combination editing unit. FIG. 19 is a diagram showing a flowchart of a conventional combination editing method. First, a relocatable file is input (step S301). Next, for each section,
The offset is determined (step S302), and the size of each section is determined for each section (step S3).
03). Subsequently, a plurality of sections related to the global pointer are successively arranged, and the start address of the section is determined (step S304). Subsequently, the value of the global pointer is determined (step S305), an address and an offset are generated based on the relocation information, and the relocation address is calculated (step S306). Finally, the generated matter-possible object is output (step S
307).

【0008】次に、この従来法について、具体例を交え
て詳細に説明する。図20は、この従来法の具体例を説
明するために示したアセンブラプログラムを示したもの
である。
Next, this conventional method will be described in detail with specific examples. FIG. 20 shows an assembler program shown to explain a specific example of the conventional method.

【0009】同図(a)及び(b)に記述された、.s
bss擬似命令は、グローバルポインタを利用して参照
される初期値なし変数を宣言する。例えば、同図(a)
に示された「.sbss a,4」は、aというラベル
に4バイトの領域を割り当てる旨の命令である。一
方、.sdata擬似命令は、グローバルポインタを利
用して参照される初期値あり変数を宣言する。例えば、
同図(a)に示された「.sdata x .word
0」は、xというラベルに1ワード(4バイト)の領
域を割り当て、その初期値を0にする旨の命令である。
In FIG. 1A and FIG. s
The bss pseudo-instruction declares a variable without an initial value that is referenced using a global pointer. For example, FIG.
".Sbss a, 4" shown in (1) is an instruction to allocate a 4-byte area to the label a. on the other hand,. The sdata pseudo-instruction declares a variable with an initial value that is referenced using a global pointer. For example,
".Sdata x .word" shown in FIG.
"0" is an instruction for allocating an area of one word (4 bytes) to the label x and setting its initial value to 0.

【0010】また、.textセクションは命令のオペ
ランドとして、グローバルポインタからのオフセットを
計算するためのマクロとして、%gpoffs(lab
el)が設けられている。これは、最終的な結合編集時
に、結合編集プログラムが値を確定するラベルと、上
記.gpsection疑似命令で割り当てられた名前
のセクション内に割り付けられた変数との相対オフセッ
トを求めるためのマクロである。
In addition,. The text section is a macro for calculating an offset from a global pointer as an operand of an instruction, and% gpoffs (lab
el) is provided. This is because the label for which the combination editing program determines the value at the time of the final combination editing and the. This is a macro for calculating a relative offset with respect to a variable allocated in a section having a name allocated by the gpsection pseudo instruction.

【0011】同図(a)及び(b)に示した2つのプロ
グラムについて、従来法による結合編集について説明す
る。まず、ステップS301にて図20に示した再配置
可能ファイルを入力する。ここで、再配置可能(relocat
able) とは、番地指定部を、後の結合編集処理時にアド
レス計算が可能な修飾情報を付加した形で表現した形式
をいう。
A description will be given of a conventional method of combining and editing two programs shown in FIGS. First, in step S301, the relocatable file shown in FIG. 20 is input. Here, relocatable (relocat
"able" means a format in which the address designation part is expressed in a form to which modification information that enables address calculation is added at the time of the subsequent link editing processing.

【0012】続いて、ステップS302にて、入力され
たファイルに記述されたセクション毎に、セクション内
のラベルに対してオフセットを決定する。図20(a)
に示したアセンブラプログラムでは、「x」がラベルと
して記述されている。また、同図(b)に示したアセン
ブラプログラムでは、「y」がラベルとして記述されて
いる。まず、この「x」については、セクションを「s
data」とし、オフセットを「0」とする。図21
(a)には、これを理解の容易ならしめるのため示し
た。同様に、「y」についても、セクションを「sda
ta」とし、オフセットを「0」とする。図21(c)
には、これを理解の容易ならしめるのため示した。
Subsequently, in step S302, an offset is determined for a label in the section for each section described in the input file. FIG. 20 (a)
In the assembler program shown in (1), "x" is described as a label. Further, in the assembler program shown in FIG. 2B, “y” is described as a label. First, for this "x", the section is "s
data ”and the offset is“ 0 ”. FIG.
(A) shows this for easy understanding. Similarly, for “y”, the section is “sda
ta ”, and the offset is“ 0 ”. FIG. 21 (c)
This is shown here to make it easier to understand.

【0013】続いて、ステップS303にて、セクショ
ン毎に、各セクションの大きさを決定する。図21
(b)は、図20(a)における.sdataセクショ
ンの大きさについて、また、図21(d)は、図20
(b)における.sdataセクションの大きさについ
て決定したものである。このように、両セクション共に
1ワードで変数が定義されているので、4バイトの大き
さであることがわかる。また、図21(e)は、図20
(a)における.sbssセクションのラベル「a」の
大きさについて、また、図21(f)は、図20(b)
における.sbssセクションのラベル「a」の大きさ
について決定したものである。このように、両セクショ
ン共に4バイトの大きさであるということがわかる。
Subsequently, in step S303, the size of each section is determined for each section. FIG.
FIG. FIG. 21D shows the size of the sdata section, and FIG.
In (b). The size of the sdata section is determined. As described above, since the variables are defined by one word in both sections, it is understood that the size is 4 bytes. Further, FIG.
In (a). FIG. 21F shows the size of the label “a” in the sbss section, and FIG.
At. This is determined for the size of the label “a” in the sbss section. Thus, it can be seen that both sections are 4 bytes in size.

【0014】続いて、ステップS304にて、各グロー
バルポインタに関わる複数のセクションを連続して配置
し、セクションの先頭アドレスを決定し、ステップS3
05にて、各グローバルポインタの値を決定し、ステッ
プS306にて、再配置情報に基づくアドレスとオフセ
ットを生成し、再配置アドレスの計算を行う。
Subsequently, in step S304, a plurality of sections relating to each global pointer are successively arranged, the start address of the section is determined, and in step S3
At 05, the value of each global pointer is determined, and at step S306, an address and an offset based on the relocation information are generated, and the relocation address is calculated.

【0015】このようにして結合編集されると、メモリ
上には図22に示すの如く配置される。図22は、図2
0(a)及び(b)を結合編集してメモリに配置した場
合を説明するための図である。ここで、.sbssセク
ションと.sdataセクションに、初期値なし変数と
初期値あり変数がそれぞれ配置される。しかも、.sb
ss セクションと.sdataセクションは、連続し
て配置される。これらのセクションのアドレス割りつけ
が完了すると、結合編集プログラムは、シンボル_gp
に、.sbssセクションの先頭から32KBの位置の
アドレスを割り付ける。その後、結合編集プログラム
は、.textセクション内の命令オペランド中の、&
gpoffsマクロに対応するオフセットの計算を行
い、最終的な機械語命令を生成する。
[0015] After being combined and edited in this manner, it is arranged on the memory as shown in FIG. FIG. 22 shows FIG.
It is a figure for explaining the case where 0 (a) and (b) are combined and edited and arranged in the memory. here,. sbss section and. In the sdata section, variables without initial values and variables with initial values are respectively arranged. Moreover,. sb
ss section and. The sdata section is arranged continuously. When the address allocation of these sections is completed, the link editing program executes the symbol_gp
, An address at a position of 32 KB from the head of the sbss section is allocated. After that, the combined editing program: & in the instruction operand in the text section
The offset corresponding to the gpoffs macro is calculated, and a final machine language instruction is generated.

【0016】このように、従来の結合編集方法は、グロ
ーバルポインタを利用して参照されるデータが属するセ
クションを決めておき、結合編集時に、そのセクション
の大きさと最終的に配置されるアドレスが決定した後
に、グローバルポインタの初期値が収められる約束にな
っているシンボルの初期値を決定し、その後そのグロー
バルポインタを参照するメモリアクセス命令のオフセッ
ト値を決定するものというものであった。
As described above, in the conventional combined editing method, the section to which the data to be referred to belongs is determined by using the global pointer, and the size of the section and the finally arranged address are determined during the combined editing. After that, the initial value of the symbol which is the promise of storing the initial value of the global pointer is determined, and then the offset value of the memory access instruction referring to the global pointer is determined.

【0017】[0017]

【発明が解決しようとする課題】しかしながら、従来の
結合編集方法では、結合編集単位の中に、グローバルポ
インタを利用して参照されるデータセクションを一つし
か設ける事が出来ない。
However, in the conventional combined editing method, only one data section referred to by using the global pointer can be provided in the combined editing unit.

【0018】マルチタスク・オペレーティング・システ
ムを利用してアプリケーションプログラムを作成する場
合、タスク毎に固有のグローバルポインタを持たせ、タ
スク切替えの際に、グローバルポインタの値を、そのタ
スクに対応する値に変更するようにすることにより、ア
クセスに必要な命令数を削減することが可能な場合があ
る。特に、このようなデータの容量が、すべてのタスク
で一つのグローバルポインタを共有する方法では、アー
キテクチャに制限される最大容量を超えてしまう場合に
有効である。従来の結合編集方式では、結合編集単位の
中に複数のグローバルポインタを持たせるプログラムを
作成することが困難であった。
When an application program is created using a multitasking operating system, a unique global pointer is provided for each task, and when switching tasks, the value of the global pointer is changed to a value corresponding to the task. In some cases, the number of instructions required for access can be reduced by making the change. In particular, the method of sharing one global pointer for all tasks with such a data capacity is effective when the data exceeds the maximum capacity limited by the architecture. In the conventional combined editing method, it is difficult to create a program that has a plurality of global pointers in a combined edit unit.

【0019】本発明は上記事情に鑑みて成されたもので
あり、その目的とするところは、一括して結合編集する
プログラム作成において、タスク毎に固有のグローバル
ポインタを持つことを可能にすることにより、アクセス
に必要な命令数を削減することができるプログラム結合
編集方法及びプログラム結合編集プログラムを記録した
機械読み取り可能な記録媒体を提供することにある。
The present invention has been made in view of the above circumstances, and an object of the present invention is to make it possible to have a unique global pointer for each task in the creation of a program for linking and editing all at once. Accordingly, it is an object of the present invention to provide a program combination editing method and a machine readable recording medium recording a program combination editing program which can reduce the number of instructions required for access.

【0020】[0020]

【課題を解決するための手段】上記目的を達成するた
め、請求項1の発明は、グローバルポインタセクション
を含む複数のアセンブラソースプログラムに対して結合
編集を行うプログラムの結合編集方法であって、前記グ
ローバルポインタセクションに対して、初期値なしデー
タと、初期値ありデータを各グローバルセクション毎に
個別に配置し、前記複数のアセンブラソースプログラム
に含まれる各々のグローバルポインタセクションに固有
のグローバルポインタが設けられた実行可能オブジェク
トを出力することを特徴とする。
According to a first aspect of the present invention, there is provided a method for connecting and editing a plurality of assembler source programs including a global pointer section. For the global pointer section, data without an initial value and data with an initial value are individually arranged for each global section, and a unique global pointer is provided for each global pointer section included in the plurality of assembler source programs. Outputting the executable object.

【0021】一般に、結合編集単位が大きく、全体で一
つのグローバルポインタセクションしか使用できない場
合には、すべての変数をグローバルポインタセクション
に収める事ができない場合がある。上記発明の構成によ
れば、マルチタスクプログラムに代表されるように、プ
ログラムの中のサブモジュール間の独立性が高い場合
に、タスク毎に固有のグローバルポインタを持たせ、各
々のタスク毎に使用頻度の高い変数をそれぞれのグロー
バルポインタでアクセスできるように配置することが可
能になり、全体としての命令数の削減が達成できる。
In general, when the unit of combined editing is large and only one global pointer section can be used as a whole, it may not be possible to store all variables in the global pointer section. According to the configuration of the present invention, when the independence between sub-modules in a program is high, as represented by a multi-task program, a unique global pointer is provided for each task and used for each task. Frequent variables can be arranged so that they can be accessed by their global pointers, and the number of instructions as a whole can be reduced.

【0022】また、請求項2の発明は、グローバルポイ
ンタセクションを含む複数のアセンブラソースプログラ
ムに対して結合編集を行うプログラムの結合編集方法で
あって、前記アセンブラソースプログラムに指定された
前記複数のグローバルポインタセクションに係るグロー
バルポインタの値からの相対オフセットを求め、この相
対オフセット値を用いて前記各々のグローバルポインタ
セクション内のアドレス計算を行い、初期値なしデータ
と初期値ありデータとが各グローバルポインタセクショ
ン毎に個別に配置され、前記複数のアセンブラソースプ
ログラムに含まれる各々のグローバルポインタセクショ
ンに固有のグローバルポインタが設けられた実行可能オ
ブジェクトを出力することを特徴とする。
According to a second aspect of the present invention, there is provided a method of connecting and editing a plurality of assembler source programs including a global pointer section, wherein the plurality of global programs specified in the assembler source program are combined. A relative offset from the value of the global pointer relating to the pointer section is obtained, and an address in each of the global pointer sections is calculated using the relative offset value. And outputting an executable object provided with a global pointer unique to each global pointer section included in the plurality of assembler source programs.

【0023】上記発明の構成によれば、マルチタスクプ
ログラムに代表されるように、プログラムの中のサブモ
ジュール間の独立性が高い場合に、タスク毎に固有のグ
ローバルポインタを持たせ、各々のタスク毎に使用頻度
の高い変数をそれぞれのグローバルポインタでアクセス
できるように配置することが可能になり、全体としての
命令数の削減が達成できる。
According to the configuration of the present invention, when the independence between sub-modules in a program is high, as represented by a multitask program, each task has a unique global pointer, and each task has a unique global pointer. Variables that are frequently used can be arranged so that they can be accessed by the respective global pointers, so that the total number of instructions can be reduced.

【0024】また、請求項3の発明は、複数のグローバ
ルポインタセクションを含むアセンブラソースプログラ
ムに対して結合編集を行うプログラムの結合編集方法で
あって、前記アセンブラソースプログラムに指定された
前記複数のグローバルポインタセクションに係るグロー
バルポインタの値からの相対オフセットを求め、この相
対オフセット値を用いて前記各々のグローバルポインタ
セクション内のアドレス計算を行い、初期値なしデータ
と初期値ありデータとが各グローバルポインタセクショ
ン毎に個別に配置され、前記複数のアセンブラソースプ
ログラムに含まれる各々のグローバルポインタセクショ
ンに固有のグローバルポインタが設けられた実行可能オ
ブジェクトを出力することを特徴とする。
According to a third aspect of the present invention, there is provided a combined editing method of a program for performing combined editing on an assembler source program including a plurality of global pointer sections, wherein the plurality of global pointers specified in the assembler source program are combined. A relative offset from the value of the global pointer relating to the pointer section is obtained, and an address in each of the global pointer sections is calculated using the relative offset value. And outputting an executable object provided with a global pointer unique to each global pointer section included in the plurality of assembler source programs.

【0025】一つのタスクで扱うデータが大きい場合で
も、部分ごとに変数に対する参照の頻度が異なる場合に
は、部分ごとにグローバルポインタを入れ換えてアクセ
スすることにより、命令数の削減が可能な場合がある。
上記発明の構成によれば、このようなプログラムの結合
編集が可能になる。
Even if the data handled by one task is large, if the frequency of reference to the variable differs for each part, the number of instructions can be reduced by replacing the global pointer for each part and accessing. is there.
According to the configuration of the present invention, such a program can be combined and edited.

【0026】また、請求項4の発明は、グローバルポイ
ンタセクションを含む複数のアセンブラソースプログラ
ムに対して結合編集を行うプログラムの結合編集方法で
あって、前記アセンブラソースプログラムに指定された
前記複数のグローバルポインタセクションに係る複数の
グローバルポインタの値からの相対オフセットを求め、
この相対オフセット値を用いて前記各々のグローバルポ
インタセクション内のアドレス計算を行い、初期値なし
データと初期値ありデータとが各グローバルポインタセ
クション毎に個別に配置され、前記複数のアセンブラソ
ースプログラムに含まれる各々のグローバルポインタセ
クションに固有のグローバルポインタが設けられた実行
可能オブジェクトを出力することを特徴とする。
According to a fourth aspect of the present invention, there is provided a method for connecting and editing a plurality of assembler source programs including a global pointer section, wherein the plurality of assembler source programs include a global pointer section. Find relative offsets from the values of the global pointers related to the pointer section,
An address in each of the global pointer sections is calculated using the relative offset value, and data without an initial value and data with an initial value are individually arranged for each global pointer section, and are included in the plurality of assembler source programs. And outputting an executable object provided with a unique global pointer for each global pointer section.

【0027】タスクをいくつかの部分に分けても、扱う
データのサイズが一つのグローバルポインタセクション
に収まらない場合でも、グローバルポインタとしてレジ
スタを複数割り当てることで、命令数の削減が可能な場
合がある。上記発明の構成によれば、このようなプログ
ラムの結合編集が可能になる。
Even if the task is divided into several parts, even if the size of the data to be handled does not fit in one global pointer section, the number of instructions may be reduced by allocating a plurality of registers as global pointers. . According to the configuration of the present invention, such a program can be combined and edited.

【0028】また、請求項5の発明は、グローバルポイ
ンタセクションを含む複数のアセンブラソースプログラ
ムに対して結合編集を行うプログラムの結合編集方法で
あって、前記グローバルポインタセクション内のラベル
に対して、前記アセンブラソースプログラムに指定され
た前記複数のグローバルポインタセクションに係るグロ
ーバルポインタの値からのオフセットを求め、初期値な
しデータと初期値ありデータとが各グローバルポインタ
セクション毎に個別に配置され、前記複数のアセンブラ
ソースプログラムに含まれる各々のグローバルポインタ
セクションに固有のグローバルポインタが設けられた実
行可能オブジェクトを出力することを特徴とする。
According to a fifth aspect of the present invention, there is provided a method for connecting and editing a plurality of assembler source programs including a global pointer section, the method comprising: Calculating an offset from a value of a global pointer relating to the plurality of global pointer sections specified in the assembler source program; data without an initial value and data with an initial value are individually arranged for each global pointer section; An executable object in which a unique global pointer is provided for each global pointer section included in the assembler source program is output.

【0029】上記請求項4の発明の構成では、%gpo
ffs マクロに対して、ラベルに対応するグローバル
ポインタを引数として指定する必要があるが、請求項5
の構成によれば、その必要がないという効果がある。
[0029] In the configuration of the fourth aspect of the present invention,% gpo
A global pointer corresponding to a label must be specified as an argument to the ffs macro.
According to the configuration described above, there is an effect that it is not necessary.

【0030】また、請求項6の発明は、グローバルポイ
ンタセクションを含む複数のアセンブラソースプログラ
ムに対して結合編集を行うプログラムの結合編集方法で
あって、前記アセンブラプログラムを入力し、前記グロ
ーバルポインタセクションにて使用されるグローバルポ
インタの一覧を作成し、前記グローバルポインタセクシ
ョンの各セクション毎に、セクション内のラベルに対し
てオフセットを決定し、前記セクション毎に、各セクシ
ョンの大きさを決定し、各グローバルポインタに関わる
複数のセクションを連続して配置し、セクションの先頭
アドレスを決定し、各グローバルポインタの値を決定
し、再配置情報に基づくアドレスとオフセットを生成し
て、再配置アドレスの計算を行い、生成された実行可能
オブジェクトの出力を行うことを特徴とする。
A sixth aspect of the present invention is a method for connecting and editing a plurality of assembler source programs including a global pointer section, wherein the assembler program is input and the global pointer section is input to the global pointer section. A list of global pointers used in each section of the global pointer section, determine an offset for a label in the section for each section, determine a size of each section for each section, Multiple sections related to pointers are arranged consecutively, the start address of the section is determined, the value of each global pointer is determined, the address and offset based on the relocation information are generated, and the relocation address is calculated. , Output of generated executable object And performing.

【0031】上記発明の構成によれば、タスク毎に固有
のグローバルポインタを持たせるようにしたので、各々
のタスク毎に使用頻度の高い変数をそれぞれのグローバ
ルポインタでアクセスできるように配置することが可能
になり、全体としての命令数の削減が達成できる。
According to the configuration of the present invention, a unique global pointer is provided for each task. Therefore, a variable frequently used for each task can be arranged so as to be accessed by each global pointer. This makes it possible to achieve a reduction in the number of instructions as a whole.

【0032】上記目的を達成するため、請求項7の発明
は、グローバルポインタセクションを含む複数のアセン
ブラソースプログラムに対して結合編集を行うプログラ
ムの結合編集プログラムを記録した機械読み取り可能な
記録媒体であって、前記グローバルポインタセクション
に対して、初期値なしデータと、初期値ありデータを各
グローバルセクション毎に個別に配置し、前記複数のア
センブラソースプログラムに含まれる各々のグローバル
ポインタセクションに固有のグローバルポインタが設け
られた実行可能オブジェクトを出力することを特徴とす
る。
In order to achieve the above object, the invention of claim 7 is a machine readable recording medium which records a combined editing program of a program for performing combined editing on a plurality of assembler source programs including a global pointer section. In the global pointer section, data without an initial value and data with an initial value are individually arranged for each global section, and a global pointer unique to each global pointer section included in the plurality of assembler source programs. Output the executable object provided with.

【0033】また、請求項8の発明は、グローバルポイ
ンタセクションを含む複数のアセンブラソースプログラ
ムに対して結合編集を行うプログラムの結合編集プログ
ラムを記録した機械読み取り可能な記録媒体であって、
前記アセンブラプログラムを入力するステップと、前記
グローバルポインタセクションにて使用されるグローバ
ルポインタの一覧を作成するステップと、前記グローバ
ルポインタセクションの各セクション毎に、セクション
内のラベルに対してオフセットを決定するステップと、
前記セクション毎に、各セクションの大きさを決定する
ステップと、各グローバルポインタに関わる複数のセク
ションを連続して配置し、セクションの先頭アドレスを
決定するステップと、各グローバルポインタの値を決定
するステップと、再配置情報に基づくアドレスとオフセ
ットを生成して、再配置アドレスの計算を行うステップ
と、生成された実行可能オブジェクトの出力を行うステ
ップと、を具備することを特徴とする。
According to another aspect of the present invention, there is provided a machine-readable recording medium recording a combined editing program of a program for performing combined editing on a plurality of assembler source programs including a global pointer section,
Inputting the assembler program, creating a list of global pointers used in the global pointer section, and determining, for each section of the global pointer section, an offset with respect to a label in the section When,
Deciding the size of each section, arranging a plurality of sections related to each global pointer in succession, determining the start address of the section, and deciding the value of each global pointer for each section And a step of generating an address and an offset based on the relocation information to calculate a relocation address, and a step of outputting the generated executable object.

【0034】[0034]

【発明の実施の形態】以下、本発明に係るプログラム結
合編集方法及びプログラム結合編集プログラムを記録し
た機械読み取り可能な記録媒体の実施形態について、図
面を参照しながら詳細に説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Embodiments of a program combination editing method and a machine readable recording medium recording a program combination editing program according to the present invention will be described below in detail with reference to the drawings.

【0035】第1の実施の形態 本発明の第1の実施形態について、図面を参照して説明
する。図1は、本実施形態のプログラム結合編集方法を
示すフローチャートである。本実施形態のプログラム編
集方法は、まず、再配置可能ファイルを入力する(ステ
ップS101)。続いて、使用されるグローバルポイン
タの一覧を作成する(ステップS102)。続いて、セ
クション毎に、セクション内のラベルに対し、オフセッ
トを決定し(ステップS103)、セクション毎に、各
セクションの大きさを決定する(ステップS104)。
続いて、各グローバルポインタに関わる複数のセクショ
ンを連続して配置し、セクションの先頭アドレスを決定
する(ステップS105)。続いて、各グローバルポイ
ンタの値を決定し(ステップS106)、再配置情報に
基づくアドレスとオフセットを生成し、再配置アドレス
の計算を行う(ステップS107)。最後に、生成され
た実行可能オブジェクトの出力を行う(ステップS10
8)。
First Embodiment A first embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a flowchart illustrating a program combination editing method according to the present embodiment. In the program editing method according to the present embodiment, first, a relocatable file is input (step S101). Subsequently, a list of global pointers to be used is created (step S102). Subsequently, an offset is determined for a label in the section for each section (step S103), and a size of each section is determined for each section (step S104).
Subsequently, a plurality of sections related to each global pointer are arranged consecutively, and the head address of the section is determined (step S105). Subsequently, the value of each global pointer is determined (step S106), an address and an offset are generated based on the relocation information, and the relocation address is calculated (step S107). Finally, the generated executable object is output (step S10).
8).

【0036】次に、本実施形態について、具体例を交え
て詳細に説明する。まず、ステップS101にて再配置
可能ファイルを入力する。図2は、本実施形態の具体例
を説明するために用いるアセンブラプログラムを示した
ものである。同図(a)及び(b)に記述された、.s
bss擬似命令、及び、.sdata擬似命令は、図2
0での説明と同様である。この図20と相違するのは、
図2(a)及び(b)のアセンブラプログラムの先頭
に、.gpsection疑似命令が付加されている点
である。グローバルポインタを介してアクセスするデー
タセクションを指定するために、アセンブラの擬似命令
として、.gpsection疑似命令を設けるように
したものである。一つのアセンブラソースに対して、一
度だけこの.gpsection擬似命令によってセク
ション名を割り当てる事が出来る。なお、同図(a)及
び(b)は個別のファイルに収められているものとす
る。
Next, this embodiment will be described in detail with reference to specific examples. First, a relocatable file is input in step S101. FIG. 2 shows an assembler program used for explaining a specific example of the present embodiment. In FIG. s
bss pseudo-instruction and. The sdata pseudo-instruction is shown in FIG.
This is the same as the description for 0. The difference from FIG. 20 is that
.. At the beginning of the assembler program in FIG. The gpsection pseudo-instruction is added. To specify the data section to be accessed via the global pointer, as an assembler pseudo-instruction, The gpsection pseudo instruction is provided. Only once for one assembler source. A section name can be assigned by the gpsection pseudo-instruction. FIGS. 7A and 7B are stored in individual files.

【0037】続いて、ステップS102にて、使用され
るグローバルポインタの一覧を作成する。本実施形態で
用いるグローバルポインタは、図2(a)で示されたグ
ローバルポインタセクション「task1」のグローバ
ルポインタを「_gp_task1」とし、また、図2
(b)に示されたグローバルポインタセクション「ta
sk2」のグローバルポインタを「_gp_task
2」とする。
Subsequently, in step S102, a list of global pointers to be used is created. In the global pointer used in the present embodiment, the global pointer of the global pointer section “task1” shown in FIG. 2A is set to “_gp_task1”.
The global pointer section “ta” shown in FIG.
The global pointer of “sk2” is set to “_gp_task”
2 ".

【0038】続いて、ステップS103にて、入力され
たファイルに記述されたセクション毎に、セクション内
のラベルに対してオフセットを決定する。図2(a)に
示したアセンブラプログラムでは、「x」がラベルとし
て記述されている。また、同図(b)に示したアセンブ
ラプログラムでは、「y」がラベルとして記述されてい
る。まず、この「x」については、セクションを上で定
義したグローバルポインタセクション「task1」に
データセクションである旨の示す「_data」を付加
して、セクション名「task1_data」とし、オ
フセットを「0」とする。図3(a)には、これを理解
の容易ならしめるのため示した。同様に、「y」につい
ても、セクションを上で定義したグローバルポインタセ
クション「task2」にデータセクションである旨の
示す「_data」を付加して、セクション名「tas
k2_data」とし、オフセットを「0」とする。図
3(b)には、これを理解の容易ならしめるのため示し
た。
Subsequently, in step S103, an offset is determined for a label in the section for each section described in the input file. In the assembler program shown in FIG. 2A, “x” is described as a label. Further, in the assembler program shown in FIG. 2B, “y” is described as a label. First, for “x”, “_data” indicating that the section is a data section is added to the global pointer section “task1” defined above, the section name is “task1_data”, and the offset is “0”. I do. FIG. 3A shows this for easy understanding. Similarly, for “y”, “_data” indicating that the section is a data section is added to the global pointer section “task2” that defines the section above, and the section name “tas”
k2_data ”and the offset is“ 0 ”. This is shown in FIG. 3B for easy understanding.

【0039】続いて、ステップS104にて、セクショ
ン毎に、各セクションの大きさを決定する。まず、図2
(a)に示したアセンブラプログラムでは、「a」がラ
ベルとして記述されている。また、同図(b)に示した
アセンブラプログラムでは、「b」がラベルとして記述
されている。まず、この「a」については、セクション
を上で定義したグローバルポインタセクション「tas
k1」に.bssセクションである旨の示す「_bs
s」を付加して、セクション名「task1_bss」
とし、領域サイズは4である。図3(c)には、これを
理解の容易ならしめるのため示した。同様に、「b」に
ついても、セクションを上で定義したグローバルポイン
タセクション「task2」に.bssセクションであ
る旨の示す「_bss」を付加して、セクション名「t
ask2_bss」とし、領域サイズは4である。図3
(d)には、これを理解の容易ならしめるのため示し
た。
Subsequently, in step S104, the size of each section is determined for each section. First, FIG.
In the assembler program shown in (a), "a" is described as a label. In the assembler program shown in FIG. 3B, “b” is described as a label. First, regarding this “a”, the global pointer section “tas” defining the section above
k1 ”. "_bs" indicating that the section is a bss section
s ”to add the section name“ task1_bss ”
And the area size is 4. This is shown in FIG. 3C for easy understanding. Similarly, for "b", the section is added to the global pointer section "task2" defined above. “_bss” indicating that the section name is a section name “t”
ask2_bss ”, and the area size is 4. FIG.
This is shown in (d) for easier understanding.

【0040】従って、グローバルポインタセクションt
ask1に関する各セクションについて大きさを決定す
ると、「task1_bss」については、グローバル
ポインタとして属性「_gp_task1」であって、
サイズが4である。また、「task1_data」に
ついては、グローバルポインタとして属性「_gp_t
ask1」であって、サイズが4である。さらに、.t
ext領域のサイズは8である。図3(e)には、これ
を理解の容易ならしめるのため示した。一方、task
2に関する各セクションについて大きさを決定すると、
「task2_bss」については、グローバルポイン
タとして属性「_gp_task2」であって、サイズ
が4である。また、「task2_data」について
は、グローバルポインタとして属性「_gp_task
2」であって、サイズが4である。さらに、.text
領域のサイズは8である。図3(f)には、これを理
解の容易ならしめるのため示した。
Therefore, the global pointer section t
When the size is determined for each section related to ask1, for "task1_bss", the attribute is "_gp_task1" as a global pointer, and
Size is 4. For “task1_data”, the attribute “_gp_t” is used as a global pointer.
ask1 ”and the size is 4. further,. t
The size of the ext area is 8. FIG. 3E shows this for easy understanding. On the other hand, task
Determine the size for each section about 2,
“Task2_bss” has an attribute “_gp_task2” as a global pointer and a size of 4. For “task2_data”, the attribute “_gp_task” is used as a global pointer.
2 "and the size is 4. further,. text
The size of the area is 8. FIG. 3 (f) shows this for easy understanding.

【0041】この結果を各セクション毎にその大きさを
示すと図4のようになる。この図表の、.text セ
クションは、図3(e)及び(f)の双方にあるので、
合計のサイズは16ということになる。
FIG. 4 shows the size of the result for each section. In this chart,. Since the text section is present in both FIG. 3 (e) and (f),
The total size is 16.

【0042】続いて、ステップS105にて、各グロー
バルポインタに関わる複数のセクションを連続して配置
し、セクションの先頭アドレスを決定し、ステップS1
06にて、各グローバルポインタの値を決定する。これ
により、グローバルポインタ「_gp_task1」の
初期値は、0x00008000であり、グローバルポ
インタ「_gp_task1」の初期値は、0x000
08008となる。
Subsequently, in step S105, a plurality of sections relating to each global pointer are successively arranged, and the head address of the section is determined.
At 06, the value of each global pointer is determined. Accordingly, the initial value of the global pointer “_gp_task1” is 0x00008000, and the initial value of the global pointer “_gp_task1” is 0x000.
08008.

【0043】続いて、ステップS107にて、再配置情
報に基づくアドレスとオフセットを生成し、再配置アド
レスの計算を行う。この再配置アドレスの計算は、図6
に示す如く、(ラベル名)−(対応するグローバルポイ
ンタの初期値)で算出する。このステップでは、全ての
ラベルのアドレスとグローバルポインタの初期値を決定
した後、図6に示した計算式に従ってオフセット値を求
め、それを直接出力の実行形式オブジェクト内に埋め込
むようにする。
Subsequently, in step S107, an address and an offset based on the relocation information are generated, and the relocation address is calculated. The calculation of the relocation address is shown in FIG.
As shown in (2), it is calculated by (label name)-(initial value of corresponding global pointer). In this step, after determining the addresses of all the labels and the initial values of the global pointers, an offset value is obtained in accordance with the calculation formula shown in FIG. 6, and the offset value is directly embedded in the output executable object.

【0044】結合編集後のメモリイメージを、図7に示
す。個別のアセンブラソースに対して、それぞれのグロ
ーバルポインタの初期値が_gp_task1と_gp
_task2に割り付けられる。task1_bssと
task1_dataは、連続した領域を割り付けら
れ、それらの先頭から32KBの位置にgp_task
1が割り付けられる。同様に、task2_bssとt
ask2_dataは、連続した領域を割り付けられ、
それらの先頭から32KBの位置にgp_task2が
割り付けられる。このように、グローバルポインタセク
ションに対して、初期値なしデータと、初期値ありデー
タを各グローバルセクション毎に個別に配置するように
して、アセンブラソースプログラムに含まれる各々のグ
ローバルポインタセクションに固有のグローバルポイン
タが設けるようにしたものである。
FIG. 7 shows the memory image after the combined editing. For each assembler source, the initial value of each global pointer is _gp_task1 and _gp
_Task2. For task1_bss and task1_data, continuous areas are allocated, and gp_task is located at a position 32 KB from the top of them.
1 is assigned. Similarly, task2_bss and t
ask2_data is allocated a continuous area,
Gp_task2 is allocated to the position of 32 KB from the head. As described above, the data without the initial value and the data with the initial value are individually arranged for each global section in the global pointer section, so that the global pointer unique to each global pointer section included in the assembler source program is allocated. The pointer is provided.

【0045】また、命令コードは .textセクショ
ンにまとめられる。これらのコードを実行する際には、
gpレジスタに、それぞれのタスクに対応するグローバ
ルポインタの値を設定する必要がある。
The instruction code is. It is organized into text sections. When executing these codes,
It is necessary to set the value of the global pointer corresponding to each task in the gp register.

【0046】本実施形態では、gpレジスタの初期化及
びタスク切り替えに伴うgpレジスタの入れ換えに関す
る部分の説明は省略するが、通常のマルチタスク・オペ
レーティング・システムの機能において、gpレジスタ
をタスク固有の資源として割り当てることにより、容易
に実現する事ができる。
In this embodiment, the description of the initialization of the gp register and the replacement of the gp register accompanying the task switching will be omitted. However, in a normal multitask operating system function, the gp register is used as a task-specific resource. Can be easily realized by assigning

【0047】以上のように、結合編集単位が大きく、全
体で一つのグローバルポインタセクションしか使用でき
ない場合には、すべての変数をグローバルポインタセク
ションに収める事ができない。本発明によれば、マルチ
タスクプログラムに代表されるように、プログラムの中
のサブモジュール間の独立性が高い場合に、タスク毎に
固有のグローバルポインタを持たせる、各々のタスク毎
に、使用頻度の高い変数をそれぞれのグローバルポイン
タでアクセスできるように配置することが可能になり、
全体としての命令数の削減が達成できる。
As described above, if the unit of combined editing is large and only one global pointer section can be used as a whole, all variables cannot be stored in the global pointer section. According to the present invention, when the independence between sub-modules in a program is high, as represented by a multi-task program, each task has a unique global pointer. Variables that can be accessed by their global pointers,
A reduction in the number of instructions as a whole can be achieved.

【0048】第2の実施の形態 次に、第2の実施の形態のプログラム結合編集方法につ
いて、図8を参照して説明する。本実施形態では、第1
の実施形態に対して、.gpsection擬似命令
を、一つのアセンブラソースプログラムに複数記述する
ようにしたものである。.sbss,.sdata擬似
命令、および、%gpoffsマクロについては、その
直前の.gpsectionの定義が有効となる。図8
に示したアセンブラソースプログラムについて図1のフ
ローチャートに示した処理を行うと、結合編集後のメモ
リイメージは、第1の実施形態の結果である図7と同じ
となる。 本実施形態のプログラム結合編集方法によれ
ば、一つのタスクで扱うデータが大きい場合でも、部分
ごとに変数に対する参照の頻度が異なる場合には、部分
ごとにグローバルポインタを入れ換えてアクセスするこ
とにより、命令数の削減が可能な場合がある。このよう
なプログラムの結合編集が可能になる。
Second Embodiment Next, a program combination editing method according to a second embodiment will be described with reference to FIG. In the present embodiment, the first
For the embodiment of. A plurality of gpsection pseudo-instructions are described in one assembler source program. . sbss,. For the sdata pseudo-instruction and the% gpoffs macro, the. The definition of gpsection becomes valid. FIG.
When the processing shown in the flowchart of FIG. 1 is performed on the assembler source program shown in FIG. 7, the memory image after the combined editing becomes the same as that of FIG. 7 which is the result of the first embodiment. According to the program combination editing method of the present embodiment, even when the data handled by one task is large, if the frequency of reference to the variable is different for each part, the global pointer is replaced for each part and accessed. In some cases, the number of instructions can be reduced. Such programs can be combined and edited.

【0049】第3の実施の形態 次に、第3の実施形態のプログラム結合編集方法につい
て、図面を参照して説明する。本実施形態は、第1の実
施形態に対して、.gpsection擬似命令と%g
poffsマクロの機能を拡張し、あるプログラムスレ
ッドにおいて、複数のレジスタをグローバルポインタと
して使用することを可能にするものである。本実施形態
においても、図1のフローチャートに示す如く処理を行
う。本実施形態について、具体例を交えて詳細に説明す
る。まず、ステップS101にて再配置可能ファイルを
入力する。図9は、本実施形態の具体例を説明するため
に用いるアセンブラプログラムを示したものである。同
図(a)及び(b)に記述された、.sbss擬似命
令、及び、.sdata擬似命令は、図20での説明と
同様であるが、図9(a)については、複数の.gps
ection擬似命令がある。この図20と相違するの
は、図9(a)及び(b)のアセンブラプログラムの先
頭に、.gpsection疑似命令が付加されている
点である。グローバルポインタを介してアクセスするデ
ータセクションを指定するために、アセンブラの擬似命
令として、.gpsection疑似命令を設けるよう
にしたものである。一つのアセンブラソースに対して、
一度だけこの.gpsection擬似命令によってセ
クション名を割り当てる事が出来る。なお、同図(a)
の.text領域は、100命令が記述されているもの
とする。
Third Embodiment Next, a program combination editing method according to a third embodiment will be described with reference to the drawings. This embodiment is different from the first embodiment in that. gpsection pseudo-instruction and% g
The function of the poffs macro is extended to enable a certain program thread to use a plurality of registers as global pointers. Also in the present embodiment, processing is performed as shown in the flowchart of FIG. This embodiment will be described in detail with reference to specific examples. First, a relocatable file is input in step S101. FIG. 9 shows an assembler program used for explaining a specific example of the present embodiment. In FIG. The sbss pseudo-instruction and. The sdata pseudo-instruction is the same as that described with reference to FIG. 20. However, in FIG. gps
There is an action pseudo-instruction. The difference from FIG. 20 is that the assembler program shown in FIG. 9A and FIG. The gpsection pseudo-instruction is added. To specify the data section to be accessed via the global pointer, as an assembler pseudo-instruction, The gpsection pseudo instruction is provided. For one assembler source,
This one time only. A section name can be assigned by the gpsection pseudo-instruction. In addition, FIG.
of. It is assumed that 100 instructions are described in the text area.

【0050】続いて、ステップS102にて、使用され
るグローバルポインタの一覧を作成する。本実施形態で
用いるグローバルポインタは、図9(a)及び(b)に
示したグローバルポインタセクション「gp1」のグロ
ーバルポインタを「gp1」とし、また、同図(b)に
示したグローバルポインタセクション「gp2」のグロ
ーバルポインタを「gp2」とする。
Subsequently, in step S102, a list of global pointers to be used is created. In the global pointer used in the present embodiment, the global pointer of the global pointer section “gp1” shown in FIGS. 9A and 9B is “gp1”, and the global pointer section “gp1” shown in FIG. The global pointer of “gp2” is “gp2”.

【0051】続いて、ステップS103にて、入力され
たファイルに記述されたセクション毎に、セクション内
のラベルに対してオフセットを決定する。図9(a)に
示したアセンブラプログラムでは、「x1」、「x
2」、「y1」、「y2」がラベルとして記述されてい
る。また、同図(b)に示したアセンブラプログラムで
は、「z1」、「z2」がラベルとして記述されてい
る。まず、「x1」については、セクションを上で定義
したグローバルポインタセクション「gp1」にデータ
セクションである旨の示す「_data」を付加して、
セクション名「gp1_data」とし、オフセットを
「0」とする。同様に、「x2」についても、セクショ
ンを上で定義したグローバルポインタセクション「gp
1」にデータセクションである旨の示す「_data」
を付加して、セクション名「gp1_data」とし、
オフセットを「64」とする。「y1」についても、セ
クションを上で定義したグローバルポインタセクション
「gp2」にデータセクションである旨の示す「_da
ta」を付加して、セクション名「gp2_data」
とし、オフセットを「0」とする。また、「y2」につ
いても、セクションを上で定義したグローバルポインタ
セクション「gp2」にデータセクションである旨の示
す「_data」を付加して、セクション名「gp2_
data」とし、オフセットを「64」とする。図10
(a)には、これを理解の容易ならしめるのため示し
た。
Subsequently, in step S103, an offset is determined for a label in the section for each section described in the input file. In the assembler program shown in FIG. 9A, “x1”, “x
2, "y1" and "y2" are described as labels. In the assembler program shown in FIG. 2B, “z1” and “z2” are described as labels. First, for “x1”, “_data” indicating that the section is a data section is added to the global pointer section “gp1” that defines the section above,
The section name is “gp1_data” and the offset is “0”. Similarly, for “x2”, the global pointer section “gp” whose section is defined above
"_Data" indicating that this is a data section in "1"
To make the section name “gp1_data”,
The offset is “64”. As for “y1”, “_da” indicating that the section is a data section is added to the global pointer section “gp2” defined above.
ta ”and the section name“ gp2_data ”
And the offset is “0”. As for “y2”, “_data” indicating that the section is a data section is added to the global pointer section “gp2” that defines the section above, and the section name is “gp2_”.
data ”and the offset is“ 64 ”. FIG.
(A) shows this for easy understanding.

【0052】また、「z1」についても、セクションを
上で定義したグローバルポインタセクション「gp1」
にデータセクションである旨の示す「_data」を付
加して、セクション名「gp1_data」とし、オフ
セットを「0」とする。また、「z2」についても、セ
クションを上で定義したグローバルポインタセクション
「gp2」にデータセクションである旨の示す「_da
ta」を付加して、セクション名「gp2_data」
とし、オフセットを「32」とする。図10(b)に
は、これを理解の容易ならしめるのため示した。
Also, for "z1", the global pointer section "gp1" whose section is defined above
Is added to “_data” indicating that the section is a data section, the section name is “gp1_data”, and the offset is “0”. As for “z2”, “_da” indicating that the section is a data section is added to the global pointer section “gp2” defined above.
ta ”and the section name“ gp2_data ”
And the offset is “32”. This is shown in FIG. 10B for easy understanding.

【0053】続いて、ステップS104にて、セクショ
ン毎に、各セクションの大きさを決定する。まず、図9
(a)に示したアセンブラプログラムでは、「a」、
「b」がラベルとして記述されている。また、同図
(b)に示したアセンブラプログラムでは、「c」がラ
ベルとして記述されている。まず、この「a」について
は、セクションを上で定義したグローバルポインタ「g
p1」に.bssセクションである旨の示す「_bs
s」を付加して、セクション名「gp1_bss」と
し、領域サイズは4000である。また、「b」につい
ても、セクションを上で定義したグローバルポインタ
「gp2」に.bssセクションである旨の示す「_b
ss」を付加して、セクション名「gp2_bss」と
し、領域サイズは40000である。図10(c)に
は、これを理解の容易ならしめるのため示した。同様
に、「c」についても、セクションを上で定義したグロ
ーバルポインタ「gp1」に.bssセクションである
旨の示す「_bss」を付加して、セクション名「gp
1_bss」とし、領域サイズは10000である。図
3(d)には、これを理解の容易ならしめるのため示し
た。
Subsequently, in step S104, the size of each section is determined for each section. First, FIG.
In the assembler program shown in (a), "a",
“B” is described as a label. In the assembler program shown in FIG. 3B, “c” is described as a label. First, for this “a”, the global pointer “g” that defines the section above
p1 ”. "_bs" indicating that the section is a bss section
s ", the section name is" gp1_bss ", and the area size is 4000. Also, for "b", the section is added to the global pointer "gp2" defined above. "_b" indicating that the section is a bss section
"ss", the section name is "gp2_bss", and the area size is 40000. This is shown in FIG. 10C for easy understanding. Similarly, for “c”, the section is assigned to the global pointer “gp1” defined above. "_bss" indicating that the section is a section name "gps"
1_bss ”, and the area size is 10000. FIG. 3D shows this for easy understanding.

【0054】従って、図9(a)のgp1に関する各セ
クションについて大きさを決定すると、「gp1_bs
s」については、グローバルポインタとして属性「_g
p_gp1」であって、サイズが40000であり、
「gp1_data」については、グローバルポインタ
として属性「_gp1」であって、サイズが128であ
る。
Therefore, when the size of each section regarding gp1 in FIG. 9A is determined, “gp1_bs
For "s", the attribute "_g" is used as a global pointer.
p_gp1 ", the size is 40000,
“Gp1_data” has the attribute “_gp1” as a global pointer and a size of 128.

【0055】また、gp2に関する各セクションについ
て大きさを決定すると、「gp2_bss」について
は、グローバルポインタとして属性「_gp2」であっ
て、サイズが40000であり、「gp2_data」
については、グローバルポインタとして属性「_gp
2」であって、サイズが128である。さらに、.te
xt領域のサイズは400である。図10(e)には、
これを理解の容易ならしめるのため示した。
When the size of each section related to gp2 is determined, “gp2_bss” has the attribute “_gp2” as a global pointer, the size is 40000, and “gp2_data”
For the attribute “_gp” as a global pointer
2 "and the size is 128. further,. te
The size of the xt area is 400. In FIG. 10 (e),
This is shown for ease of understanding.

【0056】一方、図9(b)のgp1に関する各セク
ションについて大きさを決定すると、「gp1_bs
s」については、グローバルポインタとして属性「_g
p1」であって、サイズが10000である。また、
「gp1_data」については、グローバルポインタ
として属性「gp1」であって、サイズが64である。
図3(f)には、これを理解の容易ならしめるのため示
した。この結果を各セクション毎にその大きさを示すと
図5のようになる。すなわち、前述の図10(e)及び
(f)の合計を示したものである。
On the other hand, when the size of each section related to gp1 in FIG. 9B is determined, “gp1_bs
For "s", the attribute "_g" is used as a global pointer.
p1 ”and the size is 10,000. Also,
“Gp1_data” has the attribute “gp1” as a global pointer and a size of 64.
FIG. 3 (f) shows this for easy understanding. FIG. 5 shows the size of this result for each section. That is, the sum of the above-described FIGS. 10 (e) and (f) is shown.

【0057】続いて、ステップS105にて、各グロー
バルポインタに関わる複数のセクションを連続して配置
し、セクションの先頭アドレスを決定し、ステップS1
06にて、各グローバルポインタの値を決定する。これ
により、グローバルポインタ「gp1」の初期値は、0
x00008000であり、グローバルポインタ「gp
2」の初期値は、0x00014410となる。
Subsequently, in step S105, a plurality of sections relating to each global pointer are successively arranged, and the head address of the section is determined.
At 06, the value of each global pointer is determined. Thus, the initial value of the global pointer “gp1” is 0
x00008000 and the global pointer "gp
The initial value of “2” is 0x00014410.

【0058】続いて、ステップS107にて、再配置情
報に基づくアドレスとオフセットを生成し、再配置アド
レスの計算を行う。この再配置アドレスの計算は、図6
に示す如く、(ラベル名)−(対応するグローバルポイ
ンタの初期値)で算出する。このステップでは、全ての
ラベルのアドレスとグローバルポインタの初期値を決定
した後、図6に示した計算式に従ってオフセット値を求
め、それを直接出力の実行形式オブジェクト内に埋め込
むようにする。
Subsequently, in step S107, an address and an offset are generated based on the relocation information, and the relocation address is calculated. The calculation of the relocation address is shown in FIG.
As shown in (2), it is calculated by (label name)-(initial value of corresponding global pointer). In this step, after determining the addresses of all the labels and the initial values of the global pointers, an offset value is obtained in accordance with the calculation formula shown in FIG. 6, and the offset value is directly embedded in the output executable object.

【0059】結合編集後のメモリイメージを、図13に
示す。個別のアセンブラソースに対して、それぞれのグ
ローバルポインタの初期値がgp1とgp2に割り付け
られる。gp1_bssとgp1_dataは、連続し
た領域を割り付けられ、それらの先頭から32KBの位
置にgp1が割り付けられる。同様に、gp2_bss
とgp2_dataは、連続した領域を割り付けられ、
それらの先頭から32KBの位置にgp2が割り付けら
れる。また、命令コードは .textセクションにま
とめられる。これらのコードを実行する際には、gpレ
ジスタに、それぞれのタスクに対応するグローバルポイ
ンタの値を設定する必要がある。
FIG. 13 shows the memory image after the combined editing. For each assembler source, the initial value of each global pointer is assigned to gp1 and gp2. For gp1_bss and gp1_data, continuous areas are allocated, and gp1 is allocated at a position of 32 KB from the head. Similarly, gp2_bss
And gp2_data are allocated contiguous areas,
Gp2 is allocated to the position of 32 KB from the head. The instruction code is. It is organized into text sections. When executing these codes, it is necessary to set the value of the global pointer corresponding to each task in the gp register.

【0060】.gpseciton擬似命令は、それに
続いて現れる。.sbssおよび.sdata擬似命令
によって宣言される変数が割り付けられるセクション名
を定義する。一つの.gpseciton擬似命令に与
えられた名前に対して、初期値なしデータは、_bss
を連結した名前のセクションに割り付けられ、初期値あ
りデータは、_dataを連結した名前のセクションに
割り付けられる。図9の例においては、.gpsect
ion gp1の後の、.sbssで宣言される変数a
は、gp1_bssという名前のセクションに、 .s
dataで宣言される変数xは、gp1_dataとい
う名前のセクションに割り付けられる。
[0060] The gpsecon pseudo-instruction follows. . sbss and. Defines the section name to which the variable declared by the sdata pseudo-instruction is allocated. One. For the name given to the gpsecon pseudo-instruction, the data without an initial value is _bss
Is assigned to a section having a name concatenated with _data, and data with an initial value is assigned to a section having a name concatenated with _data. In the example of FIG. gpsect
After ion gp1,. Variable a declared in sbss
Contains in a section named gp1_bss,. s
The variable x declared in data is allocated to a section named gp1_data.

【0061】なお、本実施形態で用いられる%gpof
fsマクロは、2つの引数を持つ。第一の引数が、参照
する変数のラベル、第二の引数が、そのラベルの属する
グローバルポインタセクションを示す名前である。命令
のオペランドとしては、この%gpoffsマクロの後
ろに、グローバルポインタとして用いるレジスタ名を書
く必要がある。その命令が実行される時に、そのレジス
タに正しいグローバルポインタ値が格納されていること
は、プログラマの責任である。
Note that the% gpof used in the present embodiment is
The fs macro has two arguments. The first argument is the label of the variable to be referenced, and the second argument is the name indicating the global pointer section to which the label belongs. As an instruction operand, it is necessary to write a register name used as a global pointer after the% gpoffs macro. It is the programmer's responsibility that the correct global pointer value be stored in the register when the instruction is executed.

【0062】本実施形態では、gpレジスタの初期化及
びタスク切り替えに伴うgpレジスタの入れ換えに関す
る部分の説明は省略するが、通常のマルチタスク・オペ
レーティング・システムの機能において、gpレジスタ
をタスク固有の資源として割り当てることにより、容易
に実現する事ができる。
In this embodiment, the description of the portion relating to the initialization of the gp register and the replacement of the gp register accompanying the task switching is omitted, but in the function of the normal multitask operating system, the gp register is used as a task-specific resource. Can be easily realized by assigning

【0063】このように、本実施形態のプログラム結合
編集方法によれば、タスクをいくつかの部分に分けて
も、扱うデータのサイズが一つのグローバルポインタセ
クションに収まらない場合でも、グローバルポインタと
してレジスタを複数割り当てることで、命令数の削減が
可能な場合がある。このようなプログラムの結合編集が
可能になる。
As described above, according to the program combination editing method of the present embodiment, even if the task is divided into several parts and the size of the data to be handled does not fit in one global pointer section, the register is used as the global pointer. May be able to reduce the number of instructions. Such programs can be combined and edited.

【0064】第4の実施の形態 次に、第4の実施形態について、図面を参照して説明す
る。この実施形態は、第1及び第2の実施形態におい
て、%gpoffsマクロに対応するグローバルポイン
タが、ソースプログラム中の、.gpsectionの
指定との前後関係に依存して定められたのに対して、%
gpoffsマクロに引数として与えられる変数のラベ
ルから、自動的に求める機能を付加し、第3の実施形態
と同様のプログラムを作成する際に、%gpoffsマ
クロの引数を一つにしたものである。 この実施形態の
結合編集処理のフローを図14を参照して説明する。結
合編集処理では、まず、入力となる再配置可能オブジェ
クトファイルを読み込む(ステップS201)。セクシ
ョン情報の属性を調べ、グローバルポインタの一覧を作
成する(ステップS202)。
Fourth Embodiment Next, a fourth embodiment will be described with reference to the drawings. This embodiment is different from the first and second embodiments in that the global pointer corresponding to the% gpoffs macro is the. % is determined depending on the context with the gpsection specification.
A function for automatically obtaining a variable from a label given as an argument to the gpoffs macro is added, and when a program similar to that of the third embodiment is created, only one argument of the% gpoffs macro is used. The flow of the combined editing process according to this embodiment will be described with reference to FIG. In the combination editing process, first, a relocatable object file to be input is read (step S201). The attribute of the section information is checked, and a list of global pointers is created (step S202).

【0065】続いて、セクション毎に、セクション内の
ラベルに対し、オフセットを決定し(ステップS20
3)、同じセクション名同士の内容を連結して各セクシ
ョンの大きさを決定し、初期値なしデータについては、
オブジェクト中に指定してある容量の領域を確保する
(ステップS204)。続いて、それぞれのセクション
の先頭アドレスを確定する(ステップS205)。続い
て、グローバルポインタセクションの各々について、そ
れを参照するためのグローバルポインタの値を決定する
(ステップS206)。この際、セクションの容量が、
一つのグローバルポインタを使用してアクセス可能な容
量を越えていれば、エラーとして処理を中止し、エラー
メッセージを生成する。続いて、グローバルポインタセ
クションの各々について、そこに属する変数の、上で決
定したグローバルポインタの値からのオフセットを計算
し、一覧表を作成する(ステップS207)。続いて、
再配置情報にもとづくアドレス計算とオフセットの生成
を行う(ステップS208)、ここで、%gpoffs
マクロに対応する再配置情報については、上で生成し
たラベル一覧表を検索、参照して処理する。最後に、実
行可能オブジェクトを生成する(ステップS209)。
Subsequently, for each section, an offset is determined for the label in the section (step S20).
3), the contents of the same section name are concatenated to determine the size of each section.
An area of the capacity specified in the object is secured (step S204). Subsequently, the start address of each section is determined (step S205). Subsequently, for each of the global pointer sections, the value of the global pointer for referring to it is determined (step S206). At this time, the capacity of the section
If the capacity exceeds the accessible capacity using one global pointer, the processing is stopped as an error and an error message is generated. Subsequently, for each of the global pointer sections, the offset of the variable belonging thereto from the value of the global pointer determined above is calculated, and a list is created (step S207). continue,
Address calculation and offset generation are performed based on the relocation information (step S208), where% gpoffs
The relocation information corresponding to the macro is processed by searching and referring to the label list generated above. Finally, an executable object is generated (Step S209).

【0066】次に、本実施形態の具体例について、図面
を参照しながら説明する。図14に示した本実施形態の
フローチャートと上述の第1乃至第3の実施形態で用い
たフローチャートとの相違点は、ステップ207が追加
されている点である。従って、これらステップの説明を
行い、それ以外のステップは、上述の如くであるので、
その説明は省略する。なお、.gpsection擬似
命令の働きは、第3の実施形態の場合と同じである。
Next, a specific example of this embodiment will be described with reference to the drawings. The difference between the flowchart of this embodiment shown in FIG. 14 and the flowchart used in the above-described first to third embodiments is that step 207 is added. Therefore, these steps will be described, and the other steps are as described above.
The description is omitted. Note that. The function of the gpsection pseudo-instruction is the same as that of the third embodiment.

【0067】ステップS207では、グローバルポイン
タに対するオフセットを計算する。この計算は、再配置
情報の中に計算式が書いてあるものについて、2つのア
ドレスの差を求めることで行う。この計算した結果を図
15に示す。
In step S207, an offset for the global pointer is calculated. This calculation is performed by calculating the difference between the two addresses for a calculation formula written in the relocation information. FIG. 15 shows the result of this calculation.

【0068】結合編集後のメモリイメージを、図13に
示す。結合編集後のメモリイメージは、第3の実施の形
態と同様になる。ただし、%gpoffsマクロは、1
つの引数のみをもつ点で第3の実施の形態と相違する。
この引数は、参照する変数のラベルである。このマクロ
に対して、アセンブラは、変数ラベルに対するグローバ
ルポインタからのオフセット値を示す再配置情報を生成
し、再配置可能オブジェクトファイルに出力する。この
再配置情報には、対応するグローバルポインタに関する
情報は含まれない。
FIG. 13 shows the memory image after the combined editing. The memory image after the combined editing is the same as in the third embodiment. However, the% gpoffs macro is 1
It differs from the third embodiment in that it has only one argument.
This argument is the label of the referenced variable. In response to this macro, the assembler generates relocation information indicating an offset value of the variable label from the global pointer, and outputs the information to the relocatable object file. This relocation information does not include information on the corresponding global pointer.

【0069】第3の実施の形態では、%gpoffsマ
クロに対して、ラベルに対応するグローバルポインタを
引数として指定する必要があるが、本実施形態のプログ
ラム結合編集方法によれば、その必要が無い。これによ
り、出力する実行可能オブジェクトの実行速度が向上す
ることになる。
In the third embodiment, it is necessary to specify a global pointer corresponding to a label as an argument for the% gpoffs macro. However, according to the program combination editing method of this embodiment, this is not necessary. . As a result, the execution speed of the output executable object is improved.

【0070】なお、上述したプログラム結合編集方法を
実現するためのプログラムは記録媒体に保存することが
できる。この記録媒体をコンピュータシステムによって
読み取らせ、前記プログラムを実行してコンピュータを
制御しながら上述したプログラム結合編集方法を実現す
ることができる。ここで、前記記録媒体とは、メモリ装
置、磁気ディスク装置、光ディスク装置等、プログラム
を記録することができるような装置が含まれる。
A program for realizing the above-described program combination editing method can be stored in a recording medium. The recording medium can be read by a computer system, and the above-described program combination editing method can be realized while controlling the computer by executing the program. Here, the recording medium includes a device capable of recording a program, such as a memory device, a magnetic disk device, and an optical disk device.

【0071】[0071]

【発明の効果】以上説明してきたように、本発明に係る
プログラム結合編集方法及びプログラム結合編集プログ
ラムを記録した機械読み取り可能な記録媒体によれば、
一括して結合編集するプログラム作成において、タスク
毎に固有のグローバルポインタを持つことを可能にする
ことにより、アクセスに必要な命令数を削減することが
できる。
As described above, according to the program combination editing method and the machine readable recording medium recording the program combination editing program according to the present invention,
In the creation of a program to be combined and edited collectively, the number of instructions required for access can be reduced by allowing each task to have a unique global pointer.

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

【図1】第1及び第2の実施形態のプログラム結合編集
方法を示すフローチャートである。
FIG. 1 is a flowchart illustrating a program combination editing method according to first and second embodiments.

【図2】第1の実施形態で用いるアセンブラのソースプ
ログラムを示す図である。
FIG. 2 is a diagram showing a source program of an assembler used in the first embodiment.

【図3】第1及び第2の実施形態のプログラム結合編集
方法の動作を説明するための図表である。
FIG. 3 is a table for explaining an operation of a program combination editing method according to the first and second embodiments.

【図4】セクション情報を示す図表である。FIG. 4 is a table showing section information.

【図5】再配置情報に基づくアドレスの計算の結果を示
す図表である。
FIG. 5 is a table showing a result of calculating an address based on relocation information;

【図6】再配置可能オブジェクト内に出力される再配置
情報の計算式を示す図である。
FIG. 6 is a diagram showing a formula for calculating relocation information output in a relocatable object.

【図7】結合編集後のメモリイメージを示す図である。FIG. 7 is a diagram showing a memory image after combined editing.

【図8】第2の実施形態で用いるアセンブラのソースプ
ログラムを示す図である。
FIG. 8 is a diagram showing a source program of an assembler used in a second embodiment.

【図9】第3及び第4の実施形態で用いるアセンブラの
ソースプログラムを示す図である。
FIG. 9 is a diagram showing an assembler source program used in the third and fourth embodiments.

【図10】第3及び第4の実施の形態のプログラム結合
編集方法の動作を説明するための図表である。
FIG. 10 is a chart for explaining the operation of the program combination editing method according to the third and fourth embodiments.

【図11】セクション情報を示す図表である。FIG. 11 is a chart showing section information.

【図12】再配置情報に基づくアドレスの計算の結果を
示す図表である。
FIG. 12 is a table showing a result of calculating an address based on relocation information;

【図13】第3及び第4の実施の形態の結合編集後のメ
モリイメーシを示す図である。
FIG. 13 is a diagram illustrating a memory image after combined editing according to the third and fourth embodiments.

【図14】第4の実施の形態のプログラム結合編集方法
を示すフローチャートである。
FIG. 14 is a flowchart illustrating a program combination editing method according to the fourth embodiment.

【図15】再配置アドレスの計算結果を示す図である。FIG. 15 is a diagram illustrating a calculation result of a relocation address.

【図16】再置配置可能オブジェクトに出力される再配
置情報の計算式を示す図表である。
FIG. 16 is a table showing a calculation formula of relocation information output to a relocation-possible object.

【図17】MIPSアーキテクチャのアクセス動作を説
明するための図である。
FIG. 17 is a diagram for explaining an access operation of the MIPS architecture.

【図18】MIPSアーキテクチャのグローバルポイン
タ用いたアクセス動作を示す図である。
FIG. 18 is a diagram illustrating an access operation using a global pointer of the MIPS architecture.

【図19】従来のプログラム結合・編集方法を示すフロ
ーチャートである。
FIG. 19 is a flowchart showing a conventional program combining / editing method.

【図20】従来のプログラム結合編集方法で用いるアセ
ンブラのソースプログラムを示す図である。
FIG. 20 is a diagram showing an assembler source program used in a conventional program combination editing method.

【図21】従来例の動作を説明するための図である。FIG. 21 is a diagram for explaining an operation of a conventional example.

【図22】従来例による結合編集後のメモリイメージを
示す図である。
FIG. 22 is a diagram showing a memory image after combined editing according to a conventional example.

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】 グローバルポインタセクションを含む複
数のアセンブラソースプログラムに対して結合編集を行
うプログラムの結合編集方法であって、 前記グローバルポインタセクションに対して、初期値な
しデータと、初期値ありデータを各グローバルセクショ
ン毎に個別に配置し、 前記複数のアセンブラソースプログラムに含まれる各々
のグローバルポインタセクションに固有のグローバルポ
インタが設けられた実行可能オブジェクトを出力するこ
とを特徴とするプログラム結合編集方法。
1. A combined editing method of a program for performing combined editing on a plurality of assembler source programs including a global pointer section, wherein data without an initial value and data with an initial value are stored in the global pointer section. A program combination and editing method, wherein an executable object in which a global pointer unique to each of the global pointer sections included in the plurality of assembler source programs is provided is output individually for each global section.
【請求項2】 グローバルポインタセクションを含む複
数のアセンブラソースプログラムに対して結合編集を行
うプログラムの結合編集方法であって、 前記アセンブラソースプログラムに指定された前記複数
のグローバルポインタセクションに係るグローバルポイ
ンタの値からの相対オフセットを求め、 この相対オフセット値を用いて前記各々のグローバルポ
インタセクション内のアドレス計算を行い、 初期値なしデータと初期値ありデータとが各グローバル
ポインタセクション毎に個別に配置され、前記複数のア
センブラソースプログラムに含まれる各々のグローバル
ポインタセクションに固有のグローバルポインタが設け
られた実行可能オブジェクトを出力することを特徴とす
るプログラム結合編集方法。
2. A combined editing method of a program for performing combined editing on a plurality of assembler source programs including a global pointer section, wherein the global pointers of the plurality of global pointer sections specified in the assembler source program are deleted. A relative offset from the value is obtained, an address in each of the global pointer sections is calculated using the relative offset value, data without an initial value and data with an initial value are individually arranged for each global pointer section, A program combination editing method, comprising outputting an executable object in which a unique global pointer is provided for each global pointer section included in the plurality of assembler source programs.
【請求項3】 複数のグローバルポインタセクションを
含むアセンブラソースプログラムに対して結合編集を行
うプログラムの結合編集方法であって、 前記アセンブラソースプログラムに指定された前記複数
のグローバルポインタセクションに係るグローバルポイ
ンタの値からの相対オフセットを求め、 この相対オフセット値を用いて前記各々のグローバルポ
インタセクション内のアドレス計算を行い、 初期値なしデータと初期値ありデータとが各グローバル
ポインタセクション毎に個別に配置され、前記複数のア
センブラソースプログラムに含まれる各々のグローバル
ポインタセクションに固有のグローバルポインタが設け
られた実行可能オブジェクトを出力することを特徴とす
るプログラム結合編集方法。
3. A combined editing method for a program for performing combined editing on an assembler source program including a plurality of global pointer sections, wherein the global pointers related to the plurality of global pointer sections specified in the assembler source program. A relative offset from the value is obtained, an address in each of the global pointer sections is calculated using the relative offset value, data without an initial value and data with an initial value are individually arranged for each global pointer section, A program combination editing method, comprising outputting an executable object in which a unique global pointer is provided for each global pointer section included in the plurality of assembler source programs.
【請求項4】 グローバルポインタセクションを含む複
数のアセンブラソースプログラムに対して結合編集を行
うプログラムの結合編集方法であって、 前記アセンブラソースプログラムに指定された前記複数
のグローバルポインタセクションに係る複数のグローバ
ルポインタの値からの相対オフセットを求め、 この相対オフセット値を用いて前記各々のグローバルポ
インタセクション内のアドレス計算を行い、 初期値なしデータと初期値ありデータとが各グローバル
ポインタセクション毎に個別に配置され、前記複数のア
センブラソースプログラムに含まれる各々のグローバル
ポインタセクションに固有のグローバルポインタが設け
られた実行可能オブジェクトを出力することを特徴とす
るプログラム結合編集方法。
4. A method for combining and editing a plurality of assembler source programs including a global pointer section, the plurality of assembler source programs comprising a plurality of global pointer sections specified in the assembler source program. The relative offset from the value of the pointer is obtained, the address in each of the global pointer sections is calculated using the relative offset value, and data without an initial value and data with an initial value are individually arranged for each global pointer section. And outputting an executable object provided with a unique global pointer in each global pointer section included in the plurality of assembler source programs.
【請求項5】 グローバルポインタセクションを含む複
数のアセンブラソースプログラムに対して結合編集を行
うプログラムの結合編集方法であって、 前記グローバルポインタセクション内のラベルに対し
て、前記アセンブラソースプログラムに指定された前記
複数のグローバルポインタセクションに係るグローバル
ポインタの値からのオフセットを求め、 初期値なしデータと初期値ありデータとが各グローバル
ポインタセクション毎に個別に配置され、前記複数のア
センブラソースプログラムに含まれる各々のグローバル
ポインタセクションに固有のグローバルポインタが設け
られた実行可能オブジェクトを出力することを特徴とす
るプログラム結合編集方法。
5. A combined editing method for combining and editing a plurality of assembler source programs including a global pointer section, wherein a label in the global pointer section is specified in the assembler source program. Calculating an offset from the value of the global pointer relating to the plurality of global pointer sections; data without an initial value and data with an initial value are individually arranged for each global pointer section; And outputting an executable object in which a global pointer unique to the global pointer section is provided.
【請求項6】 グローバルポインタセクションを含む複
数のアセンブラソースプログラムに対して結合編集を行
うプログラムの結合編集方法であって、 前記アセンブラプログラムを入力し、 前記グローバルポインタセクションにて使用されるグロ
ーバルポインタの一覧を作成し、 前記グローバルポインタセクションの各セクション毎
に、セクション内のラベルに対してオフセットを決定
し、 前記セクション毎に、各セクションの大きさを決定し、 各グローバルポインタに関わる複数のセクションを連続
して配置し、セクションの先頭アドレスを決定し、 各グローバルポインタの値を決定し、 再配置情報に基づくアドレスとオフセットを生成して、
再配置アドレスの計算を行い、 生成された実行可能オブジェクトの出力を行うことを特
徴とするプログラムの編集方法。
6. A method for combining and editing a plurality of assembler source programs including a global pointer section, wherein the assembler program is input, and a global pointer used in the global pointer section is input. Create a list, determine an offset for a label in the section for each section of the global pointer section, determine a size of each section for each section, and determine a plurality of sections related to each global pointer. Place them consecutively, determine the start address of the section, determine the value of each global pointer, generate the address and offset based on the relocation information,
A method for editing a program, comprising calculating a relocation address and outputting a generated executable object.
【請求項7】 グローバルポインタセクションを含む複
数のアセンブラソースプログラムに対して結合編集を行
うプログラムの結合編集プログラムを記録した機械読み
取り可能な記録媒体であって、 前記グローバルポインタセクションに対して、初期値な
しデータと、初期値ありデータを各グローバルセクショ
ン毎に個別に配置し、 前記複数のアセンブラソースプログラムに含まれる各々
のグローバルポインタセクションに固有のグローバルポ
インタが設けられた実行可能オブジェクトを出力するこ
とを特徴とするプログラム結合編集プログラムを記録し
た機械読み取り可能な記録媒体。
7. A machine-readable recording medium recording a combined editing program of a program for performing combined editing on a plurality of assembler source programs including a global pointer section, wherein an initial value is set for the global pointer section. None data and data with an initial value are individually arranged for each global section, and an executable object provided with a unique global pointer for each global pointer section included in the plurality of assembler source programs is output. A machine-readable recording medium on which a program combination editing program is recorded.
【請求項8】 グローバルポインタセクションを含む複
数のアセンブラソースプログラムに対して結合編集を行
うプログラムの結合編集プログラムを記録した機械読み
取り可能な記録媒体であって、 前記アセンブラプログラムを入力するステップと、 前記グローバルポインタセクションにて使用されるグロ
ーバルポインタの一覧を作成するステップと、 前記グローバルポインタセクションの各セクション毎
に、セクション内のラベルに対してオフセットを決定す
るステップと、 前記セクション毎に、各セクションの大きさを決定する
ステップと、 各グローバルポインタに関わる複数のセクションを連続
して配置し、セクションの先頭アドレスを決定するステ
ップと、 各グローバルポインタの値を決定するステップと、 再配置情報に基づくアドレスとオフセットを生成して、
再配置アドレスの計算を行うステップと、 生成された実行可能オブジェクトの出力を行うステップ
と、 を具備することを特徴とするプログラムの編集プログラ
ムを記録した機械読み取り可能な記録媒体。
8. A machine-readable recording medium recording a combined editing program of a program for performing combined editing on a plurality of assembler source programs including a global pointer section, wherein the assembler program is input; Creating a list of global pointers used in the global pointer section; determining, for each section of the global pointer section, an offset with respect to a label within the section; Determining the size; arranging a plurality of sections related to each global pointer in succession; determining the head address of the section; determining the value of each global pointer; To generate a dress and offset,
A machine-readable recording medium recording a program editing program, comprising: calculating a relocation address; and outputting the generated executable object.
JP8520797A 1997-04-03 1997-04-03 Program linkage editor method and machine readable record medium recording program linkage editor program Pending JPH10283194A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8520797A JPH10283194A (en) 1997-04-03 1997-04-03 Program linkage editor method and machine readable record medium recording program linkage editor program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8520797A JPH10283194A (en) 1997-04-03 1997-04-03 Program linkage editor method and machine readable record medium recording program linkage editor program

Publications (1)

Publication Number Publication Date
JPH10283194A true JPH10283194A (en) 1998-10-23

Family

ID=13852159

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8520797A Pending JPH10283194A (en) 1997-04-03 1997-04-03 Program linkage editor method and machine readable record medium recording program linkage editor program

Country Status (1)

Country Link
JP (1) JPH10283194A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006164061A (en) * 2004-12-09 2006-06-22 Denso Corp Multitask system, program and program generation method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006164061A (en) * 2004-12-09 2006-06-22 Denso Corp Multitask system, program and program generation method

Similar Documents

Publication Publication Date Title
US5781758A (en) Software emulation system with reduced memory requirements
US8832672B2 (en) Ensuring register availability for dynamic binary optimization
EP0476722B1 (en) Data processing system
JPH01201729A (en) Decoding
WO2004023295A1 (en) Gui application development support device and method, and computer program
US6550000B1 (en) Processor to execute in parallel plurality of instructions using plurality of functional units, and instruction allocation controller
JPH10283194A (en) Program linkage editor method and machine readable record medium recording program linkage editor program
JPS62226231A (en) Processor
JPH0683615A (en) Computer for executing instruction set emulation
US6941549B1 (en) Communicating between programs having different machine context organizations
US7404153B2 (en) Method for the providing of a design, test and development environment and system for carrying out said method
JPH01207824A (en) Module coupling control system
JP3474347B2 (en) Instruction decoding unit of microcomputer
JPH11282693A (en) Mcu simulation device, its simulation method and computer redable recording medium recording simulation program
JPS603656B2 (en) Computer memory expansion method
JP2000231494A (en) Software execution system and software executing method
JPH02140825A (en) Method for processing rearrangement of program
JP2000339173A (en) Language processor
JP2000056991A (en) Micro computer programmable controller provided with multi-task function and its control method
JPH0229867A (en) Design execution control system
JPH0492929A (en) Information processor
JPH04280324A (en) Storage management device
JPH10301791A (en) Object code optimization device, object code optimization method, mechanically readable recording medium recording object code optimization program and compiler
JPS6158042A (en) Microprogram control system
JPH02186440A (en) Sequence control system for microsubroutine