How to read object file move records

I am trying to understand the stage of linking the C toolkit. I wrote a sample program and dismembered the resulting object file. Although this has helped me better understand the processes involved, there are some things that remain obscure to me.

Here:

Part 1: Processing initialized variables.

Is it correct that theses of the entries of the displacement table ...

RELOCATION RECORDS FOR [.text]:
OFFSET   TYPE              VALUE
0000002b dir32             .data
00000035 dir32             .data
0000003f dir32             .data

... basically tell the linker that addresses stored offset 2b, 35and 3ffrom .text, are not absolute addresses and relative addresses (= offset) with respect to .data? I understand that this allows the linker

  • ,
  • , - .

2: .

, - . ,

  • (0x0, 0x0 0x0),
  • (0x0, 0x4 0x8)?

. , .bss.

RELOCATION RECORDS FOR [.text]:
OFFSET   TYPE              VALUE
0000000d dir32             _var1_zeroed-0x00000004
00000017 dir32             _var2_zeroed-0x00000004
00000021 dir32             _var3_zeroed-0x00000004
+4
1

... , ...

, . , , .

, , . , , . , , - , .

, , . , .data , .text + 0x2b,.text + 0x35 .. , , _var1_zeroed-0x00000004 , .text + 0x0d,.text + 0x17 ..

+2

All Articles