Patent ID: 8499291
Filing Date: 2013-07-30
Classification: G06F

Abstract:
1. A method of dynamically linking an application program on an embedded platform, wherein the embedded platform comprises a middle layer, the middle layer comprises at least one class, each class is encapsulated from at least one function interface of an embedded operation system and corresponds to a virtual function table, and elements of the virtual function table respectively correspond to the at least one function interface of the embedded operation system, an application program to be linked comprises at least one class, each class is encapsulated from at least one function interface of the application program and corresponds to the virtual function table, and elements of the virtual function table respectively correspond to the at least one function interface of the application program; the method comprises: compiling the application program into Position Independence Codes (PICs), wherein storage positions of different code sections in the PICs which are obtained by compiling different functions of the application program do not overlap with each other; copying all the PICs into a memory of the embedded operation system; creating a class pointer, and transferring the class pointer between a class of a middle layer and the class of the application program to dynamically link the application program; wherein the PICs are a binary BIN file; and the compiling comprises: compiling the application program by using a thumb mode; creating a class pointer, and transferring the class pointer between a class of a middle layer and the class of the application program to dynamically link the application program comprises: when the embedded operation system invokes the application program through the middle layer for the first time, creating an entry point pointer of the application program which points to a position obtained by shifting an initial address of a buffer in which the BIN file of the application program is located for 4 bytes, and operating an entry point.