Browse Source

* disallow (for now) relocations for sections other than the code and data sections

Nikolay Nikolov 1 year ago
parent
commit
82c52ed127
1 changed files with 7 additions and 0 deletions
  1. 7 0
      compiler/ogwasm.pas

+ 7 - 0
compiler/ogwasm.pas

@@ -2372,6 +2372,13 @@ implementation
                   InputError('Error reading the index of the target section of a relocation section');
                   exit;
                 end;
+              if TargetSection=CodeSectionIndex then
+              else if TargetSection=DataSectionIndex then
+              else
+                begin
+                  InputError('Relocation for custom sections not supported, yet');
+                  exit;
+                end;
               if not ReadUleb32(RelocCount) then
                 begin
                   InputError('Error reading the relocation entries count from a relocation section');