WO2019095968A1 - 一种动态加载方法、目标文件的制作方法及装置 - Google Patents

一种动态加载方法、目标文件的制作方法及装置 Download PDF

Info

Publication number
WO2019095968A1
WO2019095968A1 PCT/CN2018/112220 CN2018112220W WO2019095968A1 WO 2019095968 A1 WO2019095968 A1 WO 2019095968A1 CN 2018112220 W CN2018112220 W CN 2018112220W WO 2019095968 A1 WO2019095968 A1 WO 2019095968A1
Authority
WO
WIPO (PCT)
Prior art keywords
symbol
index
address
module
file
Prior art date
Application number
PCT/CN2018/112220
Other languages
English (en)
French (fr)
Inventor
陈新中
黄基松
黄雁辉
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2019095968A1 publication Critical patent/WO2019095968A1/zh
Priority to US16/877,827 priority Critical patent/US10908925B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44568Immediately runnable code
    • G06F9/44578Preparing or optimising for loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication

Definitions

  • Embodiments of the present invention relate to the field of software dynamic loading technologies, and in particular, to a dynamic loading method, a method and apparatus for creating an object file.
  • each additional function means adding several applications, so developers need to consider different when writing the code of the application.
  • the code can usually be compiled into a dynamic link library file, when the application is executed, the dynamic link library file can be loaded, the process is dynamic loading process. Therefore, with dynamic loading, developers do not need to write the same code in different programming tasks (such as applications), that is, a dynamic link library can serve multiple applications, which greatly saves the memory space of the terminal device. .
  • the specific process of using the dynamic link library file is that the terminal device searches for the symbol address in the global symbol table according to the symbol name of the application file, and FIG. 1 shows the global symbol in the prior art.
  • FIG. 1 shows the global symbol in the prior art.
  • the memory resources occupied by the string name in the global symbol table are relatively large, so the memory resources consumed by the terminal device during the dynamic loading process are large.
  • the embodiment of the invention provides a dynamic loading method, a method and a device for manufacturing an object file, which are used to solve the technical problem that the current dynamic loading mode consumes too much resources.
  • the embodiment of the present invention provides a dynamic loading method, which may be described from the perspective of a terminal device, where the terminal device may be a mobile phone, an IPAD, or the like.
  • the method includes: loading a dynamic link library file, wherein the dynamic link library file includes a symbol capable of implementing a specific function in the application during operation of an application in the terminal device; the symbol includes a function and/ Or variable; reading a first array index index from a source file of the application; determining a first symbol address corresponding to the first index from a global symbol table; the first symbol address is used to indicate that a physical address of the symbol of the specific function; calling the symbol from the dynamic link library file according to the first symbol address to complete operation of the application.
  • the dynamic link library file includes symbols required by the application during the running process, so when the terminal device runs the application, the dynamic link library file can be loaded, and the terminal device reads from the source file of the application. Taking the first index, and then determining the first symbol address corresponding to the first index in the global symbol table, and then calling the symbol from the dynamic link library file according to the first symbol address, since the index itself occupies relatively less memory, which helps To save resources.
  • the method when the terminal device loads the dynamic link library file, the method includes: storing the dynamic link library file in a memory of the terminal device; reading from the st_name code in the dynamic link library file a first index; determining a second symbol address corresponding to the first index according to a mapping relationship between the first index and the second symbol address; the second symbol address is used to indicate that the dynamic link library file can be implemented a logical address of a symbol of a specific function; relocating the second symbol address to obtain the first symbol address; filling the first symbol address in the dynamic link library file to complete the dynamic link The loading of the library file.
  • the first index can be read in the dynamic link library file, and then determined according to the mapping relationship between the first index and the second symbol address.
  • the terminal device loads dynamic library files and uses less memory resources.
  • the method when determining, by the terminal device, the first symbol address corresponding to the first index in the global symbol table, the method includes: constructing the global symbol table; and the global symbol table includes the first index and the first a mapping relationship between the symbol addresses; determining a first symbol address corresponding to the first index according to a mapping relationship between the first index and the first symbol address.
  • the global symbol table includes a mapping relationship between the first index and the first symbol address. Since the index occupies less memory resources, the global symbol table occupies less memory resources.
  • the method when determining, by the terminal device, the first symbol address corresponding to the first index in the global symbol table, the method includes: constructing the global symbol table; and the global symbol table includes the first symbol An address, and the first symbol address is sorted in a certain order; and the first symbol address in the global symbol table having the same sorting number as the value of the first index is read.
  • the global symbol table may only include the first symbol address, and occupy less memory resources, which helps save resources.
  • the method when the terminal device determines the first symbol address corresponding to the first index according to the mapping relationship between the first index and the first symbol address, includes: determining a function module to which the first index belongs The function module is configured to indicate a module in the dynamic link library file capable of implementing the specific function; determine a module symbol table corresponding to the function module from the global symbol table; and the module symbol table includes a mapping relationship between a first symbol address of the symbol in the function module and a first index; the symbol is used to indicate a function and/or a variable in the function module for implementing the specific function; The mapping relationship between the first symbol address and the first index in the table reads the first symbol address corresponding to the first index.
  • the global symbol table includes different module symbol tables, and each module symbol table includes a first symbol address of a symbol in the function module corresponding to the module symbol table, and the terminal device belongs to the first index.
  • the first symbol address corresponding to the first index is searched in the module symbol table corresponding to the function module, and the operation is convenient, and the index itself occupies less memory resources, which helps save resources.
  • the terminal device determines the function module to which the first index belongs, including: acquiring a second index associated with the first index; and determining a mapping relationship between the function module and the second index The functional module corresponding to the second index is described.
  • the terminal device may determine, according to the mapping relationship between the function module and the second index, the function module corresponding to the read second index, because the memory resources occupied by the index itself are relatively small, which is helpful. Save memory resources.
  • an embodiment of the present invention provides a method for fabricating an object file.
  • the method can be described from the perspective of the authoring device of the object file, and the device for creating the object file can be any device having the capability of creating the object file, such as a compiling server.
  • the method includes: determining a symbol name of a symbol included in a source code of an object file; the symbol is used to indicate a function or a variable in the source code capable of implementing a specific function; determining a relationship according to a mapping relationship between a symbol name and an array index index An index corresponding to the symbol name; the target file is generated according to the index.
  • the creation device of the object file for example, the compiling server determines the index corresponding to the symbol name of the symbol included in the source code of the target file in the process of creating the object file, and then generates the object file according to the index. For example, replace the symbol name originally stored in the target file with index. In this way, the target file contains the index corresponding to the symbol name of the symbol, and the target file has less occupied space, which is convenient for the use of the terminal device.
  • the target file is a dynamic link library file and/or a source file of an application.
  • the object file may be other files, and the above is only an example, and the embodiment of the present invention does not specifically limit the same.
  • the method when the compiling server generates the target file according to the index, the method includes: determining a location in the target file for storing a symbol name; and filling the index at the location.
  • the compiling server fills the index corresponding to the symbol name of the symbol at the position where the symbol name is stored, which is convenient for reading.
  • the location is in the st_name code segment in the object file.
  • the compile server may further store the index corresponding to the symbol name of the symbol in another location, which is not specifically limited in this embodiment of the present invention.
  • an embodiment of the present invention provides a terminal device, where the terminal device has a function of implementing a terminal device in the foregoing method design.
  • These functions can be implemented in hardware or in software by executing the corresponding software.
  • the hardware or software includes one or more units corresponding to the functions described above.
  • the specific structure of the terminal device may include a load module, a read module, a determination module, and a symbol call module. These modules or units may perform the respective functions of the methods provided by the first aspect or any of the possible designs of the first aspect described above.
  • an embodiment of the present invention further provides an apparatus for creating an object file.
  • the device has the function of implementing a compiling server in the above method design. These functions can be implemented in hardware or in software by executing the corresponding software.
  • the hardware or software includes one or more units corresponding to the functions described above.
  • the specific structure of the three-dimensional modeling apparatus may include a determination module and a file generation module. These modules or units may perform the respective functions of the methods provided by any of the possible aspects of the second aspect or the second aspect described above.
  • an embodiment of the present invention further provides a terminal device.
  • the terminal device has the function of implementing the terminal device in the above method design. These features can be implemented in hardware.
  • the terminal device includes a memory for storing computer executable program code, a processor, and a processor coupled to the memory.
  • the program code stored in the memory includes instructions that, when executed by the processor, cause the terminal device to perform the method performed by the terminal device in any of the possible aspects of the first aspect or the first aspect described above.
  • an embodiment of the present invention further provides an apparatus for creating an object file.
  • the object file creation device has the function of compiling the server in the above method design. These features can be implemented in hardware.
  • the device for creating the object file includes: a memory for storing computer executable program code; a processor, the processor coupled to the memory.
  • the program code stored in the memory includes instructions, when the processor executes the instructions, the instructions cause the object creation device to execute the second aspect or the second aspect of any of the possible designs executed by the compile server method.
  • the embodiment of the present invention further provides a computer readable storage medium, where the computer readable storage medium stores instructions, when executed on a computer, causing the computer to execute the dynamic loading method according to the first aspect. .
  • the embodiment of the present invention further provides a computer readable storage medium, where the computer readable storage medium stores instructions, when executed on a computer, causing the computer to execute the target file according to the second aspect. Production Method.
  • the embodiment of the present invention further provides a computer program product comprising instructions, when executed on a computer, causing the computer to perform the dynamic loading method of the first aspect.
  • an embodiment of the present invention further provides a computer program product comprising instructions, when executed on a computer, causing a computer to execute the method for fabricating the object file according to the second aspect.
  • the dynamic link library file includes symbols required by the application during the running process, so when the terminal device runs the application, the dynamic link library file can be loaded and then read from the source file of the application.
  • the first index and then determining the first symbol address corresponding to the first index in the global symbol table, and then calling the symbol from the dynamic link library file according to the first symbol address, since the index itself occupies relatively less memory, which helps save resources.
  • FIG. 1 is a schematic structural diagram of a global symbol table in the prior art
  • FIG. 2 is a schematic diagram of an application scenario according to an embodiment of the present disclosure
  • FIG. 3 is a flowchart of a method for loading an object file according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of content stored in each code segment in an object file according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of loading a dynamic link library file by a terminal device in the prior art
  • FIG. 6 is a schematic diagram of a terminal device loading a dynamic link library file according to an embodiment of the present invention.
  • FIG. 12 is a schematic diagram of determining, by a terminal device, a first symbol address from a global symbol table according to an embodiment of the present invention
  • FIG. 13 is a schematic structural diagram of a terminal device according to an embodiment of the present disclosure.
  • FIG. 14 is a schematic structural diagram of an apparatus for creating an object file according to an embodiment of the present invention.
  • FIG. 15 is a schematic structural diagram of another terminal device according to an embodiment of the present disclosure.
  • FIG. 16 is a schematic structural diagram of another apparatus for creating an object file according to an embodiment of the present invention.
  • Object file a file for storing symbols (or codes).
  • An object file usually contains a plurality of symbols, and the symbols can be variables or functions. After the terminal device loads the target file, it can run its internally stored symbols to implement specific functions.
  • object files such as source files of application files, executable and linkable format (ELF) files, dynamic link library files, redirectable files, shared object files, core dump files, and the like.
  • a dynamic link library file is an unexecutable binary program file containing symbols (codes) and other resources that can be shared by multiple applications of the terminal device. When the application in the terminal device is executed, the corresponding symbol can be called from the dynamic link library to complete the execution of the application.
  • dynamic link library files are usually .DLL files (suffixed with .DLL).
  • dynamic link library files are usually .so files (suffix .so).
  • Dynamic link library files are usually stored in the C/System directory.
  • dynamic link library files can greatly save the application space, that is, the common symbols used by multiple applications can be stored in the dynamic link library file, when the application is executed, from the dynamic link library The symbol can be called in the file. Due to the use of dynamic link library files, the application is not too large.
  • the symbol address that is, the storage address of the symbol
  • the symbol after the terminal device determines the symbol address, the symbol can be loaded according to the symbol address, and then the target file is loaded.
  • a symbolic address usually has a logical address and an actual physical address.
  • a logical address can be understood as a logical address defined for each symbol by a programmer during the process of writing a program.
  • the physical address is the real storage address of the symbol in the memory of the terminal device. When the application of the terminal device calls the symbol, the physical address of the symbol is usually used.
  • symbol name that is, the name of the symbol.
  • the symbol name is the variable name or function name, which is generally composed of letters, numbers, and underscores.
  • array index the so-called array is a collection of similar data elements arranged in order. It can also be understood as numbering a finite number of variables or functions of the same type. The number of each variable or function can be called an array label or an array index.
  • the array index can be binary, decimal, and so on.
  • Relocation the process of transforming the logical address of the symbol of the target file into the actual physical address in the memory, can also be understood as the process of modifying the instruction or data in the target file when the target file is loaded, as mentioned above.
  • the physical address of the symbol is usually used, and the symbol address (logical address) used by the compiler when compiling the symbol is not necessarily suitable for the actual physical address in the memory of the terminal device, so the symbol is called. Previously, you needed to relocate the symbolic address.
  • the application scenario provided by the embodiment of the present invention includes two parts, a first part is a compiling server, and a second part is a terminal device.
  • the compiling server may also be other servers, as long as it can be used to compile the code to generate the target file
  • the terminal device may be a mobile phone, a tablet computer or the like.
  • the compiling server is used to compile and generate the object file, that is, the compiler compiles the code by compiling the server, and then generates the object file.
  • the specific process is that the compiling server includes the compiling system, and the compiler inputs the source code through the compiling server, and the source code is compiled by the system. , output the target file.
  • the terminal device is used to load and run the target file generated by the compile server.
  • the target file may be a source file of an application file or a dynamic link library file.
  • the dynamic link library file can be loaded when the application in the terminal device is executed.
  • the specific process of using the dynamic link library file is that the terminal device searches for the symbol address in the global symbol table according to the symbol name of the application file, and FIG. 1 shows the global symbol in the prior art. A schematic diagram of the table, and then the symbol is called from the loaded dynamic library based on the symbolic address.
  • the memory resources occupied by the string name in the global symbol table are relatively large, so the memory resources consumed by the terminal device during the dynamic loading process are large.
  • an embodiment of the present invention provides a dynamic loading method. That is, during the running of the application in the terminal device, the dynamic link library file is loaded, and the dynamic link library file contains symbols capable of implementing specific functions in the application; the symbols include functions and/or variables Reading a first array index index from a source file of the application; determining a first symbol address corresponding to the first index from a global symbol table; the first symbol address is used to indicate that the The physical address of the symbol of the particular function; the symbol is invoked from the dynamic link library file according to the first symbol address to complete the operation of the application.
  • the index since the index itself occupies relatively less memory, it helps to save memory resources.
  • FIG. 3 is a flowchart of a method for manufacturing an object file according to an embodiment of the present invention. Taking the application scenario shown in FIG. 2 as an example, the method is applicable to the compiling server in FIG. 2. Therefore, FIG. 3 can also be understood as a schematic diagram of information interaction between the compiling server and the terminal device in FIG. 2. The process of this method is described as follows:
  • the compiling server determines a symbol name of a symbol included in the source code, and the symbol is used to indicate a function or a variable in the source code that can implement a setting function.
  • the compiler inputs the source code through the compile server.
  • the source code contains multiple symbols and the symbolic name of each symbol.
  • the symbol here can be a variable or a function
  • the symbol name is a variable name or a function name.
  • the compiler input source code contains five functions, and the compile server determines that the function names of the five functions are fun1, fun2, fun3, fun4, and fun5.
  • the compiling server determines an index corresponding to the symbol name according to the mapping relationship between the symbol name and the array index index.
  • the index may be binary, decimal, hexadecimal, or the like.
  • the compiling server may store the mapping relationship between the symbol name and the array index index in advance. After determining the symbol name of the symbol included in the source code, the mapping corresponding to each symbol name may be queried in the mapping relationship between the symbol name and the index. Index.
  • the symbol names of each symbol can also be directly sorted, and the symbol names of each symbol correspond to a sorting number, which will be sorted.
  • the number (decimal, binary, etc.) can be used as the index.
  • S303 The compiling server generates an object file according to the index.
  • the compiler compiles the source code by compiling different code segments to complete the compilation of the source code. Different code segments store different symbols (variables or functions) to implement different functions. Therefore, if the compile server determines the index corresponding to each symbol name, you can directly fill the index in the object file to be generated, or if the compile server sorts the symbol names of each symbol, you can directly sort the number (binary , decimal, etc.) is populated in the target file to be generated to generate the target file.
  • the compiling server may fill the index in the target file by implementing the method, the compiling server determines the location of the object file to be generated for storing the symbol name, and then replacing the symbol name with the index, that is, filling the index at the position. At the office.
  • the target file is a dynamic link library file .so file.
  • the location of the .so file used to store the symbol name is the st_name code segment in the dynsym segment code segment. Therefore, the compile server can fill the index in the st_name code segment.
  • the symbol names determined in the compile server are fun1, fun2, fun3, fun4, and fun5, respectively, and the index corresponding to fun1, fun2, fun3, fun4, and fun5 is determined according to the mapping relationship between the symbol name and the index.
  • the decimal) is 1, 2, 3, 4, and 5, and the compile server fills the index in the st_name code segment.
  • the .so file includes a .rel code segment, and the .rel code segment is included. Contains the .dynsym code segment.
  • the st_name code segment in the dynsym code segment is used to store the index. As shown in Figure 4, the st_name code segment stores the corresponding index of 1-5 for each of the five symbols.
  • the compile server can also store the index at other locations, or set a separate code segment for storing the index. No matter where the index is stored, as long as the terminal device can read the index, can.
  • the source file of the application often also contains the symbolic names (or symbol pointers) of these symbols.
  • the terminal The device calls the symbol corresponding to the symbol name from the dynamic link library file. Therefore, in the embodiment of the present invention, when the compile server creates the source file of the dynamic link library file and the application, the mapping relationship between the symbol name and the index used may be the same, that is, the created dynamic link library file and the application program. The index in the source file is corresponding.
  • the target file can be the source file of the application
  • the source file of the application can be loaded into its own memory for execution.
  • the terminal device has loaded the source file of the application created by the compiling server into the memory and runs the application as an example, that is, the terminal device uses the dynamic link library file to complete the running process of the application.
  • the process of the terminal device running the application using the dynamic link library file includes:
  • S304 loading, in a running process of the application in the terminal device, a dynamic link library file, where the dynamic link library file includes a symbol capable of implementing a specific function in the application; the symbol includes a function and/or a variable .
  • the dynamic link library file contains symbols that are frequently used when the application is executed, that is, the dynamic link library file needs to be loaded when the application is executed, so when the application in the terminal device is executed, the first The dynamic link library file is loaded in the operating system of the terminal device for use by the application.
  • the process of loading a dynamic link library file by the terminal device is described below.
  • the process of loading the dynamic link library file by the terminal device may be performed in five steps.
  • the terminal device stores the dynamic link library file in its own memory.
  • the second step from the dynamic The first index is read in the st_name code in the link library file; the third step is to determine the second symbol address corresponding to the first index according to the mapping relationship between the first index and the second symbol address;
  • the symbol address is used to indicate a logical address of the symbol in the dynamic link library file capable of implementing the specific function;
  • the second symbol address is relocated to obtain the first symbol address; Filling the first symbol address in the dynamic link library file to complete loading of the dynamic link library file.
  • the terminal device can download the dynamic link library file from the compile server and store the dynamic link library file in its own memory.
  • the compile server fills the first index in the st_name code when creating the dynamic link library file
  • the terminal device only needs to read the first index.
  • the terminal device loads the mapping relationship between the first index and the second symbol address, and determines a second symbol address corresponding to the first index from the mapping relationship, where the determined second symbol address is a logical address.
  • the second symbol address is a logical address used by the compiler when writing the code
  • the logical address can be stored, and then the first index and the logical address (the second symbol address) are established. Mapping relationship.
  • the process of establishing a mapping relationship between the first index and the logical address may be performed by the terminal device itself. Of course, in order to alleviate the pressure of the terminal device, it may also be executed by the compiling server. If it is executed by the compiling server, in the third step, the terminal device Simply load the mapping from the build server.
  • FIG. 5 is a schematic diagram showing loading of a dynamic link library file by a terminal device in the prior art.
  • the compile server stores the symbol name of each symbol in the dynamic link library file, and constructs a mapping relationship between the symbol name and the second symbol address. Therefore, in FIG. 10, after the terminal device loads the dynamic link library file, after reading the symbol name of each symbol from the dynamic link library file, the mapping corresponding to the symbol name is determined according to the mapping relationship between the symbol name and the second symbol address. The second symbol address. Since the character name is usually a string and the memory resources occupied are large, the memory resources occupied by the dynamic link library file in the prior art are large.
  • FIG. 6 is a schematic diagram of a terminal device loading a dynamic link library file in an embodiment of the present invention.
  • the compile server fills the index corresponding to the symbol name in the dynamic link library file, so the compile server constructs the mapping relationship between the index and the second symbol address. Therefore, in FIG. 11, the terminal device reads five first indexes from the st_name code segment in the .dynsym code segment in the .rel code segment in the dynamic link library file, respectively, index1-index5, and then from index and A second symbol address corresponding to each index is determined in a mapping relationship of the second symbol address. Therefore, the terminal device uses less memory resources in the process of loading the dynamic link library file, and saves resources.
  • the fourth step can be implemented in various ways.
  • the terminal device can read the relocation information from the r_info code segment in the .reldyn segment in the .rel code segment in the dynamic link library file. Then, the second symbol address is relocated according to the relocation information.
  • the simple implementation process is that the terminal device can add the relocation information (symbol offset address) to the second symbol address to obtain the relocated symbol. Address, the first symbol address.
  • the re-positioning of the symbol address may take other manners, which is not specifically limited in this embodiment of the present invention.
  • the fifth step may be performed, that is, the first symbol address after the relocation is filled into the dynamic link library file, and the loading of the dynamic link library file is completed.
  • the terminal device can fill the symbol address after the relocation into the .got code segment indicated by r_offset in the rel code segment, that is, complete the loading.
  • S305 The terminal device reads the first array index index from the source file of the application.
  • the compiling server stores the index at the corresponding position in the source file, so the terminal device only needs to read the index at the corresponding position.
  • the mapping relationship between the symbol name and the index used by the compiling server can be the same, that is, the generated dynamic link library file and the source file of the application are in the same.
  • the index is corresponding. Therefore, the first index read by the terminal device from the source file of the application in S305 is the same symbol as the first index in the dynamic link library file.
  • the terminal device determines a first symbol address corresponding to the first index from the global symbol table; the first symbol address is used to indicate a physical address of a symbol capable of implementing the specific function.
  • the terminal device Prior to S305, the terminal device needs to obtain a global symbol table.
  • the following is a method for receiving the terminal device to obtain a global symbol table.
  • the compiling server can establish a mapping relationship between the first index and the second symbol address (logical address), and the first symbol address is obtained by relocating the second symbol address. Therefore, the terminal device may further establish a mapping relationship between the first index and the first symbol address, and the mapping relationship may directly serve as a global symbol table.
  • FIG. 7 is a schematic diagram of a first global symbol table provided by an embodiment of the present invention.
  • the global symbol table includes a mapping relationship between the first index and the first symbol address. Since the index itself occupies less memory resources, the global symbol table occupies relatively small resources and saves resources.
  • all the first symbol addresses may be directly sorted according to a certain order, and the first symbol address that is sorted may be directly used as a global symbol table, that is, in the global symbol table.
  • the value of index is null and contains only the first symbol address.
  • FIG. 8 is a schematic diagram of a second global symbol table provided by an embodiment of the present invention. As shown in Figure 8, the global symbol table contains only the first symbol address. In the second mode, since the global symbol table only contains the first symbol address, the global symbol table occupies less memory resources and saves resources.
  • the dynamic link library file may include more than one function module, and each function module includes multiple symbols for implementing specific functions, and the function module herein may be understood as dynamic.
  • Sub-files in the link library, etc., that is, different functional modules can implement different functions. Therefore, when constructing the global symbol table, the terminal device can set up a separate module symbol table for each functional module, and the module symbol table of all functional modules constitutes a global symbol table.
  • the compile server when compiling a dynamic link library file, can store a symbol capable of implementing a specific function as a function module as a whole, and the symbol is a function, for example, the function fun1-fun3 is used to implement a certain function.
  • the three functions are stored as a whole in the file corresponding to the function module. Therefore, when constructing the global symbol table, the terminal device only needs to read the symbols included in the kinetic module in the file corresponding to each function module.
  • the first index can be.
  • a module identifier such as a module ID may be added for each functional module, and then a module symbol table is constructed for each functional module, thereby obtaining a global symbol table, so this
  • the global symbol table includes not only the first symbol address of the symbol included in each function module, but also the module ID of each function module.
  • FIG. 9 is a schematic diagram of a third global symbol table according to an embodiment of the present invention.
  • the global symbol table includes a first symbol address and a module ID, where each first symbol address corresponds to an index.
  • Each module ID also corresponds to an index. To distinguish, the first symbol address corresponds to the first index, and the module ID corresponds to the second index.
  • the global symbol table includes not only the first symbol address of the symbol included in each function module, but also the module ID of each function module, and all the module IDs and the first symbol address are in a certain order. Sorting, that is, each module ID has a sort number, and each first symbol address also has a sort number.
  • FIG. 10 is a schematic diagram of a fourth global symbol table according to an embodiment of the present invention. As shown in FIG. 10, the first symbol address and the module ID in the global symbol table are sorted in a certain order.
  • the global symbol table includes not only the symbol address of the symbol included in each function module, but also the module ID of each function module, where each module ID corresponds to one module symbol table, and each module The symbol table contains the symbolic addresses of all the symbols contained in each module. For example, if the global symbol table contains three module IDs, one of which is module 0, the module symbol table corresponding to module 0 contains the symbol addresses of all symbols included in module 0, and each symbol address starts with 0. That is, the index corresponding to the first symbol address may be 0x0001, and the subsequent other symbol addresses in the symbol table of the module are analogous.
  • FIG. 11 is a schematic diagram of a fifth global symbol table provided by an embodiment of the present invention. As shown in FIG. 11, the global symbol table includes two modules and a module symbol table corresponding to each module.
  • the above only enumerates five possible implementations of the global symbol table.
  • the above five methods can be combined, for example, some first symbol addresses or module IDs in the global symbol table are sorted in a certain order.
  • Another first symbol address or module ID of the other part of the first symbol address or module ID is for an index, as long as the first symbol address or module ID can be uniquely identified.
  • the S306 can be executed, that is, the terminal device determines the first symbol address corresponding to the first index from the global symbol table. Since five global symbol tables are introduced above, different implementations of S306 for different global symbol tables will be described below.
  • the mapping relationship between the first index and the first symbol address is included in the global symbol table. Therefore, after the terminal device reads the first index from the source file of the application, the first symbol address corresponding to the first index may be searched in the global symbol table.
  • each first symbol address corresponds to a sort number.
  • the terminal device After the terminal device reads the first index from the source file of the application, if the value of the first index is the same as the sequence number of the first symbol address, the terminal device determines that the first symbol address is the first The first symbol address corresponding to index.
  • the terminal device reads five first indexes, that is, index1-index5, from the source file of the application, and the value is divided into 1-5, and then the terminal device determines that the sorting numbers are respectively in the global symbol table.
  • the first symbolic address of 1-5 namely addr1, addr2, addr3, addr4, addr5.
  • the global symbol table includes the first symbol address and the module ID, wherein the first symbol address corresponds to the first index, and the module ID corresponds to Second index. If the first index and the second index are the high and low bits of the same index, that is, after the terminal device reads the first index in the source file of the application, the module ID may be determined according to the upper part of the first index, according to the first index. The lower part determines the first symbol address.
  • the first index read by the terminal device from the source file of the application is a 32-bit integer, and the index can be divided into two parts: a high bit and a low bit, for example, a high 12 bit and a low 20 bit.
  • the upper 12 bits are used as the counting part of the module ID
  • the lower 20 bits is used as the counting part of the symbol address, that is, the terminal device determines the module ID from the global symbol table according to the high 12 bits, and then determines the first symbol address from the global symbol table according to the lower 20 bits.
  • the index can also be 8bit, 16bit or 64bit, etc., that is, the bit width of the index can be determined according to the actual situation, wherein the bit width of the module ID and the first symbol address can also be determined according to actual conditions.
  • the embodiment of the invention is not specifically limited.
  • the terminal device may further read the second index from the source file of the application, and then determine the module ID corresponding to the second index from the global symbol table, and according to the reading The first index is determined from the global symbol table by the first symbol address corresponding to the first index.
  • the global symbol table includes the module ID and the first symbol address, and the module ID and the first symbol address are sorted in a certain order, that is, Each module ID corresponds to a sort number, and each first symbol address corresponds to a sort number.
  • the terminal device reads the first index from the source file of the application, the first symbol address whose sorting number is the same as the value of the first index may be determined in the global symbol table.
  • the module ID may be determined according to the upper part of the first index, and the first symbol address is determined according to the lower part of the first index.
  • the first index read by the terminal device is a 32-bit integer, and the index can be divided into two parts: a high bit and a low bit, for example, a high 12 bit and a low 20 bit.
  • the terminal device may determine the module ID whose sort number is the same as the value of the upper 12 bits from the global symbol table, and determine the first symbol address whose sort number is the same as the value of the lower 20 bit from the global symbol table.
  • each functional module since the first symbol address of the symbol included in each function module is included in the global symbol table, each functional module may also be included.
  • a module ID wherein each module ID corresponds to a module symbol table, and each module symbol table includes a first symbol address of all symbols included in each module.
  • the first index read by the terminal device is a 32-bit integer, and the index can be divided into two parts: a high bit and a low bit, for example, a high 12 bit and a low 20 bit.
  • the terminal device determines the module ID with the same sorting number as the high 12-bit value from the global symbol table, the first symbol address with the same sorting value as the lower 20-bit value may be determined in the module symbol table corresponding to the module ID.
  • the first symbol address can be obtained from the global symbol table through the dlsym function interface.
  • the function interface used in the prior art to obtain the symbol address from the global symbol table is usually void*dlsym(void*handle, const char *symbol).
  • symbol is the symbol name of the symbol to be obtained
  • function return value is void*, pointing to the symbolic address of the symbol (function address), for calling, that is, existing
  • the dlsym function in the technology needs to read the symbol name and then return the symbol address corresponding to the symbol name.
  • the global symbol table includes the mapping relationship between the index and the first symbol address, so the dlsym function interface only needs to be read. Index, return the first symbol address corresponding to index.
  • the dynamic link library file may be used by multiple applications, and different applications may call different symbols in the dynamic link library file, so when an application needs a certain dynamic link library file
  • the terminal device may construct a global symbol table including a mapping relationship between the first index and the first symbol address of the symbols, and when other applications need to dynamically link other symbols in the library file, the terminal device
  • the global symbol table may be further supplemented by adding a mapping relationship between the first index of the other symbols and the first symbol to the global symbol table.
  • the dynamic link library file stores the symbols used when the application is executed, so after the terminal device determines the first symbol address corresponding to the first index, that is, the physical address, the terminal device determines the dynamic link library file.
  • the physical address of the symbol stored in the terminal device so the terminal device can invoke the symbol in the dynamic link library according to the first symbol address.
  • the dynamic link library file when the terminal device needs to dynamically link the library file, the dynamic link library file may be loaded through the dlopen function interface. When the terminal device does not need the dynamic link library file, the dynamic link library file may be released through the dlclose function interface. A global symbol table to save memory resources of the terminal device.
  • the method for creating an object file for example, replaces the symbol name in the target file (the dynamic link library file or the source file in the application) with the first index, and completes the creation of the target file.
  • the embodiment of the invention further provides a dynamic loading mode.
  • the dynamic link library file When the terminal device needs to use the symbols in the dynamic link library file when running the application, the dynamic link library file is loaded, and a global symbol table is included, and the global symbol table includes a mapping relationship between the first index and the first symbol address, after the first index is read in the source file of the terminal device reading application, the first symbol address corresponding to the first index may be determined from the global symbol table, and then according to the first A symbolic address calls the symbol in the dynamic link library file to complete the application's operation.
  • the terminal device uses index, and the index itself occupies relatively little memory, which helps to save memory resources.
  • FIG. 13 shows a schematic structural diagram of a terminal device 1300.
  • the terminal device 1300 can implement the functions of the terminal device referred to above.
  • the terminal device 1300 can include a loading module 1301, a reading module 1302, a determining module 1303, and a symbol calling module 1304.
  • the loading module 1301 can be used to perform S304 in the embodiment shown in FIG. 3, and/or other processes for supporting the techniques described herein.
  • the reading module 1302 can be used to perform S305 in the embodiment shown in FIG. 3, and/or other processes for supporting the techniques described herein.
  • the determination module 1303 can be used to perform S306 in the embodiment shown in FIG. 3, and/or other processes for supporting the techniques described herein.
  • the symbol invocation module 1304 can be used to perform S307 in the embodiment shown in FIG. 3, and/or other processes for supporting the techniques described herein. All the related content of the steps involved in the foregoing method embodiments may be referred to the functional descriptions of the corresponding functional modules, and details are not described herein again.
  • the foregoing terminal device is displayed in the form of a functional unit.
  • the term "unit” as used herein, without limitation, may refer to an application-specific integrated circuit (ASIC), electronic circuit, (shared, dedicated, or group) that executes one or more software or firmware programs.
  • a processor and memory, combinational logic, and/or other suitable components that provide the described functionality.
  • FIG. 14 is a block diagram showing the structure of an apparatus 1400 for creating an object file.
  • the object file creation device 1400 can implement the functions of the compile server referred to above.
  • the object creation device 1400 can include a determination module 1401 and a file generation module 1402.
  • the determining module 1401 can be used to perform S301-S302 in the embodiment shown in FIG. 3, and/or other processes for supporting the techniques described herein.
  • File generation module 1402 can be used to perform S303 in the embodiment shown in FIG. 3, and/or other processes for supporting the techniques described herein. All the related content of the steps involved in the foregoing method embodiments may be referred to the functional description of the corresponding function module, and details are not described herein again.
  • the device for creating the target file is displayed in the form of a functional unit.
  • the term "unit” as used herein, without limitation, may refer to an application-specific integrated circuit (ASIC), electronic circuit, (shared, dedicated, or group) that executes one or more software or firmware programs.
  • terminal device shown in FIG. 13 can also be implemented by the structure shown in FIG.
  • the terminal device 1500 may include a memory 1501, a processor 1502, and a bus 1503.
  • the memory 1501 and the processor 1502 can be connected by a bus 1503.
  • the memory 1501 is configured to store computer execution instructions.
  • the processor 1502 executes computer execution instructions stored in the memory 1501 to cause the terminal device 1500 to execute the dynamic loading method provided by the embodiment shown in FIG. 3.
  • the dynamic loading method For a specific dynamic loading method, refer to the related descriptions in the above and the drawings, and details are not described herein again.
  • the processor 1502 may be a field-programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), and a central unit.
  • the bus 1503 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus 1503 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 15, but it does not mean that there is only one bus or one type of bus.
  • the object file creation apparatus 1600 may include a memory 1601, a processor 1602, and a bus 1603.
  • the memory 1601 and the processor 1602 can be connected by a bus 1603.
  • the memory 1601 is configured to store computer execution instructions.
  • the processor 1602 executes the computer execution instructions stored in the memory 1601, so that the target file creation device 1600 performs the embodiment shown in FIG. Dynamic loading method.
  • FIG. Dynamic loading method For a specific dynamic loading method, refer to the related descriptions in the above and the drawings, and details are not described herein again.
  • the processor 1602 may be a field-programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), and a central unit.
  • the bus 1603 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus 1603 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 16, but it does not mean that there is only one bus or one type of bus.
  • the method for creating an object file for example, replaces the symbol name in the target file (the dynamic link library file or the source file in the application) with the first index, and completes the target file. Production.
  • the embodiment of the invention further provides a dynamic loading mode.
  • the terminal device needs to use the symbols in the dynamic link library file when running the application, the dynamic link library file is loaded, and a global symbol table is included, and the global symbol table includes a mapping relationship between the first index and the first symbol address, after the first index is read in the source file of the terminal device reading application, the first symbol address corresponding to the first index may be determined from the global symbol table, and then according to the first A symbolic address calls the symbol in the dynamic link library file to complete the application's operation.
  • the terminal device uses index, and the index itself occupies relatively little memory, which helps to save memory resources.
  • the invention may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions.
  • the computer program instructions When the computer program instructions are loaded and executed on a computer, the processes or functions described in accordance with embodiments of the present invention are generated in whole or in part.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another readable storage medium, for example, the computer instructions can be passed from a website site, computer, server or data center Wired (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.) to another website site, computer, server, or data center.
  • the computer readable storage medium can be any available media that can be accessed by a computer or a data storage device such as a server, data center, or the like that includes one or more available media.
  • the usable medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)) or the like.
  • a magnetic medium eg, a floppy disk, a hard disk, a magnetic tape
  • an optical medium eg, a DVD
  • a semiconductor medium eg, a solid state disk (SSD)

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)
  • Stored Programmes (AREA)

Abstract

一种动态加载方法、目标文件的制作方法及装置。该方法包括:在终端设备中的应用程序的运行过程中,加载动态链接库文件,所述动态链接库文件中包含能够实现所述应用程序中的特定功能的符号;所述符号包括函数和/或变量;从所述应用程序的源文件中读取第一数组索引index;从全局符号表中确定与所述第一index对应的第一符号地址;所述第一符号地址用于指示能够实现所述特定功能的符号的物理地址;根据所述第一符号地址从所述动态连接库文件中调用所述符号,完成所述应用程序的运行。在这种动态加载过程中,index占用的内存空间较小,节省资源。

Description

一种动态加载方法、目标文件的制作方法及装置
本申请要求于2017年11月20日提交中国专利局、申请号为201711160959.1、申请名称为“一种动态加载方法、目标文件的制作方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明实施例涉及软件动态加载技术领域,尤其涉及一种动态加载方法、目标文件的制作方法及装置。
背景技术
随着计算机技术的发展,终端设备的功能越来越多,对于开发人员来说,每增加一个功能,就意味着增加若干的应用程序,所以开发人员在编写应用程序的代码时,需要考虑不同的应用程序的业务需求是否有重叠,对于重叠的部分,其代码通常可以被编译为一个动态链接库文件,当应用程序被执行时,加载该动态链接库文件即可,这个过程即为动态加载过程。因此,采用动态加载的方式,开发人员不需要在不同的编程任务(例如应用程序)中编写同样的代码,即一个动态链接库可以为多个应用程序服务,大大的节省了终端设备的内存空间。
目前,终端设备的应用程序被执行时,使用动态链接库文件的具体过程为,终端设备根据应用程序文件的符号名在全局符号表中寻找符号地址,图1示出了现有技术中全局符号表的示意图,然后根据符号地址从加载的动态库中调用符号。在实际操作过程中,由于全局符号表中的字符串名本身占用的内存资源比较大,所以终端设备在动态加载的过程中,消耗的内存资源较大。
发明内容
本发明实施例提供一种动态加载方法、目标文件的制作方法及装置,用以解决目前的动态加载方式消耗资源太大的技术问题。
第一方面,本发明实施例提供一种动态加载方法,该方法可以从终端设备的角度进行描述,终端设备可以是手机、IPAD等设备。该方法包括:在终端设备中的应用程序的运行过程中,加载动态链接库文件,所述动态链接库文件中包含能够实现所述应用程序中的特定功能的符号;所述符号包括函数和/或变量;从所述应用程序的源文件中读取第一数组索引index;从全局符号表中确定与所述第一index对应的第一符号地址;所述第一符号地址用于指示能够实现所述特定功能的符号的物理地址;根据所述第一符号地址从所述动态连接库文件中调用所述符号,完成所述应用程序的运行。
在本发明实施例中,动态链接库文件中包含应用程序在运行过程中所需要的符号,所以终端设备在运行应用程序时,可以加载动态链接库文件,终端设备从应用程序的源文件中读取第一index,然后在全局符号表中确定与第一index对应的第一符号地址,进而根据第一符号地址从动态链接库文件中调用符号,由于index本身占据的内存相对较少,有助于节省资源。
在一个可能的设计中,终端设备加载动态链接库文件时,包括:将所述动态链接库文件存储于所述终端设备的内存中;从所述动态链接库文件中的st_name代码中读取所述第一index;根据第一index与第二符号地址的映射关系确定与所述第一index对应的第二符号地址;所述第二符号地址用于指示所述动态链接库文件中能够实现所述特定功能的符号的逻辑地址;对所述第二符号地址进行重定位,得到所述第一符号地址;将所述第一符号地址填充在所述动态链接库文件中,完成所述动态链接库文件的加载。
在本发明实施例中,终端设备加载动态链接库文件时,可以读取动态链接库文件中读取第一index,然后根据第一index与第二符号地址之间的映射关系确定于第一index对应的第二符号地址,然后对第二符号地址进行重定位,将重定位之后的地址填充到动态链接库文件中,完成动态链接库文件的加载,由于index占用的内存资源比较少,所以终端设备加载动态库文件占用的内存资源也较少。
在一个可能的设计中,终端设备在全局符号表中确定与所述第一index对应的第一符号地址时,包括:构建所述全局符号表;所述全局符号表中包含第一index与第一符号地址之间的映射关系;根据所述第一index与第一符号地址的映射关系确定与所述第一index对应的第一符号地址。
在本发明实施例中,全局符号表中包含第一index与第一符号地址之间的映射关系,由于index占用的内存资源较少,所以全局符号表占用的内存资源也较少。
在一个可能的设计中,终端设备在全局符号表中确定与所述第一index对应的第一符号地址时,包括:构建所述全局符号表;所述全局符号表中包含所述第一符号地址,且所述第一符号地址按照一定的顺序排序;读取所述全局符号表中排序号与所述第一index的值相同的第一符号地址。
在本发明实施例中,全局符号表中可以只包含第一符号地址,占用的内存资源更少,有助于节约资源。
在一个可能的设计中,终端设备根据所述第一index与第一符号地址的映射关系确定与所述第一index对应的第一符号地址时,包括:确定所述第一index所属的功能模块;所述功能模块用于指示所述动态链接库文件中能够实现所述特定功能的模块;从所述全局符号表中确定与所述功能模块对应的模块符号表;所述模块符号表中包含所述功能模块中的符号的第一符号地址与第一index的映射关系;所述符号用于指示所述功能模块中用于实现所述特定功能的函数和/或变量;从所述模块符号表中的第一符号地址与第一index的映射关系读取与所述第一index对应的第一符号地址。
在本发明实施例中,全局符号表中包含不同的模块符号表,每个模块符号表中包含该模块符号表对应的功能模块中的符号的第一符号地址,终端设备从第一index所属的功能模块对应的模块符号表中查找与第一index对应的第一符号地址,操作方便,而且index本身占用的内存资源比较少,有助于节约资源。
在一个可能的设计中,终端设备确定所述第一index所属的功能模块,包括:获取与所述第一index关联的第二index;从功能模块与第二index之间的映射关系确定与所述第二index对应的功能模块。
在本发明实施例中,终端设备可以根据功能模块与第二index之间的映射关系确定与所述读取的第二index对应的功能模块,由于index本身占用的内存资源比较少, 有助于节省内存资源。
第二方面,本发明实施例提供一种目标文件的制作方法。该方法可以从目标文件的制作装置的角度来描述,目标文件的制作装置可以是任何具备制作目标文件的能力的装置例如编译服务器。该方法包括:确定目标文件的源代码中所包含的符号的符号名;所述符号用于指示所述源代码中能够实现特定功能的函数或变量;根据符号名和数组索引index的映射关系确定与所述符号名对应的index;根据所述index生成所述目标文件。
在本发明实施例中,目标文件的制作装置例如编译服务器在制作目标文件的过程中,确定与目标文件的源代码中所包含的符号的符号名对应的index,然后根据index生成目标文件。例如将目标文件中原来存储的符号名替换为index。这种方式下,目标文件中包含与符号的符号名对应的index,目标文件的占用空间比较少,方便终端设备的使用。
在一个可能的设计中,所述目标文件为动态链接库文件和/或应用程序的源文件。
在本发明实施例中,目标文件还可以是其他文件,以上几种只是举例,本发明实施例对此不作具体的限定。
在一个可能的设计中,编译服务器根据所述index生成所述目标文件时,包括:确定所述目标文件中用于存放符号名的位置;将所述index填充在所述位置处。
在本发明实施例中,编译服务器将与符号的符号名对应的index填充在存放符号名的位置处,方便读取。
在一个可能的设计中,所述位置位于所述目标文件中的st_name代码段中。
在本发明实施例中,编译服务器还可以将与符号的符号名对应的index存放在其它位置,本发明实施例对此不作具体的限定。
第三方面,本发明实施例提供一种终端设备,该终端设备具有实现上述方法设计中终端设备的功能。这些功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的单元。
在一个可能的设计中,终端设备的具体结构可包括加载模块、读取模块、确定模块和符号调用模块。这些模块或单元可执行上述第一方面或第一方面的任意一种可能的设计所提供的方法中的相应功能。
第四方面,本发明实施例还提供一种目标文件的制作装置。该装置具有实现上述方法设计中编译服务器的功能。这些功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的单元。
在一个可能的设计中,三维建模装置的具体结构可包括确定模块和文件生成模块。这些模块或单元可执行上述第二方面或第二方面的任意一种可能的设计所提供的方法中的相应功能。
第五方面,本发明实施例还提供一种终端设备。该终端设备具有实现上述方法设计中终端设备的功能。这些功能可以通过硬件实现。该终端设备包括:存储器,用于存储计算机可执行程序代码;处理器,处理器与存储器耦合。其中存储器所存储的程序代码包括指令,当处理器执行所述指令时,所述指令使终端设备执行上述第一方面或第一方面的任意一种可能的设计中终端设备所执行的方法。
第六方面,本发明实施例还提供一种目标文件的制作装置。该目标文件的制作装 置具有实现上述方法设计中编译服务器的功能。这些功能可以通过硬件实现。该目标文件的制作装置包括:存储器,用于存储计算机可执行程序代码;处理器,处理器与存储器耦合。其中存储器所存储的程序代码包括指令,当处理器执行所述指令时,所述指令使目标文件的制作装置执行上述第二方面或第二方面的任意一种可能的设计中编译服务器所执行的方法。
第七方面,本发明实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面所述的动态加载方法。
第八方面,本发明实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第二方面所述的目标文件的制作方法。
第九方面,本发明实施例还提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的动态加载方法。
第十方面,本发明实施例还提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第二方面所述的目标文件的制作方法。
在本发明实施例中,动态链接库文件中包含应用程序在运行过程中所需要的符号,所以终端设备在运行应用程序时,可以加载动态链接库文件,然后从应用程序的源文件中读取第一index,然后在全局符号表中确定与第一index对应的第一符号地址,进而根据第一符号地址从动态链接库文件中调用符号,由于index本身占据的内存相对较少,有助于节省资源。
附图说明
图1为现有技术中全局符号表的结构示意图;
图2为本发明实施例提供的一种应用场景的示意图;
图3为本发明实施例提供的一种目标文件的加载方法的流程图;
图4为本发明实施例提供的目标文件中各个代码段中存储的内容的示意图;
图5为现有技术中终端设备加载动态链接库文件的示意图;
图6为本发明实施例中终端设备加载动态链接库文件的示意图;
图7-11为本发明实施例提供的五种全局符号表的结构示意图;
图12为本发明实施例中终端设备从全局符号表中确定第一符号地址的示意图;
图13为本发明实施例提供的一种终端设备的结构示意图;
图14为本发明实施例提供的一种目标文件的制作装置的结构示意图;
图15为本发明实施例提供的另一种终端设备的结构示意图;
图16为本发明实施例提供的另一种目标文件的制作装置的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例提供的技术方案进行清楚、完整地描述。
以下,对本发明实施例中的部分用语进行解释说明,以便于本领域技术人员理解。
(1)目标文件,用于存储符号(或代码)的文件,一个目标文件中通常包含多个符号,符号可以是变量或者函数。终端设备加载目标文件之后,可以运行其内部存储的符号,实现特定的功能。目标文件的种类较多例如为应用程序文件的源文件、可执行(executable and linkable format,ELF)文件、动态链接库文件、可重定向文件、共享目标文件、核心转储文件等等。
(2)动态链接库文件,是一种不可执行的二进制程序文件,其中包含有可以被终端设备的多个应用程序共享的符号(代码)和其他资源。当终端设备中的应用程序被执行时,可以从动态链接库中调用相应的符号,完成应用程序的执行。在Windows中,动态链接库文件通常为.DLL文件(后缀为.DLL),在linux系统中,动态链接库文件通常是.so文件(后缀为.so)。动态链接库文件通常存放在C/System目录下。
动态链接库文件的使用,可以大大的节省应用程序的占用空间,即对于多个应用程序共同使用的公共的符号,可以存储在动态链接库文件中,当应用程序被执行时,从动态链接库文件中调用符号即可。由于动态链接库文件的使用,使得应用程序不至于太过巨大。
(2)符号地址,即符号的存储地址,当终端设备确定符号地址之后,便可按照该符号地址加载符号,进而加载目标文件。
符号地址通常有逻辑地址和实际物理地址之分,逻辑地址可以理解为编程人员在编写程序的过程中,为每个符号定义的逻辑地址。而物理地址为符号在终端设备内存中的真实的存储地址,终端设备的应用程序在调用符号时,通常使用的是符号的物理地址。
(3)符号名,即符号的名称,在编程中,符号名即变量名或者函数名,一般由字母、数字和下划线组成。
(4)数组索引,所谓数组即按顺序排列的同类数据元素的集合,也可理解为把有限个类型相同的变量或者函数进行编号,每个变量或函数的编号可称为数组标号或者数组索引,数组索引可以是二进制、十进制等等。
(5)重定位,即将目标文件的符号的逻辑地址变换成内存中的实际物理地址的过程,也可以理解为在加载目标文件时对目标文件中指令或数据的修改过程,前面提到过,应用程序执行过程中,调用符号时,通常使用的是符号的物理地址,而编译人员在编译符号时使用的符号地址(逻辑地址)并不一定适合终端设备内存中的实际物理地址,所以调用符号之前,需要对符号地址进行重定位。
(6)本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,如无特殊说明,一般表示前后关联对象是一种“或”的关系。且在本发明的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。
为更好地介绍本发明实施例中的动态加载方法,下面首先介绍本发明实施例的一种应用场景,请参见图2。如图2所示,本发明实施例提供的应用场景中包括两部分,第一部分为编译服务器,第二部分为终端设备。当然,在实际操作过程中,编译服务器还可以是其它服务器,只要可以用于编译代码生成目标文件即可,终端设备可以是手机、平板电脑等。
其中,编译服务器用于编译生成目标文件,即编译人员通过编译服务器编译代码,进而生成目标文件,具体过程为,编译服务器中包含编译系统,编译人员通过编译服务器输入源代码,源代码经过编译系统,输出目标文件。而终端设备用于加载运行由编译服务器生成的目标文件。
在本发明实施例中,目标文件可以是应用程序文件的源文件或者动态链接库文件。以动态链接库文件为例,编译服务器生成动态链接库之后,终端设备中的应用程序被执行时,可以加载动态链接库文件。目前,终端设备的应用程序被执行时,使用动态链接库文件的具体过程为,终端设备根据应用程序文件的符号名在全局符号表中寻找符号地址,图1示出了现有技术中全局符号表的示意图,然后根据符号地址从加载的动态库中调用符号。在实际操作过程中,由于全局符号表中的字符串名本身占用的内存资源比较大,所以终端设备在动态加载的过程中,消耗的内存资源较大。
为了解决该技术问题,本发明实施例提供一种动态加载方法。即,在终端设备中的应用程序的运行过程中,加载动态链接库文件,所述动态链接库文件中包含能够实现所述应用程序中的特定功能的符号;所述符号包括函数和/或变量;从所述应用程序的源文件中读取第一数组索引index;从全局符号表中确定与所述第一index对应的第一符号地址;所述第一符号地址用于指示能够实现所述特定功能的符号的物理地址;根据所述第一符号地址从所述动态连接库文件中调用所述符号,完成所述应用程序的运行。在本发明实施例提供的方法中,由于index本身占据的内存相对较少,所以有助于节省内存资源。
在介绍本发明实施例提供的动态加载方法之前,先介绍目标文件(应用程序的源文件或动态链接库文件)的制作过程。具体请参考图3,为本发明实施例提供的目标文件的制作方法的流程图。以图2所示的应用场景为例,该方法适用于图2中的编译服务器。因此,图3也可以理解为图2中的编译服务器和终端设备之间的信息交互示意图。该方法的流程描述如下:
S301:编译服务器确定源代码中所包含的符号的符号名,符号用于指示所述源代码中能够实现设定功能的函数或变量。
前面已经提到过,编译人员通过编译服务器输入源代码,源代码中包含多个符号以及每个符号的符号名,这里的符号可以是变量或者函数,符号名即变量名或者函数名。
举例来说,编译人员输入源代码中包含5个函数,编译服务器确定5个函数的函数名分别为fun1、fun2、fun3、fun4、fun5。
S302:编译服务器根据符号名和数组索引index的映射关系确定与符号名对应的index。
在本发明实施例中,index可以是二进制、十进制、十六进制等等。
作为一种示例,编译服务器可以事先存储符号名和数组索引index的映射关系,在确定源代码中所包含的符号的符号名之后,可以在符号名和index的映射关系中查询与每个符号名对应的index。
当然,在实际操作过程中,编译服务器在确定源代码中包含的符号的符号名之后,也可以直接将每个符号的符号名进行排序,则每个符号的符号名对应一个排序号,将排序号(十进制、二进制等)作为index即可。
S303:编译服务器根据index生成目标文件。
在实际操作过程中,编译人员在编译源代码时,是通过编译不同的代码段进而完成源代码的编译,不同的代码段存储不同的符号(变量或函数),以实现不同的功能。因此,若编译服务器确定每个符号名对应的index之后,可以直接将index填充在要生成的目标文件中,或者若编译服务器将每个符号的符号名进行排序,也可以直接将排序号(二进制、十进制等)填充在要生成的目标文件中,以生成目标文件。
作为一种示例,编译服务器将index填充在目标文件的实现方式可以是,编译服务器确定要生成的目标文件中用于存放符号名的位置,然后用index替换符号名,即将index填充在在该位置处。
以目标文件是动态链接库文件.so文件为例,.so文件中用于存放符号名的位置为dynsym段代码段中的st_name代码段,所以,编译服务器可以将index填充于st_name代码段中。举例来说,编译服务器中确定出的符号名分别为fun1、fun2、fun3、fun4、fun5,并且根据符号名和index的映射关系,确定出与fun1、fun2、fun3、fun4、fun5分别对应的index(十进制)为1、2、3、4、5,则编译服务器将index填充在st_name代码段中。具体请参见图4所示,为本发明实施例提供的.so文件中各个代码段中存储的代码内容,如图4所示,.so文件中包含.rel代码段,而.rel代码段中包含.dynsym代码段,dynsym代码段中st_name代码段用于存储index,如图4所示,st_name代码段中存储有5个符号各自对应的index即1-5。
当然,在实际操作过程中,编译服务器也可以将index存储在其它的位置处,或者单独设置一个用于存储index的代码段,无论将index存储在什么位置,只要终端设备能够读取到index即可。
由于动态链接库文件中包含有应用程序所使用的符号以及这些符号的符号名,而应用程序的源文件中往往也包含这些符号的符号名(或者符号指针),当应用程序被运行时,终端设备从动态链接库文件中调用与该符号名对应的符号。因此,在本发明实施例中,编译服务器在制作动态链接库文件和应用程序的源文件时,使用的符号名和index的映射关系可以是相同的,即制作好的动态链接库文件和应用程序的源文件中的index是对应的。
若目标文件可以是应用程序的源文件,终端设备下载应用程序时,可以将应用程序的源文件加载到自身的内存中执行。下文的描述以终端设备已经将编译服务器制作好的应用程序的源文件加载到内存中,并运行该应用程序为例进行说明,即终端设备使用动态链接库文件来完成应用程序的运行过程。请继续参见图3,终端设备使用动态链接库文件运行应用程序的过程包括:
S304:在终端设备中的应用程序的运行过程中,加载动态链接库文件,所述动态链接库文件中包含能够实现所述应用程序中的特定功能的符号;所述符号包括函数和/或变量。
前面已经提到过,动态链接库文件中包含有应用程序被执行时多使用的符号,即应用程序被执行时需要加载动态链接库文件,所以终端设备中的应用程序被执行时,可以首先将动态链接库文件加载在终端设备的操作系统中以便应用程序的使用。下面介绍终端设备加载动态链接库文件的过程。
在本发明实施例中,终端设备加载动态链接库文件的过程可以分五步进行,第一 步,终端设备将所述动态链接库文件存储于自身的内存中;第二步,从所述动态链接库文件中的st_name代码中读取所述第一index;第三步,根据第一index与第二符号地址的映射关系确定与所述第一index对应的第二符号地址;所述第二符号地址用于指示所述动态链接库文件中能够实现所述特定功能的符号的逻辑地址;第四步,对所述第二符号地址进行重定位,得到所述第一符号地址;第五步,将所述第一符号地址填充在所述动态链接库文件中,完成所述动态链接库文件的加载。
第一步中,终端设备可以从编译服务器中下载动态链接库文件,并将动态链接库文件存储在自身的内存中。前面提到过,由于编译服务器在制作动态链接库文件时,在st_name代码中填充了第一index,所以在第二步中,终端设备只需读取第一index即可。第三步,终端设备加载第一index与第二符号地址的映射关系,并从该映射关系中确定与第一index对应的第二符号地址,这里确定出的第二符号地址是逻辑地址。
需要说明的是,由于第二符号地址是编译人员编写代码时,对每个符号使用的逻辑地址,所以可以将逻辑地址存储下来,然后建立第一index与逻辑地址(第二符号地址)之间的映射关系。建立第一index与逻辑地址之间的映射关系的过程可以由终端设备自身执行,当然为了缓解终端设备的压力,也可以由编译服务器执行,若是由编译服务器执行,则第三步中,终端设备只需从编译服务器中加载该映射关系即可。
图5示出了现有技术中终端设备加载动态链接库文件的示意图。由于现有技术中,编译服务器在生成动态链接库文件的过程中,在动态链接库文件中存储的是每个符号的符号名,而且构建的是符号名和第二符号地址的映射关系。因此,在图10中,终端设备加载动态链接库文件的过程中,从动态链接库文件中读取每个符号的符号名之后,根据符号名和第二符号地址的映射关系确定与符号名对应的第二符号地址。由于字符名通常是字符串,占用的内存资源较大,所以现有技术中加载动态链接库文件时占据的内存资源较大。
图6示出了本发明实施例中终端设备加载动态链接库文件的示意图。前面已经提到过,编译服务器在制作动态链接库文件的过程中,将与符号名对应的index填充于动态链接库文件中,所以编译服务器构建的是index和第二符号地址的映射关系。因此,在图11中,终端设备从动态链接库文件中的.rel代码段中的.dynsym代码段中的st_name代码段中读取5个第一index,分别为index1-index5,然后从index和第二符号地址的映射关系中确定与每个index对应的第二符号地址。因此,终端设备加载动态链接库文件的过程中占用的内存资源较少,较为节省资源。
由于第二符号地址是逻辑地址,所以需要对第二符号地址进行重定位,即第四步。第四步的实现方式可以有多种,例如,终端设备可以从动态链接库文件中的.rel代码段中的.reldyn段中的r_info代码段中读取重定位信息。然后根据该重定位信息对第二符号地址进行重定位,较为简单的实现过程为,终端设备可以将第二符号地址加上重定位信息(符号偏移地址),即可得到重定位之后的符号地址,即第一符号地址。当然,在实际操作过程中,对符号地址进行重定位的还可以采取其它的方式,本发明实施例对此不作具体的限定。
对第二符号地址重定位之后,可以执行第五步,即将重定位之后的第一符号地址填充到动态链接库文件中,完成动态链接库文件的加载。
作为一种示例,请继续参见图6所示,在第五步中,终端设备可以将重定位之后 的符号地址填充到rel代码段中r_offset指示的.got代码段中,即完成加载。
S305:终端设备从应用程序的源文件中读取第一数组索引index。
前面已经介绍过,编译服务器在生成应用程序的源文件的过程中,在源文件中相应的位置处存储index,所以终端设备只需在对应的位置处读取index即可。
前面已经提到过,编译服务器在制作动态链接库文件和应用程序的源文件时,使用的符号名和index的映射关系可以是相同的,即制作好的动态链接库文件和应用程序的源文件中的index是对应的。因此,S305中终端设备从应用程序的源文件中读取的第一index,与动态链接库文件中的第一index代表的是相同的符号。
S306:终端设备从全局符号表中确定与第一index对应的第一符号地址;第一符号地址用于指示能够实现所述特定功能的符号的物理地址。
在S305之前,终端设备需要获得全局符号表。下面接收终端设备获得全局符号表的几种实现方式。
第一种实现方式,前面已经提到过,编译服务器可以建立第一index与第二符号地址(逻辑地址)之间的映射关系,而第一符号地址是对第二符号地址进行重定位得到的,所以终端设备可以进一步建立第一index与第一符号地址之间的映射关系,该映射关系可以直接作为全局符号表。
图7示出了本发明实施例提供的第一种全局符号表的示意图。如图7所示,全局符号表中包含第一index与第一符号地址的映射关系。由于index本身占据的内存资源比较少,所以全局符号表占据的资源相对较小,较为节约资源。
第二种实现方式,终端设备得到第一符号地址之后,可以直接将所有第一符号地址按照一定的顺序进行排序,排序好的第一符号地址可以直接作为全局符号表使用,即全局符号表中index的值为空,只包含第一符号地址。
图8示出了本发明实施例提供的第二种全局符号表的示意图。如图8所示,全局符号表中只包含第一符号地址。在第二种方式下,由于全局符号表中只包含第一符号地址,所以全局符号表占据的内存资源更少,更加节约资源。
第三种实现方式,在实际操作过程中,动态链接库文件中可能包含不止一个功能模块,每个功能模块包含各自的多个符号,用来实现特定的功能,这里的功能模块可以理解为动态链接库中的子文件等,即不同的功能模块可以实现不同的功能。因此,终端设备在构建全局符号表时,可以为每个功能模块设立单独的模块符号表,所有功能模块的模块符号表构成全局符号表。
作为一种示例,编译服务器在制作动态链接库文件时,可以将能够实现特定功能的符号作为一个功能模块整体存储,以符号具体是函数为例,函数fun1-fun3是用来实现某个功能的,即将这三个函数作为整体存储在该功能模块对应的文件中,因此,终端设备在构建全局符号表时,只需要在每个功能模块对应的文件中读取该动能模块中所包含的符号的第一index即可。因此,为了区分每个功能模块,终端设备构建全局符号表时,可以为每个功能模块添加模块标识例如模块ID,然后为每个功能模块构建模块符号表,进而得到全局符号表,所以这种方式下,全局符号表中不仅包括每个功能模块所包含的符号的第一符号地址,还可以包括每个功能模块的模块ID。
图9示出了本发明实施例提供的第三种全局符号表的示意图,如图9所示,全局符号表中包含第一符号地址和模块ID,其中,每个第一符号地址对应一个index,每 个模块ID也对应一个index,为了区分开来,第一符号地址对应第一index,模块ID对应第二index。
第四种实现方式,全局符号表中不仅包括每个功能模块所包含的符号的第一符号地址,还可以包括每个功能模块的模块ID,将所有模块ID和第一符号地址按照一定的顺序排序,即每个模块ID都有一个排序号,而且每个第一符号地址也有一个排序号。
图10示出了本发明实施例提供的第四种全局符号表的示意图,如图10所示,全局符号表中第一符号地址和模块ID按照一定的顺序进行排序。
第五种实现方式,全局符号表中不仅包括每个功能模块所包含的符号的符号地址,还可以包括每个功能模块的模块ID,其中,每个模块ID对应一个模块符号表,每个模块符号表中包含每个模块所包含的所有符号的符号地址。举例来说,全局符号表中包含三个模块ID,其中一个是模块0,则模块0对应的模块符号表中包含模块0所包含的所有符号的符号地址,每个符号地址均以0为开头,即第一个符号地址对应的index可以为0x0001,该模块符号表中后续的其它符号地址依次类推。
图11示出了本发明实施例提供的第五种全局符号表的示意图,如图11所示,全局符号表中包含两个模块以及每个模块对应的模块符号表。
以上只是列举了全局符号表的五种可能的实现方式,在实际操作过程中,上述的五种方式可以结合使用,例如全局符号表中部分第一符号地址或模块ID按照一定的顺序进行排序,另一部分第一符号地址或模块ID中每个第一符号地址或模块ID对于一个index,只要能够唯一的标识第一符号地址或模块ID即可。
以上介绍了五种终端设备构建全局符号表的方式,当终端设备构建好全局符号表之后,可以执行S306,即终端设备从全局符号表中确定与第一index对应的第一符号地址。由于上面介绍了五种全局符号表,下面将介绍对于不同的全局符号表,S306的不同实现过程。
对于前面提到的第一种实现方式即图7所示的全局符号表来说,由于全局符号表中包含第一index与第一符号地址的映射关系。因此,终端设备从应用程序的源文件中读取出第一index之后,可以在全局符号表中查找与第一index对应的第一符号地址。
对于前面提到的第二种实现方式即图8所示的全局符号表来说,由于全局符号表中所有第一符号地址是按照一定顺序排序的,所以每个第一符号地址对应一个排序号。终端设备从应用程序的源文件中读取出第一index之后,若第一index的取值与某个第一符号地址的排序号相同,那么终端设备确定这个第一符号地址是与该第一index对应的第一符号地址。
举例来说,终端设备从应用程序的源文件中读取出5个第一index,即index1-index5,其取值分为为1-5,然后终端设备在全局符号表中确定排序号分别为1-5的第一符号地址,即addr1、addr2、addr3、addr4、addr5。
对于前面提到的第三种实现方式即图9所示的全局符号表来说,由于全局符号表中包含第一符号地址和模块ID,其中,第一符号地址对应第一index,模块ID对应第二index。若第一index和第二index是同一个index的高低位,即终端设备读取应用程序的源文件中的第一index之后,可以根据第一index中的高位部分确定模块ID,根据第一index的低位部分确定第一符号地址。
举例来说,请参见图12所示,终端设备从应用程序的源文件中读取的第一index 为32bit的整数,可以将index划分为高位和低位两部分,例如高12bit和低20bit。其中,高12bit作为模块ID的计数部分,低20bit作符号地址的计数部分,即终端设备根据高12bit从全局符号表中确定模块ID,然后根据低20bit从全局符号表中确定第一符号地址。当然,在实际操作过程中,index还可以是8bit、16bit或者64bit等,即index的位宽可根据实际情况定,其中,模块ID和第一符号地址的位宽也可根据实际情况而定,本发明实施例不作具体的限定。
若第一index和第二index是相互独立的,终端设备还可以从应用程序的源文件中读取第二index,然后从全局符号表中确定于第二index对应的模块ID,并根据读取的第一index从全局符号表中确定于第一index对应的第一符号地址。
对于前面提到的第四种实现方式即图10所示的全局符号表来说,全局符号表中包含模块ID和第一符号地址,并且模块ID和第一符号地址按照一定的顺序排序,即每个模块ID对应一个排序号,每个第一符号地址对应一个排序号。终端设备从应用程序的源文件中读取第一index之后,可以在全局符号表中确定排序号与第一index的取值相同的第一符号地址。
作为一种示例,终端设备读取应用程序的源文件中的第一index之后,可以根据第一index中的高位部分确定模块ID,根据第一index的低位部分确定第一符号地址。举例来说,终端设备读取的第一index为32位整数,可以将index划分为高位和低位两部分,例如高12bit和低20bit。终端设备可以从全局符号表中确定排序号与高12bit的值相同的模块ID,并从全局符号表中确定排序号与低20bit的值相同的第一符号地址。
对于前面提到的第五种实现方式即图11所示的全局符号表来说,由于全局符号表中包括每个功能模块所包含的符号的第一符号地址,还可以包括每个功能模块的模块ID,其中,每个模块ID对应一个模块符号表,每个模块符号表中包含所述每个模块所包含的所有符号的第一符号地址。
作为一种示例,终端设备读取的第一index为32位整数,可以将index划分为高位和低位两部分,例如高12bit和低20bit。终端设备可以从全局符号表中确定排序号与高12bit的值相同的模块ID之后,可以在模块ID对应的模块符号表中确定排序号与低20bit的值相同的第一符号地址。
无论全局符号表的上述哪种结构,终端设备的应用程序被执行时,可以通过dlsym函数接口从全局符号表中获取第一符号地址。现有技术中,由于全局符号表中包含符号地址和符号名的对应关系,所以现有技术中用来从全局符号表中获取符号地址的函数接口通常是void*dlsym(void*handle,const char*symbol)。其中,handle是由dlopen函数接口打开目标文件后返回的指针,symbol就是要求获取的符号的符号名,函数返回值是void*,指向符号的符号地址(函数地址),供调用使用,即现有技术中的dlsym函数需要读取符号名,然后返回符号名对应的符号地址,但是本发明实施例中,全局符号表中包含index和第一符号地址的映射关系,所以dlsym函数接口只需读取index,返回index对应的第一符号地址即可。
在本发明实施例中,动态链接库文件可能会被多个应用程序使用,而不同的应用程序可能调用动态链接库文件中的不同符号,所以当某个应用程序需要动态链接库文件中的某些符号时,终端设备可以构建包含这些符号的第一index与第一符号地址之 间的映射关系的全局符号表即可,当其他应用程序需要动态链接库文件中的另一些符号时,终端设备可以进一步补充全局符号表,即将另一些符号的第一index与第一符号之间的映射关系补充到全局符号表中。
S307,根据第一符号地址从动态连接库文件中调用符号,完成应用程序的运行。
前面已经提到过,动态链接库文件中存储着应用程序被执行时所使用的符号,所以终端设备确定第一index对应的第一符号地址即物理地址之后,即终端设备确定了动态链接库文件中的、存放在终端设备中的符号的物理地址,所以终端设备可根据该第一符号地址调用动态链接库中的符号即可。
在本发明实施例中,终端设备在需要动态链接库文件时,可以通过dlopen函数接口加载动态链接库文件,当终端设备不需要动态链接库文件时,可以通过dlclose函数接口释放动态链接库文件以及全局符号表,以节省终端设备的内存资源。
总结来说,本发明实施例提供的一种目标文件的制作方法,例如将目标文件(动态链接库文件或者应用程序中的源文件)中的符号名替换为第一index,完成目标文件的制作。本发明实施例还提供一种动态加载方式,终端设备在运行应用程序时,若需要使用动态链接库文件中的符号,则加载动态链接库文件,并构建全局符号表,该全局符号表中包含第一index与第一符号地址的映射关系,终端设备读取应用程序的源文件中读取第一index之后,可以从全局符号表中确定与第一index对应的第一符号地址,然后根据第一符号地址调用动态链接库文件中的符号,完成应用程序的运行。在这整个过程中,终端设备使用的均是index,而index本身占据的内存相对较少,有助于节省内存资源。
下面结合附图介绍本发明实施例提供的设备。
图13示出了一种终端设备1300的结构示意图。该终端设备1300可以实现上文中涉及的终端设备的功能。该终端设备1300可以包括加载模块1301、读取模块1302,确定模块1303以及符号调用模块1304。其中,加载模块1301可以用于执行图3所示的实施例中的S304,和/或用于支持本文所描述的技术的其它过程。读取模块1302可以用于执行图3所示的实施例中的S305,和/或用于支持本文所描述的技术的其它过程。确定模块1303可以用于执行图3所示的实施例中的S306,和/或用于支持本文所描述的技术的其它过程。符号调用模块1304可以用于执行图3所示的实施例中的S307,和/或用于支持本文所描述的技术的其它过程。其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。
需要说明的是,在本发明实施例中,上述终端设备以功能单元的形式展示。在不受限制的情况下,本文所使用的术语“单元”可指执行一个或多个软件或固件程序的专用集成电路(application-specific integrated circuit,ASIC)、电子电路、(共享、专用或组)处理器以及存储器,组合逻辑电路,和/或提供所述功能的其它合适的部件。
图14示出了一种目标文件的制作装置1400的结构示意图。该目标文件的制作装置1400可以实现上文中涉及的编译服务器的功能。该目标文件的制作装置1400可以包括确定模块1401和文件生成模块1402。其中,确定模块1401可以用于执行图3所示的实施例中的S301-S302,和/或用于支持本文所描述的技术的其它过程。文件生成模块1402可以用于执行图3所示的实施例中的S303,和/或用于支持本文所描述的技术的其它过程。其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对 应功能模块的功能描述,在此不再赘述。
需要说明的是,在本发明实施例中,上述目标文件的制作装置以功能单元的形式展示。在不受限制的情况下,本文所使用的术语“单元”可指执行一个或多个软件或固件程序的专用集成电路(application-specific integrated circuit,ASIC)、电子电路、(共享、专用或组)处理器以及存储器,组合逻辑电路,和/或提供所述功能的其它合适的部件。
在一个简单的实施例中,本领域的技术人员可以想到,还可以将图13所示的终端设备通过如图15所示的结构实现。
如图15所示,终端设备1500可以包括:存储器1501、处理器1502和总线1503。存储器1501和处理器1502可以通过总线1503连接。其中,存储器1501用于存储计算机执行指令,当终端设备1500运行时,处理器1502执行存储器1501存储的计算机执行指令,以使终端设备1500执行图3所示的实施例提供的动态加载方法。具体的动态加载方法可参考上文及附图中的相关描述,此处不再赘述。
在本发明实施例中,处理器1502可以是现场可编程门阵列(field-programmable gate array,FPGA),专用集成芯片(application specific integrated circuit,ASIC),系统芯片(system on chip,SoC),中央处理器(central processor unit,CPU),网络处理器(network processor,NP),数字信号处理电路(digital signal processor,DSP),微控制器(micro controller unit,MCU),还可以采用可编程控制器(programmable logic device,PLD)或其他集成芯片。总线1503可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线1503可以分为地址总线、数据总线、控制总线等。为便于表示,图15中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
在一个简单的实施例中,本领域的技术人员可以想到,还可以将图14所示的目标文件的制作装置通过如图16所示的结构实现。
如图16所示,目标文件的制作装置1600可以包括:存储器1601、处理器1602和总线1603。存储器1601和处理器1602可以通过总线1603连接。其中,存储器1601用于存储计算机执行指令,当目标文件的制作装置1600运行时,处理器1602执行存储器1601存储的计算机执行指令,以使目标文件的制作装置1600执行图3所示的实施例提供的动态加载方法。具体的动态加载方法可参考上文及附图中的相关描述,此处不再赘述。
在本发明实施例中,处理器1602可以是现场可编程门阵列(field-programmable gate array,FPGA),专用集成芯片(application specific integrated circuit,ASIC),系统芯片(system on chip,SoC),中央处理器(central processor unit,CPU),网络处理器(network processor,NP),数字信号处理电路(digital signal processor,DSP),微控制器(micro controller unit,MCU),还可以采用可编程控制器(programmable logic device,PLD)或其他集成芯片。总线1603可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线1603可以分为地址总线、数据总线、控制总线等。为便于表示,图16中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
综上所述,本发明实施例提供的一种目标文件的制作方法,例如将目标文件(动 态链接库文件或者应用程序中的源文件)中的符号名替换为第一index,完成目标文件的制作。本发明实施例还提供一种动态加载方式,终端设备在运行应用程序时,若需要使用动态链接库文件中的符号,则加载动态链接库文件,并构建全局符号表,该全局符号表中包含第一index与第一符号地址的映射关系,终端设备读取应用程序的源文件中读取第一index之后,可以从全局符号表中确定与第一index对应的第一符号地址,然后根据第一符号地址调用动态链接库文件中的符号,完成应用程序的运行。在这整个过程中,终端设备使用的均是index,而index本身占据的内存相对较少,有助于节省内存资源。
在上述发明实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如,固态硬盘Solid State Disk(SSD))等。
以上实施例仅用以对本发明实施例的技术方案进行详细介绍,但以上实施例的说明只是用于帮助理解本发明实施例的方法及其核心思想,不应该理解为对本申请的限制。本领域技术人员在本发明实施例揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明实施例的保护范围之内。

