|globe pointer($gp) introduce
|Page 1 of 1|
|Author:||jerry [ Mon Sep 15, 2014 4:08 pm ]|
|Post subject:||globe pointer($gp) introduce|
1、globe pointer($gp) define
1.1、It is the address in the middle of data sections.
1.2、Linker places scalar data around it so that they can be accessed efficiently by $gp-based load/store instructions and their addresses can be calculated efficiently by $gp-based add instructions.
2、$gp relative instruction
Rt = [imm17s<<2]
The (imm17s << 2) value covers a range of 512K byte region relative to the location pointed to by the GP register.
2.2、ADDI.gp Rt, imm19s
Rt = R29 + SE(imm19s)
The imm19s value covers a range of 512K byte region relative to the location pointed to by the GP register.
3、$gp example at assembly
3.1.1、Default is on.
3.1.2、Trun off relax linker option : -mno-relax.
-mno-relax.png [ 326.47 KiB | Viewed 15507 times ]
mem_test2.zip [58.29 KiB]
Downloaded 986 times
圖片1.jpg [ 10.49 KiB | Viewed 15507 times ]
No relax function
圖片2.jpg [ 14.43 KiB | Viewed 15507 times ]
|Author:||jerry [ Wed Feb 04, 2015 3:35 pm ]|
|Post subject:||Re: globe pointer($gp) introduce|
In AndeSight v210 or BSPv400 , the compiler is implement "cmodel" function.
What is the "cmodel"?
The cmodel default is medium.
The compiler can not disable the gp instruction at cmodel=medium and cmodel=small.
If don't the gp instruction that the setting c compiler addition "-mcmodel=large" and the linker addition "-mcmodel=large -mno-relax".
The "cmodel" option that the c compiler and linker must be the same.
|Page 1 of 1||All times are UTC + 8 hours [ DST ]|
|Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group