mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-02 08:29:32 +01:00
* prevent crash when reading unknown section
git-svn-id: trunk@4006 -
This commit is contained in:
parent
a57ea4a656
commit
89e2f8b5df
@ -1685,14 +1685,17 @@ const pemagic : array[0..3] of byte = (
|
||||
if sym.section=0 then
|
||||
InputError('Failed reading coff file, illegal section');
|
||||
objsec:=GetSection(sym.section);
|
||||
if sym.value>=objsec.mempos then
|
||||
address:=sym.value-objsec.mempos;
|
||||
objsym:=CreateSymbol(strname);
|
||||
objsym.bind:=AB_LOCAL;
|
||||
objsym.typ:=AT_FUNCTION;
|
||||
objsym.objsection:=objsec;
|
||||
objsym.offset:=address;
|
||||
objsym.size:=size;
|
||||
if assigned(objsec) then
|
||||
begin
|
||||
if sym.value>=objsec.mempos then
|
||||
address:=sym.value-objsec.mempos;
|
||||
objsym:=CreateSymbol(strname);
|
||||
objsym.bind:=AB_LOCAL;
|
||||
objsym.typ:=AT_FUNCTION;
|
||||
objsym.objsection:=objsec;
|
||||
objsym.offset:=address;
|
||||
objsym.size:=size;
|
||||
end;
|
||||
end;
|
||||
COFF_SYM_FUNCTION,
|
||||
COFF_SYM_FILE :
|
||||
|
||||
Loading…
Reference in New Issue
Block a user