+ support 48-bit (16:32) far pointer relocations in the OMF internal linker

git-svn-id: trunk@32928 -
This commit is contained in:
nickysn 2016-01-11 17:50:27 +00:00
parent 02a6b77e32
commit e628729e1d
2 changed files with 47 additions and 6 deletions

View File

@ -71,6 +71,8 @@ interface
RELOC_RELATIVE32,
RELOC_FARPTR,
RELOC_FARPTR_RELATIVEOFFSET,
RELOC_FARPTR48,
RELOC_FARPTR48_RELATIVEOFFSET,
RELOC_SEG,
RELOC_SEGREL,
RELOC_DGROUP,

View File

@ -1576,6 +1576,13 @@ implementation
fmSelfRelative:
RelocType:=RELOC_FARPTR_RELATIVEOFFSET;
end;
fltFarPointer48:
case Fixup.Mode of
fmSegmentRelative:
RelocType:=RELOC_FARPTR48;
fmSelfRelative:
RelocType:=RELOC_FARPTR48_RELATIVEOFFSET;
end;
end;
if RelocType=RELOC_NONE then
begin
@ -1634,6 +1641,13 @@ implementation
fmSelfRelative:
RelocType:=RELOC_FARPTR_RELATIVEOFFSET;
end;
fltFarPointer48:
case Fixup.Mode of
fmSegmentRelative:
RelocType:=RELOC_FARPTR48;
fmSelfRelative:
RelocType:=RELOC_FARPTR48_RELATIVEOFFSET;
end;
end;
if RelocType=RELOC_NONE then
begin
@ -1692,6 +1706,13 @@ implementation
fmSelfRelative:
RelocType:=RELOC_FARPTR_RELATIVEOFFSET;
end;
fltFarPointer48:
case Fixup.Mode of
fmSegmentRelative:
RelocType:=RELOC_FARPTR48;
fmSelfRelative:
RelocType:=RELOC_FARPTR48_RELATIVEOFFSET;
end;
end;
if RelocType=RELOC_NONE then
begin
@ -2471,11 +2492,11 @@ implementation
else
framebase:=TOmfObjSection(objreloc.symbol.objsection).MZExeUnifiedLogicalSegment.MemBasePos;
case objreloc.typ of
RELOC_ABSOLUTE16,RELOC_ABSOLUTE32,RELOC_SEG,RELOC_FARPTR:
RELOC_ABSOLUTE16,RELOC_ABSOLUTE32,RELOC_SEG,RELOC_FARPTR,RELOC_FARPTR48:
fixupamount:=target-framebase;
RELOC_RELATIVE16,RELOC_SEGREL,RELOC_FARPTR_RELATIVEOFFSET:
fixupamount:=target-(omfsec.MemPos+objreloc.DataOffset)-2;
RELOC_RELATIVE32:
RELOC_RELATIVE32,RELOC_FARPTR48_RELATIVEOFFSET:
fixupamount:=target-(omfsec.MemPos+objreloc.DataOffset)-4;
else
internalerror(2015082402);
@ -2496,6 +2517,12 @@ implementation
FixupOffset;
FixupBase(objreloc.DataOffset+2);
end;
RELOC_FARPTR48,
RELOC_FARPTR48_RELATIVEOFFSET:
begin
FixupOffset32;
FixupBase(objreloc.DataOffset+4);
end;
else
internalerror(2015082403);
end;
@ -2508,11 +2535,11 @@ implementation
else
framebase:=TOmfObjSection(objreloc.objsection).MZExeUnifiedLogicalSegment.MemBasePos;
case objreloc.typ of
RELOC_ABSOLUTE16,RELOC_ABSOLUTE32,RELOC_SEG,RELOC_FARPTR:
RELOC_ABSOLUTE16,RELOC_ABSOLUTE32,RELOC_SEG,RELOC_FARPTR,RELOC_FARPTR48:
fixupamount:=target-framebase;
RELOC_RELATIVE16,RELOC_SEGREL,RELOC_FARPTR_RELATIVEOFFSET:
fixupamount:=target-(omfsec.MemPos+objreloc.DataOffset)-2;
RELOC_RELATIVE32:
RELOC_RELATIVE32,RELOC_FARPTR48_RELATIVEOFFSET:
fixupamount:=target-(omfsec.MemPos+objreloc.DataOffset)-4;
else
internalerror(2015082405);
@ -2533,6 +2560,12 @@ implementation
FixupOffset;
FixupBase(objreloc.DataOffset+2);
end;
RELOC_FARPTR48,
RELOC_FARPTR48_RELATIVEOFFSET:
begin
FixupOffset32;
FixupBase(objreloc.DataOffset+4);
end;
else
internalerror(2015082406);
end;
@ -2546,11 +2579,11 @@ implementation
else
framebase:=target_group.MemPos;
case objreloc.typ of
RELOC_ABSOLUTE16,RELOC_ABSOLUTE32,RELOC_SEG,RELOC_FARPTR:
RELOC_ABSOLUTE16,RELOC_ABSOLUTE32,RELOC_SEG,RELOC_FARPTR,RELOC_FARPTR48:
fixupamount:=target-framebase;
RELOC_RELATIVE16,RELOC_SEGREL,RELOC_FARPTR_RELATIVEOFFSET:
fixupamount:=target-(omfsec.MemPos+objreloc.DataOffset)-2;
RELOC_RELATIVE32:
RELOC_RELATIVE32,RELOC_FARPTR48_RELATIVEOFFSET:
fixupamount:=target-(omfsec.MemPos+objreloc.DataOffset)-4;
else
internalerror(2015111202);
@ -2571,6 +2604,12 @@ implementation
FixupOffset;
FixupBase(objreloc.DataOffset+2);
end;
RELOC_FARPTR48,
RELOC_FARPTR48_RELATIVEOFFSET:
begin
FixupOffset32;
FixupBase(objreloc.DataOffset+4);
end;
else
internalerror(2015111203);
end;