I read Here.
As far as I understand, R_386_32
is for static data, and R_386_PC32
is for function. right?
However I'm still confusing about the usage of R_386_32
type symbol.
See below example.
Example 1
readelf -a --wide /usr/lib/i386-linux-gnu/crt1.o | grep R_386_32
0000000c 00000901 R_386_32 00000000 __libc_csu_fini
00000011 00000b01 R_386_32 00000000 __libc_csu_init
00000018 00000c01 R_386_32 00000000 main
Example 2
readelf -a --wide /usr/local/lib/gcc/i686-pc-linux-gnu/5.5.0/crtbegin.o
00000001 00001501 R_386_32 00000000 __TMC_END__
00000010 00001601 R_386_32 00000000 _ITM_deregisterTMCloneTable
00000031 00001501 R_386_32 00000000 __TMC_END__
00000049 00001701 R_386_32 00000000 _ITM_registerTMCloneTable
000000a1 00001901 R_386_32 00000000 _Jv_RegisterClasses
Question
- In Example 2,
R_386_32
typed datas are automatically added to Application
while in compile time? - If yes, can I reference those data in my code?
For example, Can I make the Application that printf the value of_Jv_RegisterClasses
? - In Example 1, Why main is
R_386_32
type?
I think It should beR_386_PC32
, because it is not static data, it is function.