|
@@ -168,7 +168,7 @@ interface
|
|
{ Convert symidx -> TObjSymbol }
|
|
{ Convert symidx -> TObjSymbol }
|
|
FSymTbl : ^TObjSymbolArray;
|
|
FSymTbl : ^TObjSymbolArray;
|
|
{ Convert secidx -> TObjSection }
|
|
{ Convert secidx -> TObjSection }
|
|
- FSecCount : smallint;
|
|
|
|
|
|
+ FSecCount : Longint;
|
|
FSecTbl : ^TObjSectionArray;
|
|
FSecTbl : ^TObjSectionArray;
|
|
win32 : boolean;
|
|
win32 : boolean;
|
|
function GetSection(secidx:longint):TObjSection;
|
|
function GetSection(secidx:longint):TObjSection;
|
|
@@ -1583,6 +1583,7 @@ const pemagic : array[0..3] of byte = (
|
|
result:=nil;
|
|
result:=nil;
|
|
if (secidx<1) or (secidx>FSecCount) then
|
|
if (secidx<1) or (secidx>FSecCount) then
|
|
begin
|
|
begin
|
|
|
|
+ writeln(secidx,' ',FSecCount);
|
|
InputError('Failed reading coff file, invalid section index');
|
|
InputError('Failed reading coff file, invalid section index');
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
@@ -1751,7 +1752,7 @@ const pemagic : array[0..3] of byte = (
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
bind:=AB_GLOBAL;
|
|
bind:=AB_GLOBAL;
|
|
- objsec:=GetSection(sym.section);
|
|
|
|
|
|
+ objsec:=GetSection(word(sym.section));
|
|
if sym.value>=objsec.mempos then
|
|
if sym.value>=objsec.mempos then
|
|
address:=sym.value-objsec.mempos;
|
|
address:=sym.value-objsec.mempos;
|
|
end;
|
|
end;
|
|
@@ -1768,7 +1769,7 @@ const pemagic : array[0..3] of byte = (
|
|
{ do not add constants (section=-1) }
|
|
{ do not add constants (section=-1) }
|
|
if sym.section<>-1 then
|
|
if sym.section<>-1 then
|
|
begin
|
|
begin
|
|
- objsec:=GetSection(sym.section);
|
|
|
|
|
|
+ objsec:=GetSection(word(sym.section));
|
|
if sym.value>=objsec.mempos then
|
|
if sym.value>=objsec.mempos then
|
|
address:=sym.value-objsec.mempos;
|
|
address:=sym.value-objsec.mempos;
|
|
objsym:=CreateSymbol(strname);
|
|
objsym:=CreateSymbol(strname);
|
|
@@ -1782,7 +1783,7 @@ const pemagic : array[0..3] of byte = (
|
|
COFF_SYM_SECTION :
|
|
COFF_SYM_SECTION :
|
|
begin
|
|
begin
|
|
{ GetSection checks that index is in range }
|
|
{ GetSection checks that index is in range }
|
|
- objsec:=GetSection(sym.section);
|
|
|
|
|
|
+ objsec:=GetSection(word(sym.section));
|
|
if assigned(objsec) then
|
|
if assigned(objsec) then
|
|
begin
|
|
begin
|
|
if sym.value>=objsec.mempos then
|
|
if sym.value>=objsec.mempos then
|