Linking method, linker and computer system

A linker and linked list technology, applied in the computer field, can solve the problems of program performance and efficiency reduction, consuming large code processing time, etc.

Inactive Publication Date: 2013-11-20
HUAWEI TECH CO LTD
View PDF6 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0009] The jump scheme is completed through registers, although the limitation of the jump range of system instructions can be avoided, but it needs to consum...

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Linking method, linker and computer system
  • Linking method, linker and computer system
  • Linking method, linker and computer system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0154] see figure 1 As shown, this embodiment provides a linking method, which mainly includes the following steps:

[0155] Step 101: Determine whether a long jump will occur, if yes, execute step 102, otherwise, execute step 108.

[0156] After opening the input file, input the input file sequence consisting of all object files in the input file to the linker, and determine whether the function jump of each input object file is a long jump according to the input file sequence, if there is a certain function jump If it is converted to a long jump, it is determined that a long jump will occur, otherwise, a long jump will not occur.

[0157] In this step, the specific implementation of determining whether the function jump of each input target file is a long jump according to the sequence of input files can be realized by using, but not limited to, the existing technology. It can also be implemented, but not limited to, according to any of the following long jump judgment tec...

Embodiment 2

[0193] see Figure 4 As shown, this embodiment provides a linking method, which mainly includes the following steps:

[0194] Step 401: Determine whether a long jump will occur, if yes, execute step 402, otherwise, execute step 407.

[0195] For details of this embodiment, but not limited to, refer to what is shown in step 101 in Embodiment 1, and details are not described here.

[0196] Step 402: Create a transit code segment.

[0197] For details of this embodiment, but not limited to, see step 102 in Embodiment 1, and details are not described here.

[0198] Step 403: Create intermediate code segment relocation information in the relocation segment of the input object file.

[0199] For details of this embodiment, but not limited to, refer to what is shown in step 103 in Embodiment 1, and details are not described here.

[0200] Step 404: segment mapping.

[0201] For details of this embodiment, but not limited to, refer to what is shown in step 104 in Embodiment 1, an...

Embodiment 3

[0210] see Figure 5 as shown,

[0211] This embodiment provides a linker, specifically, the linker is predefined or configured to adopt a partial linking manner. The linker in this embodiment mainly includes: a long jump determination unit 501, a transit code segment creation unit 502, a transit code segment relocation information creation unit 503, a segment mapping unit 504, a relocation unit 505, a call adjustment information writing unit 506, and a partial link unit 507 .

[0212] The connection relationship and working principle of each part are as follows:

[0213] The long jump determining unit 501 determines whether the function jump of each input object file is a long jump according to each input object file in the input object file sequence;

[0214] When the function jump of any one of the input target files is a long jump, the transfer code segment creation unit 502 will create a corresponding link for each of the long jumps in the input target file where the c...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention relates to the field of computers, and discloses a linking method, a linker and a computer system. The method includes: determining whether a function jump of each input object file is a long jump or not according to the input object files in an input object file sequence, if yes, creating a transfer code segment for each long jump in the input object file in which an invoking function of each long jump is located, allocating space, and creating transfer labels; determining segment mapping information of the segments, mapped in output object files, of each input object file, and writing the segment mapping information into each input object file; writing assembly codes corresponding to invoking adjustment information into the input object files with the long jumps to obtain input object files with long jumps corrected, and linking with the input object files with the long jumps corrected to generate executable files. On one hand, the problem of link failure caused by the long jumps is solved; on the other hand, system space overhead is saved, instructions are decreased, and program execution efficiency and performance are improved beneficially.

Description

technical field [0001] The invention relates to the field of computers, in particular to a linking method, a linker and a computer system. Background technique [0002] The last processing process of the software program by the compiling tool is linking, which is completed by the linker ld. In the process of linking, if the jump length between a calling function in the input object file and its corresponding called function is too far (for example, under ARM, the jump length of this function is greater than the system’s preset jump limit of 32M), then If the function jumps, a jump error will occur, resulting in a program execution error. [0003] For example, when the current link is a full link, the linker performs a full link on the input object file a.o, input object file b.o, input object file c.o, input object file d.o, input object file e.o, and input object file f.o (the link command: ld a.o b.o c.o d.o e.o f.o); if the jump length between a calling function in a.o ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F9/45
Inventor 淡孝强袁鹏张椅超
Owner HUAWEI TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products