Claims (24)

  1. 一种动态加载方法,其特征在于,包括:
    在终端设备中的应用程序的运行过程中,加载动态链接库文件,所述动态链接库文件中包含能够实现所述应用程序中的特定功能的符号;所述符号包括函数和/或变量;
    从所述应用程序的源文件中读取第一数组索引index;
    从全局符号表中确定与所述第一index对应的第一符号地址;所述第一符号地址用于指示能够实现所述特定功能的符号的物理地址;
    根据所述第一符号地址从所述动态连接库文件中调用所述符号,完成所述应用程序的运行。
  2. 如权利要求1所述的方法,其特征在于,所述加载动态链接库文件,包括:
    将所述动态链接库文件存储于所述终端设备的内存中;
    从所述动态链接库文件中的st_name代码中读取所述第一index;
    根据第一index与第二符号地址的映射关系确定与所述第一index对应的第二符号地址;所述第二符号地址用于指示所述动态链接库文件中能够实现所述特定功能的符号的逻辑地址;
    对所述第二符号地址进行重定位,得到所述第一符号地址;
    将所述第一符号地址填充在所述动态链接库文件中,完成所述动态链接库文件的加载。
  3. 如权利要求2所述的方法,其特征在于,所述在全局符号表中确定与所述第一index对应的第一符号地址,包括:
    构建所述全局符号表;所述全局符号表中包含第一index与第一符号地址之间的映射关系;
    根据所述第一index与第一符号地址的映射关系确定与所述第一index对应的第一符号地址。
  4. 如权利要求2所述的方法,其特征在于,所述在全局符号表中确定与所述第一index对应的第一符号地址,包括:
    构建所述全局符号表;所述全局符号表中包含所述第一符号地址,且所述第一符号地址按照一定的顺序排序;
    读取所述全局符号表中排序号与所述第一index的值相同的第一符号地址。
  5. 如权利要求3所述的方法,其特征在于,根据所述第一index与第一符号地址的映射关系确定与所述第一index对应的第一符号地址,包括:
    确定所述第一index所属的功能模块;所述功能模块用于指示所述动态链接库文件中能够实现所述特定功能的模块;
    从所述全局符号表中确定与所述功能模块对应的模块符号表;所述模块符号表中包含所述功能模块中的符号的第一符号地址与第一index的映射关系;所述符号用于指示所述功能模块中用于实现所述特定功能的函数和/或变量;
    从所述模块符号表中的第一符号地址与第一index的映射关系读取与所述第一index对应的第一符号地址。
  6. 如权利要求5所述的方法,其特征在于,确定所述第一index所属的功能模块, 包括:
    获取与所述第一index关联的第二index;
    从功能模块与第二index之间的映射关系确定与所述第二index对应的功能模块。
  7. 一种目标文件的制作方法,其特征在于,包括:
    确定目标文件的源代码中所包含的符号的符号名;所述符号用于指示所述源代码中能够实现特定功能的函数或变量;
    根据符号名和数组索引index的映射关系确定与所述符号名对应的index;
    根据所述index生成所述目标文件。
  8. 如权利要求7所述的方法,其特征在于,所述目标文件为动态链接库文件和/或应用程序的源文件。
  9. 如权利要求7或8所述的方法,其特征在于,根据所述index生成所述目标文件,包括:
    确定所述目标文件中用于存放符号名的位置;
    将所述index填充在所述位置处。
  10. 如权利要求9所述的方法,其特征在于,所述位置位于所述目标文件中的st_name代码段中。
  11. 一种终端设备,其特征在于,包括:
    加载模块,用于在所述终端设备中的应用程序的运行过程中,加载动态链接库文件,所述动态链接库文件中包含能够实现所述应用程序中的特定功能的符号;所述符号包括函数和/或变量;
    读取模块,用于从所述应用程序的源文件中读取第一数组索引index;
    确定模块,用于从全局符号表中确定与所述第一index对应的第一符号地址;所述第一符号地址用于指示能够实现所述特定功能的符号的物理地址;
    符号调用模块,用于根据所述第一符号地址从所述动态连接库文件中调用所述符号,完成所述应用程序的运行。
  12. 如权利要求11所述的终端设备,其特征在于,所述加载模块在加载动态链接库文件时,具体用于:
    将所述动态链接库文件存储于所述终端设备的内存中;
    从所述动态链接库文件中的st_name代码中读取所述第一index;
    根据第一index与第二符号地址的映射关系确定与所述第一index对应的第二符号地址;所述第二符号地址用于指示所述动态链接库文件中能够实现所述特定功能的符号的逻辑地址;
    对所述第二符号地址进行重定位,得到所述第一符号地址;
    将所述第一符号地址填充在所述动态链接库文件中,完成所述动态链接库文件的加载。
  13. 如权利要求12所述的终端设备,其特征在于,所述确定模块在从全局符号表中确定与所述第一index对应的第一符号地址时,具体用于:
    构建所述全局符号表;所述全局符号表中包含第一index与第一符号地址之间的映射关系;
    根据所述第一index与第一符号地址的映射关系确定与所述第一index对应的第一 符号地址。
  14. 如权利要求12所述的终端设备,其特征在于,所述确定模块在从全局符号表中确定与所述第一index对应的第一符号地址时,具体用于:
    构建所述全局符号表;所述全局符号表中包含所述第一符号地址,且所述第一符号地址按照一定的顺序排序;
    读取所述全局符号表中排序号与所述第一index的值相同的第一符号地址。
  15. 如权利要求13所述的终端设备,其特征在于,所述确定模块在根据所述第一index与第一符号地址的映射关系确定与所述第一index对应的第一符号地址时,具体用于:
    确定所述第一index所属的功能模块;所述功能模块用于指示所述动态链接库文件中能够实现所述特定功能的模块;
    从所述全局符号表中确定与所述功能模块对应的模块符号表;所述模块符号表中包含所述功能模块中的符号的第一符号地址与第一index的映射关系;所述符号用于指示所述功能模块中用于实现所述特定功能的函数和/或变量;
    从所述模块符号表中的第一符号地址与第一index的映射关系读取与所述第一index对应的第一符号地址。
  16. 如权利要求15所述的终端设备,其特征在于,所述确定模块在确定所述第一index所属的功能模块时,具体用于:
    获取与所述第一index关联的第二index;
    从功能模块与第二index之间的映射关系确定与所述第二index对应的功能模块。
  17. 一种目标文件的制作装置,其特征在于,包括:
    确定模块,用于确定目标文件的源代码中所包含的符号的符号名;所述符号用于指示所述源代码中能够实现特定功能的函数或变量;
    所述确定模块还用于根据符号名和数组索引index的映射关系确定与所述符号名对应的index;
    文件生成模块,用于根据所述index生成所述目标文件。
  18. 如权利要求17所述的装置,其特征在于,所述目标文件为动态链接库文件和/或应用程序的源文件。
  19. 如权利要求17或18所述的装置,其特征在于,所述文件生成模块具体用于:
    确定所述目标文件中用于存放符号名的位置;
    将所述index填充在所述位置处。
  20. 如权利要求19所述的装置,其特征在于,所述位置位于所述目标文件中的st_name代码段中。
  21. 一种终端设备,其特征在于,所述终端设备包括:处理器和存储器;
    所述存储器用于存储计算机执行指令,当所述处理器执行所述指令时,使所述终端设备执行如权利要求1-6任意一项所述的方法。
  22. 一种目标文件的制作装置,其特征在于,所述装置包括:处理器和存储器;
    所述存储器用于存储计算机执行指令,当所述处理器执行所述指令时,使所述终端设备执行如权利要求7-10任意一项所述的方法。
  23. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括指令, 当所述指令在计算机上运行时,使得所述计算机执行如权利要求1-10任意一项所述的方法。
  24. 一种包含指令的计算机程序产品,其特征在于,当所述指令在计算机上运行时,使得所述计算机执行如权利要求1-10任意一项所述的方法。
