Procházet zdrojové kódy

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

Nikolay Nikolov před 2 roky
rodič
revize
82c52ed127
1 změnil soubory, kde provedl 7 přidání a 0 odebrání
  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');
                   InputError('Error reading the index of the target section of a relocation section');
                   exit;
                   exit;
                 end;
                 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
               if not ReadUleb32(RelocCount) then
                 begin
                 begin
                   InputError('Error reading the relocation entries count from a relocation section');
                   InputError('Error reading the relocation entries count from a relocation section');