aboutsummaryrefslogtreecommitdiffstats
path: root/ortho/mcode/binary_file-memory.adb
diff options
context:
space:
mode:
authorgingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7>2006-08-06 06:45:40 +0000
committergingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7>2006-08-06 06:45:40 +0000
commit63925c8de8d3171e6b258796e4d167524691490a (patch)
treea8e7971f5889da0b7bba2cd7f9624c704d0145df /ortho/mcode/binary_file-memory.adb
parent3841c37a946481815c89928ccd15b71b608aa526 (diff)
downloadghdl-63925c8de8d3171e6b258796e4d167524691490a.tar.gz
ghdl-63925c8de8d3171e6b258796e4d167524691490a.tar.bz2
ghdl-63925c8de8d3171e6b258796e4d167524691490a.zip
bugs fixed
Diffstat (limited to 'ortho/mcode/binary_file-memory.adb')
-rw-r--r--ortho/mcode/binary_file-memory.adb23
1 files changed, 10 insertions, 13 deletions
diff --git a/ortho/mcode/binary_file-memory.adb b/ortho/mcode/binary_file-memory.adb
index c094e05ac..6e25f670d 100644
--- a/ortho/mcode/binary_file-memory.adb
+++ b/ortho/mcode/binary_file-memory.adb
@@ -32,10 +32,18 @@ package body Binary_File.Memory is
Set_Section (Sym, Sect_Abs);
end Set_Symbol_Address;
- procedure Write_Memory_Init
+ procedure Write_Memory_Init is
+ begin
+ Create_Section (Sect_Abs, "*ABS*", Section_Exec);
+ Sect_Abs.Vaddr := 0;
+ end Write_Memory_Init;
+
+ procedure Write_Memory_Relocate (Error : out Boolean)
is
use SSE;
Sect : Section_Acc;
+ Rel : Reloc_Acc;
+ N_Rel : Reloc_Acc;
begin
-- Relocate section in memory.
Sect := Section_Chain;
@@ -49,23 +57,12 @@ package body Binary_File.Memory is
--Sect.Data := new Byte_Array (1 .. 0);
end if;
end if;
- if Sect.Data_Max > 0 then
+ if Sect.Data_Max > 0 and Sect /= Sect_Abs then
Sect.Vaddr := To_Integer (Sect.Data (0)'Address);
end if;
Sect := Sect.Next;
end loop;
- Create_Section (Sect_Abs, "*ABS*", Section_Exec);
- Sect_Abs.Vaddr := 0;
- end Write_Memory_Init;
-
- procedure Write_Memory_Relocate (Error : out Boolean)
- is
- use SSE;
- Sect : Section_Acc;
- Rel : Reloc_Acc;
- N_Rel : Reloc_Acc;
- begin
-- Do all relocations.
Sect := Section_Chain;
Error := False;