PCT/CN2018/112220 2017-11-20 2018-10-26 一种动态加载方法、目标文件的制作方法及装置 WO2019095968A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/877,827 US10908925B2 (en) 2017-11-20 2020-05-19 Dynamic loading method, and target file creation method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711160959.1 2017-11-20
CN201711160959.1A CN109814939B (zh) 2017-11-20 2017-11-20 一种动态加载方法、目标文件的制作方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/877,827 Continuation US10908925B2 (en) 2017-11-20 2020-05-19 Dynamic loading method, and target file creation method and apparatus

Publications (1)

Publication Number Publication Date
WO2019095968A1 true WO2019095968A1 (zh) 2019-05-23

Family

ID=66538494

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/112220 WO2019095968A1 (zh) 2017-11-20 2018-10-26 一种动态加载方法、目标文件的制作方法及装置

Country Status (3)

Country Link
US (1) US10908925B2 (zh)
CN (1) CN109814939B (zh)
WO (1) WO2019095968A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110908882A (zh) * 2019-11-14 2020-03-24 北京无限光场科技有限公司 一种应用程序的性能分析方法、装置、终端设备及介质
CN113868565A (zh) * 2021-09-23 2021-12-31 深圳市腾讯网域计算机网络有限公司 皮肤样式的文件编辑方法及装置

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112612530B (zh) * 2019-09-18 2022-05-17 华为技术有限公司 类查询方法及装置
CN112527303B (zh) * 2019-09-19 2022-09-13 无锡江南计算技术研究所 面向即时编译的基于动态库的got表管理方法
CN112559064A (zh) * 2019-09-24 2021-03-26 中兴通讯股份有限公司 一种启动动态链接程序的方法和装置
CN113204377B (zh) 2020-01-31 2022-12-06 华为技术有限公司 一种动态链接库的加载方法及装置
CN112130926B (zh) * 2020-09-17 2023-10-24 深圳市兆珑科技有限公司 应用程序运行的方法、装置、终端设备及存储介质
CN112181411A (zh) * 2020-09-25 2021-01-05 深圳市元征科技股份有限公司 一种菜单生成方法、菜单生成装置及诊断设备
CN112306539B (zh) * 2020-11-05 2023-08-01 重庆科技学院 一种单片机应用层开发方法、系统、终端及介质
CN112463164B (zh) * 2020-12-14 2024-02-13 记忆科技(深圳)有限公司 SoC程序执行的显示定位方法、装置、计算机设备及存储介质
CN112596739B (zh) * 2020-12-17 2022-03-04 北京五八信息技术有限公司 一种数据的处理方法和装置
CN112667242B (zh) * 2020-12-28 2023-08-22 北京世冠金洋科技发展有限公司 一种将c代码封装成fmu的方法及装置
CN112835864B (zh) * 2021-02-03 2024-02-20 北京联创信安科技股份有限公司 一种文件存储方法、装置、设备及存储介质
CN113434196A (zh) * 2021-06-29 2021-09-24 北京房江湖科技有限公司 用于管理应用程序的方法和装置
CN113568680B (zh) * 2021-07-23 2023-08-11 杭州网易智企科技有限公司 应用程序的动态链接库保护方法、装置、设备及介质
CN113791838B (zh) * 2021-08-20 2024-04-23 深圳市元征科技股份有限公司 一种程序文件调用方法、装置以及存储介质
CN113742002A (zh) * 2021-09-10 2021-12-03 上海达梦数据库有限公司 一种动态库依赖关系获取方法、装置、设备及存储介质
CN113849245B (zh) * 2021-09-23 2023-09-12 武汉深之度科技有限公司 一种应用程序运行方法、计算设备及存储介质
CN113946347B (zh) * 2021-09-29 2022-07-08 北京五八信息技术有限公司 函数调用的检测方法、装置、电子设备及可读介质
CN114840400A (zh) * 2022-04-14 2022-08-02 北京字节跳动网络技术有限公司 异常组件的识别方法、装置、设备、存储介质及程序产品
CN114764354B (zh) * 2022-04-19 2024-01-05 卡奥斯工业智能研究院(青岛)有限公司 基于paas的依赖管理方法、装置、电子设备及介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102147743A (zh) * 2011-03-28 2011-08-10 博视联(苏州)信息科技有限公司 加快嵌入式系统应用程序启动速度的方法
CN103970559A (zh) * 2013-02-05 2014-08-06 北京壹人壹本信息科技有限公司 一种基于Android系统的设备加载方法及装置
CN106325927A (zh) * 2016-08-19 2017-01-11 北京金山安全管理系统技术有限公司 一种应用于Linux系统中动态库API的拦截方法及装置

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6363436B1 (en) * 1997-01-27 2002-03-26 International Business Machines Corporation Method and system for loading libraries into embedded systems
US6708330B1 (en) * 2000-06-13 2004-03-16 Cisco Technology, Inc. Performance improvement of critical code execution
US8520517B2 (en) * 2007-02-21 2013-08-27 Broadcom Corporation Switch fabric end-to-end congestion avoidance mechanism
CN101470619A (zh) 2007-12-29 2009-07-01 安凯(广州)软件技术有限公司 一种基于微核操作系统的应用程序动态加载方法
CN101697131B (zh) * 2009-11-04 2013-07-03 中兴通讯股份有限公司 一种可重定位文件动态加载的方法及装置
CN102819439B (zh) * 2011-06-10 2017-09-29 中兴通讯股份有限公司 一种基于重定位的多制式应用程序的动态加载方法和装置
ES2439804B1 (es) * 2012-04-19 2014-10-29 Universitat Politècnica De Catalunya Procedimiento, sistema y pieza de código ejecutable para virtualizar un recurso de hardware asociado a un sistema informático
US9087191B2 (en) * 2012-08-24 2015-07-21 Vmware, Inc. Method and system for facilitating isolated workspace for applications
CN103744709B (zh) * 2014-01-23 2017-02-15 华为技术有限公司 补丁加载方法及装置
CN106227668B (zh) * 2016-07-29 2017-11-17 腾讯科技(深圳)有限公司 数据处理方法和装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102147743A (zh) * 2011-03-28 2011-08-10 博视联(苏州)信息科技有限公司 加快嵌入式系统应用程序启动速度的方法
CN103970559A (zh) * 2013-02-05 2014-08-06 北京壹人壹本信息科技有限公司 一种基于Android系统的设备加载方法及装置
CN106325927A (zh) * 2016-08-19 2017-01-11 北京金山安全管理系统技术有限公司 一种应用于Linux系统中动态库API的拦截方法及装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110908882A (zh) * 2019-11-14 2020-03-24 北京无限光场科技有限公司 一种应用程序的性能分析方法、装置、终端设备及介质
CN113868565A (zh) * 2021-09-23 2021-12-31 深圳市腾讯网域计算机网络有限公司 皮肤样式的文件编辑方法及装置
CN113868565B (zh) * 2021-09-23 2024-05-24 深圳市腾讯网域计算机网络有限公司 皮肤样式的文件编辑方法及装置

