<html>
<head>
<meta http-equiv="content-type" content: text/html; charset=UTF-8>
</head>
<body>
I have some questions about compiler work on x86_64-win64.<br>
<br>
1) EXE-file contained .CRT section. As i understand it contained one
pointer to _FPC_Tls_Callback functions from RTL. Is it used only for
this?<br>
<br>
2) Why INITFINAL table on both Windows and Linux puted to .data section? Is
we need to change it in time of app run? Or even possible it must be
evicted and replace just with call instructions? I mean autogeneration of
fpc_InitializeUnits and fpc_FinalizeUnits?<br>
<br>
3) Why .fpc.n_version puted to .data section? Is we need change it on
runtime? Possible must be in .rdata? On linux it is entyre section for it,
does this is necessary?<br>
<br>
4) Why referencing to global variable under Windows all time compiled like
RIP-related, even if no Generate-PIC enable (on Linux work fine)?<br>
<br>
Example:<br>
Program Test;<br>
<br>
Var A: QWord;<br>
<br>
Begin<br>
A := 25;<br>
Asm<br>
MOV RAX, 25<br>
MOV [A], RAX<br>
End ['RAX'];<br>
End. <br>
<br>
Win64 code:<br>
Test.lpr:6 A := 25;<br>
00000000000115AE 48c70557fa000019000000 mov
QWORD PTR [rip+0xfa57],0x19 #
0x21010<br>
Test.lpr:8 MOV RAX, 25<br>
00000000000115B9 48b81900000000000000 movabs
rax,0x19<br>
Test.lpr:9 MOV [A], RAX<br>
00000000000115C3 48a31010020000000000 movabs
ds:0x21010,rax<br>
<br>
Linux with -Cg- (why in Lazarus PIC by default even when checkbox not
activated?):<br>
project1.lpr:6 A := 25;<br>
00000000004001F9 48c7042510fd620019000000 mov QWORD PTR
ds:0x62fd10,0x19<br>
project1.lpr:8 MOV RAX, 25<br>
0000000000400205 48b81900000000000000 movabs
rax,0x19<br>
project1.lpr:9 MOV [A], RAX<br>
000000000040020F 48a310fd620000000000 movabs
ds:0x62fd10,rax<br>
<br>
</body>
</html>