Trying to write global variables in ASM block results in a SIGSEGV
Original Reporter info from Mantis: ahydra
-
Reporter name: Colin Haywood
Original Reporter info from Mantis: ahydra
- Reporter name: Colin Haywood
Description:
Both programs in the Steps to Reproduce section crash with a SIGSEGV on the single line of assembler.
In the first case the line is compiled as "mov 0x7, 0x7000" and in the second
"mov 0x7, 0xf010".
In both cases a warning is emitted about symbol relocation but I can't seem to find any info on what it means:
project1.lpr(18,1) Warning: Object file "project1.o" contains 32-bit absolute relocation to symbol ".bss.n_u_p
project1_$$_pr".
Steps to reproduce:
program Project1;
{$ASMMODE INTEL}
var
r: integer;
begin
asm
MOV r, 7 // crash!
end;
writeln(r);
readln();
end.
program Project1;
{$ASMMODE INTEL}
var
r: integer;
pr: pointer;
begin
pr := @r;
asm
MOV QWORD PTR [pr], 7
end;
writeln(r);
readln();
end.
Mantis conversion info:
- Mantis ID: 32905
- OS: Windows
- OS Build: 7
- Platform: x64
- Version: 3.0.4