CN103513995B - Control method and electronic equipment - Google Patents
Control method and electronic equipment Download PDFInfo
- Publication number
- CN103513995B CN103513995B CN201210206420.6A CN201210206420A CN103513995B CN 103513995 B CN103513995 B CN 103513995B CN 201210206420 A CN201210206420 A CN 201210206420A CN 103513995 B CN103513995 B CN 103513995B
- Authority
- CN
- China
- Prior art keywords
- function
- reorientation
- address
- functions
- wanting
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Abstract
Provide control method and electronic equipment.This control method is applied to the loading to program of the controlled loading device, wherein, program includes multiple function, this control method includes: before loader loading procedure, create a function relocation table, wherein, this function relocation table includes the one or more functions wanting reorientation in multiple function and self-defined address thereof;And, loader is according to this function relocation table loading procedure, one or more functions of reorientation will be loaded into its self-defined address.By control method according to embodiments of the present invention and electronic equipment, it is achieved that during loader loading procedure, the accurate of relocatable address to function controls, thus improves the performance of system.
Description
Technical field
The present invention relates to control method and electronic equipment.
Background technology
In current electronic equipment, operating system can use loader to add program or dynamic base
Carry, and when loader loading procedure or dynamic base, program or dynamic base can be carried out by loader
Reorientation.
Generally, the execution of program or dynamic base can relate to one or more dependence storehouse, and, in journey
When sequence or dynamic base are performed, loader can load all of dependence storehouse, and carries out these dependence storehouses
Reorientation.
In the prior art, each function generally includes multiple function, from broad sense, dynamic base and
Rely on storehouse and can also be looked at as program, and include multiple function in these storehouses.
So, when in an operating system, during loader loading procedure, for function included in program
Reorientation be uncontrollable to a great extent, this has resulted in the function that is difficult in finder
Problem.
Summary of the invention
Therefore, the present invention is made for above-mentioned problems of the prior art and demand.
Embodiments providing a kind of control method and electronic equipment, it can accurately control loading
Address to the reorientation of function during device loading procedure, thus improve the performance of system.
An aspect according to embodiments of the present invention, it is provided that a kind of control method, is applied to controlled loading
The device loading to program, wherein, described program includes that multiple function, described control method include: in institute
Before stating the loader described program of loading, create a function relocation table, wherein, described function reorientation
Table includes the one or more functions wanting reorientation in the plurality of function and self-defined address thereof;And,
Described loader loads described program according to described function relocation table, with by described want reorientation one
Or multiple function is loaded into its self-defined address.
In above-mentioned control method, described program is dynamic base, and includes one or more dependence storehouse.
In above-mentioned control method, the self-defined address of the described one or more functions wanting reorientation is new
Function address;And, the described one or more functions wanting reorientation are loaded into new function address
Corresponding to performing the new function corresponding with described new function address.
In above-mentioned control method, the self-defined address of the described one or more functions wanting reorientation is different
Normal memory address;And, the described one or more functions wanting reorientation are loaded into abnormal internal memory
Address is corresponding to wanting the exception of one or more functions of reorientation described in capture.
In above-mentioned control method, described abnormal memory address is the memory address of lack of competence.
In above-mentioned control method, described loader loads described program in virtualization system;And,
Described control method farther includes: after capturing the exception of the one or more functions wanting reorientation,
Host side is changed in the virtualization end-grain cutting from virtualization system that performs of the one or more function.
Another aspect according to embodiments of the present invention, it is provided that a kind of electronic equipment, including: loader,
Being configured to load program under the operating system of described electronic equipment, described program includes multiple letter
Number;And, table creating unit, it is configured to, before described loader loads described program, create a letter
Number relocation table, described function relocation table includes that wants reorientation in the plurality of function or many
Individual function and self-defined address thereof;Wherein, described loader is according to the letter created by described table creating unit
Number relocation table loads described program, the described one or more functions wanting reorientation to be loaded into it certainly
Definition address.
In above-mentioned electronic equipment, described program is dynamic base, and includes one or more dependence storehouse.
In above-mentioned electronic equipment, the self-defined address of the described one or more functions wanting reorientation is new
Function address;And, the described one or more functions wanting reorientation are loaded into newly by described loader
Function address corresponding to performing the new function corresponding with described new function address.
In above-mentioned electronic equipment, the self-defined address of the described one or more functions wanting reorientation is different
Normal memory address;And, the described one or more functions wanting reorientation are loaded into by described loader
Abnormal memory address is corresponding to wanting the exception of one or more functions of reorientation described in capture.
In above-mentioned electronic equipment, described abnormal memory address is the memory address of lack of competence.
In above-mentioned electronic equipment, described loader loads institute under the virtualization system of described operating system
State program;And, described electronic equipment farther includes: switch unit, is configured at described loader
After capturing the exception of the one or more functions wanting reorientation, holding the one or more function
Row changes to host side from the virtualization end-grain cutting of described virtualization system.
By control method according to embodiments of the present invention and electronic equipment, it is achieved that loader loading procedure
During accurate control to the relocatable address of function, thus improve the performance of system.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to reality
Execute the required accompanying drawing used in example or description of the prior art to be briefly described, it should be apparent that below,
Accompanying drawing in description is only some embodiments of the present invention, for those of ordinary skill in the art,
On the premise of not paying creative work, it is also possible to obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the indicative flowchart illustrating control method according to embodiments of the present invention;
Fig. 2 is the schematic block diagram illustrating electronic equipment according to embodiments of the present invention.
Detailed description of the invention
Below, will be described in detail with reference to accompanying drawings control method according to embodiments of the present invention and electronic equipment.
An aspect according to embodiments of the present invention, it is provided that a kind of control method, is applied to controlled loading
The device loading to program, wherein, described program includes that multiple function, described control method include: in institute
Before stating the loader described program of loading, create a function relocation table, wherein, described function reorientation
Table includes the one or more functions wanting reorientation in the plurality of function and self-defined address thereof;And,
Described loader loads described program according to described function relocation table, with by described want reorientation one
Or multiple function is loaded into its self-defined address.
By control method according to embodiments of the present invention, can when loader loading procedure finder
In each function, thus realize being accurately positioned of the function in program, this can be with the letter in settlement procedure
Number is difficult to the more produced problems in location, is specifically described below.
Fig. 1 is the indicative flowchart illustrating control method according to embodiments of the present invention.As it is shown in figure 1,
Control method according to embodiments of the present invention is applied to the loading to program of the controlled loading device, wherein, program
Including multiple functions, this control method includes: S1, before loader loading procedure, creates a function
Relocation table, wherein, this function relocation table includes wanting the one or more of reorientation in multiple function
Function and self-defined address thereof;And, S2, loader carrys out loading procedure according to function relocation table, with
One or more functions of reorientation will be loaded into its self-defined address.
In the control method of the embodiment of the present invention, described program is dynamic base, and includes one or more
Rely on storehouse.
Dynamic base is also called dynamic link library (DLL:Dynamic Link Library), and it is one and comprises
The code that simultaneously can be used by multiple programs and the storehouse of data rather than executable file.Dynamic link carries
Supply a kind of method, made process can call the function being not belonging to its executable code, wherein, function
Executable code is positioned in a dynamic base, and this dynamic base comprises and one or more is compiled, links also
With the function using their process to be stored separately.Dynamic base additionally aids shared data and resource, multiple
Application program can access the content of single dynamic base copy in internal memory simultaneously.
As it has been described above, dynamic base and dependence storehouse can be regarded as program, and include multiple letter wherein
Number, when loader loads dynamic base and relies on storehouse, the most also can carry out reorientation for function therein.
Owing to this reorientation cannot be controlled by operating system to a great extent, therefore cannot accurately control
Function processed address after the relocation, and under some applied environment, may be required to again position storehouse
In function, this resulted in some inconvenience.
In the control method of the embodiment of the present invention, making by oneself of the described one or more functions wanting reorientation
Location, free burial ground for the destitute is new function address;And, the described one or more functions wanting reorientation are loaded into newly
Function address corresponding to performing the new function corresponding with described new function address.
If as it has been described above, by the function locating that comprises in storehouse to new function address, then loader pair
The loading of the function in storehouse then corresponds to perform the function corresponding with this new function address, and this is actually
The execution to the function in storehouse can be defined, thus realize the desired function of user.Because at physical memory
In, the function address corresponding with new function is known, by controlling party according to embodiments of the present invention
The function loaded by loader is reoriented to this new function address by method, it is possible to perform this new function
The function being had, something which increases the functional of operating system, thus enhances system
Performance.
In the control method of the embodiment of the present invention, making by oneself of the described one or more functions wanting reorientation
Location, free burial ground for the destitute is abnormal memory address;And, the described one or more functions wanting reorientation are loaded into
Abnormal memory address is corresponding to wanting the exception of one or more functions of reorientation described in capture.
In the control method of the embodiment of the present invention, described abnormal memory address is the internal memory ground of lack of competence
Location.
In the control method of the embodiment of the present invention, described loader loads described journey in virtualization system
Sequence;And, described control method farther includes: capturing the one or more functions wanting reorientation
Exception after, by the one or more function perform change to from the virtualization end-grain cutting of virtualization system
Host side.
In an operating system, it is sometimes desirable to deliberately capture the exception of the function of reorientation, in order to perform
User specifically operates, such as, by capturing the exception of function, when loader adds in virtualization system
During load program, so that host side is changed in the virtualization end-grain cutting from virtualization system that performs of this function.
In current operation system, host side is generally of the process performance more higher than virtualization end.Such as, with
As a example by image procossing, host side can use graph processing chips hardware-accelerated to carry out, and virtualizes end
Then it is only capable of and uses PaintShop to carry out software acceleration, so, for image procossing, show
So can realize more superior process performance in host side.Therefore, for some function, may
It performs to need higher process performance, and this is accomplished by this function is performed the void from virtualization system
Planization end-grain cutting is changed to host side and is performed.But, in the ordinary course of things, this owing to capturing
Need the function of hand-off process, it is impossible to carry out above-mentioned switching, and by control according to embodiments of the present invention
Method, by the function that loader loads is reoriented to abnormal memory address, then can capture weight
The exception of the function after location so that the execution of switching function is possibly realized.
In these cases, abnormal memory address can be that user refers in actual physical address in advance
One section of fixed memory address, and this section of memory address can identify by operating system.Such as, here
This section of memory address can be the memory address of lack of competence, such as, without read right or without write permission, or
Person is without access limit, and so, when function is relocated to this section of physical address, operating system just will inspection
Measure exception.Such as, if this section of physical address is without write permission, then the function that loader loads is by nothing
Method is written to this section of physical memory, thus operating system identifies exception.Or, this section of physical memory
Address can have corresponding mark, to be identified by operating system or user.Here, this area
Those of skill will appreciate that, in control method according to embodiments of the present invention, abnormal memory address is also
It is not necessarily mean that this section of memory address has mistake, but is reoriented to this section of memory address for capture
Function, reset thus, it is only required to want to be identified by some by operating system or user
Position is to the function of these addresses.
As it has been described above, during loader loading procedure, it may be necessary to by some function in program
It is reoriented to accurate self-defined address to realize the function of some enhancement mode of system.Here, this area
Those of skill will appreciate that, it is the concrete need according to system which function is reoriented to self-defining address
Ask and set, be not required to the function without particular utility is positioned accurately.Therefore, in basis
In the control method of the embodiment of the present invention, the function relocation table created only includes program comprises
All functions need carry out the function of reorientation and need by these function locatings to make free burial ground for the destitute by oneself
Location, such as, function that above-mentioned needs perform as new function or need to capture the function of its exception.
Here, the function relocation table of this establishment is to create with the form that loader is readable, thus works as loader
During loading procedure, can according to this function relocation table the function of needs is loaded in table concrete restriction from
At definition address.
Another aspect according to embodiments of the present invention, it is provided that a kind of electronic equipment, including: loader,
Being configured to load program under the operating system of described electronic equipment, described program includes multiple letter
Number;And, table creating unit, it is configured to, before described loader loads described program, create a letter
Number relocation table, described function relocation table includes that wants reorientation in the plurality of function or many
Individual function and self-defined address thereof;Wherein, described loader is according to the letter created by described table creating unit
Number relocation table loads described program, the described one or more functions wanting reorientation to be loaded into it certainly
Definition address.
Fig. 2 is the schematic block diagram illustrating electronic equipment according to embodiments of the present invention.As in figure 2 it is shown,
Electronic equipment 100 includes: loader 101, is configured under the operating system of electronic equipment 100 journey
Sequence loads, and this program includes multiple function;And, table creating unit 102, it is configured to loading
Before device 101 loading procedure, creating a function relocation table, this function relocation table includes the plurality of letter
The one or more functions wanting reorientation in number and self-defined address thereof;Wherein, loader 101 basis
The function relocation table loading procedure created by table creating unit 102, with will or many of reorientation
Individual function is loaded into its self-defined address.
In above-mentioned electronic equipment, described program is dynamic base, and includes one or more dependence storehouse.
In above-mentioned electronic equipment, the self-defined address of the described one or more functions wanting reorientation is new
Function address;And, the described one or more functions wanting reorientation are loaded into newly by described loader
Function address corresponding to performing the new function corresponding with described new function address.
In above-mentioned electronic equipment, the self-defined address of the described one or more functions wanting reorientation is different
Normal memory address;And, the described one or more functions wanting reorientation are loaded into by described loader
Abnormal memory address is corresponding to wanting the exception of one or more functions of reorientation described in capture.
In above-mentioned electronic equipment, described abnormal memory address is the memory address of lack of competence.
In above-mentioned electronic equipment, described loader loads institute under the virtualization system of described operating system
State program;And, described electronic equipment farther includes: switch unit, is configured at described loader
After capturing the exception of the one or more functions wanting reorientation, holding the one or more function
Row changes to host side from the virtualization end-grain cutting of described virtualization system.
Here, other details of electronic equipment according to embodiments of the present invention is previously with regards to according to the present invention
Details in the description that the control method of embodiment is done is identical, therefore to avoid repeating will not be described in great detail.
It will be understood by those skilled in the art that above-mentioned electronic equipment can have and carry out loading procedure with loader
Any electronic equipment of operating system, and it is not limited to computer system.
And, although in the above description, mainly it is described as a example by built-in function, but this area
Those of skill will appreciate that, control method and electronic equipment according to embodiments of the present invention can apply to add
Carrying the device loading to random procedure, to strengthen systematic function, the embodiment of the present invention is not intended to carry out this
Arbitrarily limit.
By control method according to embodiments of the present invention and electronic equipment, it is achieved that loader loading procedure
During accurate control to the relocatable address of function, thus improve the performance of system.
The present invention has been described in detail by reference to specific embodiment.It may be evident, however, that without departing substantially from
In the case of the spirit of the present invention, those skilled in the art can perform change and replace embodiment.Change
Sentence is talked about, and the form of present invention explanation is open rather than explains with being limited.The present invention's to be judged
Main idea, it is contemplated that appended claim.
Claims (10)
1. a control method, is applied to the loading to program of the controlled loading device, wherein, described program bag
Including multiple function, described control method includes:
Before described loader loads described program, create a function relocation table, wherein, described letter
Number relocation table includes the one or more functions wanting reorientation in the plurality of function and makes free burial ground for the destitute by oneself
Location;And
Described loader loads described program according to described function relocation table, to want reorientation by described
One or more functions are loaded into its self-defined address,
Wherein, the self-defined address of the described one or more functions wanting reorientation is abnormal memory address;
And
The described one or more functions wanting reorientation are loaded into abnormal memory address corresponding to capture institute
State the exception of the one or more functions wanting reorientation.
2. control method as claimed in claim 1, wherein, described program is dynamic base, and includes one
Individual or multiple dependence storehouses.
3. control method as claimed in claim 1, wherein, the described one or more letters wanting reorientation
The self-defined address of number is new function address;And
The described one or more functions wanting reorientation are loaded into new function address corresponding to performing and institute
State the new function that new function address is corresponding.
4. control method as claimed in claim 1, wherein, described abnormal memory address is lack of competence
Memory address.
5. control method as claimed in claim 1, wherein, described loader adds in virtualization system
Carry described program;And
Described control method farther includes:
After capturing the exception of the one or more functions wanting reorientation, by the one or more letter
Host side is changed in the virtualization end-grain cutting from virtualization system that performs of number.
6. an electronic equipment, including:
Loader, is configured to load program under the operating system of described electronic equipment, described journey
Sequence includes multiple function;And
Table creating unit, is configured to, before described loader loads described program, create a function and reset
Position table, described function relocation table includes the one or more functions wanting reorientation in the plurality of function
And self-defined address;
Wherein, described loader loads described according to the function relocation table created by described table creating unit
Program, so that the described one or more functions wanting reorientation to be loaded into its self-defined address, described to weigh
The self-defined address of one or more functions of location is abnormal memory address, and, described loader
The described one or more functions wanting reorientation are loaded into abnormal memory address want corresponding to capture is described
The exception of one or more functions of reorientation.
7. electronic equipment as claimed in claim 6, wherein, described program is dynamic base, and includes one
Individual or multiple dependence storehouses.
8. electronic equipment as claimed in claim 6, wherein, the described one or more letters wanting reorientation
The self-defined address of number is new function address;And
It is corresponding that the described one or more functions wanting reorientation are loaded into new function address by described loader
In performing the new function corresponding with described new function address.
9. electronic equipment as claimed in claim 6, wherein, described abnormal memory address is lack of competence
Memory address.
10. electronic equipment as claimed in claim 6, wherein, described loader is in described operating system
Virtualization system under load described program;And
Described electronic equipment farther includes:
Switch unit, is configured to capture at described loader want one or more functions different of reorientation
After Chang, the virtualization end-grain cutting from described virtualization system that performs of the one or more function is changed to
Host side.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210206420.6A CN103513995B (en) | 2012-06-18 | 2012-06-18 | Control method and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210206420.6A CN103513995B (en) | 2012-06-18 | 2012-06-18 | Control method and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103513995A CN103513995A (en) | 2014-01-15 |
CN103513995B true CN103513995B (en) | 2016-09-28 |
Family
ID=49896778
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210206420.6A Active CN103513995B (en) | 2012-06-18 | 2012-06-18 | Control method and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103513995B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107085514B (en) * | 2017-03-06 | 2021-02-19 | 北京安博通科技股份有限公司 | Shared library upgrading method and device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5542059A (en) * | 1994-01-11 | 1996-07-30 | Exponential Technology, Inc. | Dual instruction set processor having a pipeline with a pipestage functional unit that is relocatable in time and sequence order |
US6687899B1 (en) * | 1999-09-03 | 2004-02-03 | Stmicroelectronics Limited | Relocation format for linking |
CN101504656A (en) * | 2009-03-26 | 2009-08-12 | 成都磐石软件有限责任公司 | Combined execution method for PE document code |
CN101799763A (en) * | 2009-02-10 | 2010-08-11 | 华为技术有限公司 | Method, device and system for patching kernel on line |
CN102073529A (en) * | 2011-01-30 | 2011-05-25 | 华为技术有限公司 | Method and computer system for upgrading super kernel component |
-
2012
- 2012-06-18 CN CN201210206420.6A patent/CN103513995B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5542059A (en) * | 1994-01-11 | 1996-07-30 | Exponential Technology, Inc. | Dual instruction set processor having a pipeline with a pipestage functional unit that is relocatable in time and sequence order |
US6687899B1 (en) * | 1999-09-03 | 2004-02-03 | Stmicroelectronics Limited | Relocation format for linking |
CN101799763A (en) * | 2009-02-10 | 2010-08-11 | 华为技术有限公司 | Method, device and system for patching kernel on line |
CN101504656A (en) * | 2009-03-26 | 2009-08-12 | 成都磐石软件有限责任公司 | Combined execution method for PE document code |
CN102073529A (en) * | 2011-01-30 | 2011-05-25 | 华为技术有限公司 | Method and computer system for upgrading super kernel component |
Also Published As
Publication number | Publication date |
---|---|
CN103513995A (en) | 2014-01-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101971389B1 (en) | Federation-based memory management | |
CN107786730B (en) | Task management method and terminal | |
CN109155782B (en) | Inter-process communication between containers | |
US20190213019A1 (en) | Application program page processing method and device | |
CN102132289B (en) | Method and device for code obfuscation | |
ES2892976T3 (en) | Robotic user interface generation in response to connecting peripherals to the robot | |
CN103365668B (en) | A kind of dynamic link library loads and the method, apparatus of link | |
EP2867771A1 (en) | Optimizing placement of virtual machines | |
CN104731622B (en) | The loading method of a kind of application program, device and mobile terminal | |
WO2012039053A1 (en) | Method of managing computer system operations, computer system and computer-readable medium storing program | |
CN103927193B (en) | Loading method, service end virtual machine during the migration operation of java application function | |
CN106096418B (en) | SELinux-based startup security level selection method and device and terminal equipment | |
CN105488415A (en) | System process scanning method and apparatus | |
CN105653438A (en) | Method and device for cross-process automated testing of Android device | |
CN105528179A (en) | System and method of transfer of control between memory locations | |
CN104657658A (en) | Application installation method and terminal | |
CN108647061A (en) | Call method, device and the computing device of system hidden method | |
CN109271789A (en) | Malicious process detection method, device, electronic equipment and storage medium | |
CN103257881A (en) | Plug-in operation method based on browser, browser device and terminal | |
EP2856306B1 (en) | Virtualizing integrated calls to provide access to resources in a virtual namespace | |
CN104090752A (en) | Method for promoting customization of shortcut icon on desktop of android system | |
US11036852B2 (en) | System and method for software diversification | |
CN105653133A (en) | Extension method and device of application programs | |
CN103513995B (en) | Control method and electronic equipment | |
CN101309149A (en) | Address processing method and apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |