+ started parsing of custom sections - known custom sections are dispatched to

a specialized parsing function for each of them, while unknown custom sections
  (currently the ones, not produced by FPC) produce an error
This commit is contained in:
Nikolay Nikolov 2023-12-26 14:32:34 +02:00
parent 2ae98a7363
commit 5a5abe2419

View File

@ -2225,8 +2225,47 @@ implementation
DataCount: uint32;
function ReadCustomSection: Boolean;
function ReadRelocationSection: Boolean;
begin
Result:=False;
end;
function ReadLinkingSection: Boolean;
begin
Result:=False;
end;
function ReadProducersSection: Boolean;
begin
Result:=False;
end;
function ReadTargetFeaturesSection: Boolean;
begin
Result:=False;
end;
const
RelocationSectionPrefix = 'reloc.';
var
SectionName: ansistring;
begin
Result:=False;
ReadName(SectionName);
if Copy(SectionName,1,Length(RelocationSectionPrefix)) = RelocationSectionPrefix then
Result:=ReadRelocationSection
else
case SectionName of
'linking':
Result:=ReadLinkingSection;
'producers':
Result:=ReadProducersSection;
'target_features':
Result:=ReadTargetFeaturesSection;
else
InputError('Unsupported custom section: ''' + SectionName + '''');
end;
end;
function ReadTypeSection: Boolean;