Also Published As

Publication number Publication date
US10908925B2 (en) 2021-02-02
US20200278875A1 (en) 2020-09-03
CN109814939B (zh) 2021-10-15
CN109814939A (zh) 2019-05-28

Similar Documents

Publication Publication Date Title
WO2019095968A1 (zh) 一种动态加载方法、目标文件的制作方法及装置
EP2754032B1 (en) Transformational context-aware data source management
US10089089B2 (en) Data type reassignment
JP2005032259A (ja) 共有ライブラリーシステム及び前記システム構築方法
US10789047B2 (en) Returning a runtime type loaded from an archive in a module system
CN112631684B (zh) 可执行程序的运行方法、装置、电子设备及计算机存储介质
WO2015195418A1 (en) Software package management
CN108279940B (zh) 一种web容器中的模块加载方法和装置
US10402204B1 (en) Multi-platform firmware support
CN106775781B (zh) 减小应用安装包的方法、装置及电子设备
CN115994122B (zh) 快速缓存信息的方法、系统、设备及储存介质
US9772835B1 (en) Modification of program code for execution in a multi-tenant or distributed computing environment
WO2022042252A1 (zh) 驱动配置管理方法、装置、介质、设备及系统
US10540151B1 (en) Graphical customization of a firmware-provided user interface (UI)
US11200203B1 (en) Accessing files stored in a firmware volume from a pre-boot application
AU2016378425B2 (en) Application program running method and apparatus
CN114816772B (zh) 基于兼容层运行的应用的排错方法、排错系统及计算设备
CN110941443A (zh) 修改sdk中文件名的方法、装置及电子设备
CN116225450A (zh) 文本转换方法和装置,计算设备和可读存储介质
US20100180269A1 (en) Domains with polymorphic type implementations
CN112148746B (zh) 生成数据库表结构文档的方法、装置、电子装置和存储介质
Viswanathan A guide to using LZO compression in Hadoop
CN114077575A (zh) 用于内存快照文件的格式转换方法、设备和系统
US8135943B1 (en) Method, apparatus, and computer-readable medium for generating a dispatching function
JP2001273141A (ja) コンピュータシステム、仮想マシン、オブジェクトの実行時表現方法、記憶媒体及びプログラム伝送装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18877592

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 18877592

Country of ref document: EP

Kind code of ref document: A1