diff options
author | Nicholas Wilson <nicholas@nicholaswilson.me.uk> | 2018-03-05 13:32:38 +0000 |
---|---|---|
committer | Nicholas Wilson <nicholas@nicholaswilson.me.uk> | 2018-03-05 13:32:38 +0000 |
commit | b3748f71df37d2ec7031a99fbe4f0323a264a013 (patch) | |
tree | 824a03a5aeb5011158b1b0d2e9438fc01e9f916f /llvm/test | |
parent | f20222a83c8f76c52c89201627857c055e879f02 (diff) | |
download | bcm5719-llvm-b3748f71df37d2ec7031a99fbe4f0323a264a013.tar.gz bcm5719-llvm-b3748f71df37d2ec7031a99fbe4f0323a264a013.zip |
[WebAssembly] Add validation to reloc section
We now check relocations offsets are within range, and the relocation
index is valid.
Also updated tests which contained invalid Wasm files that were
previously not checked.
Differential Revision: https://reviews.llvm.org/D43684
llvm-svn: 326697
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/ObjectYAML/wasm/code_section.yaml | 13 | ||||
-rw-r--r-- | llvm/test/ObjectYAML/wasm/data_section.yaml | 12 |
2 files changed, 24 insertions, 1 deletions
diff --git a/llvm/test/ObjectYAML/wasm/code_section.yaml b/llvm/test/ObjectYAML/wasm/code_section.yaml index 4f7da6725ec..62f60d65424 100644 --- a/llvm/test/ObjectYAML/wasm/code_section.yaml +++ b/llvm/test/ObjectYAML/wasm/code_section.yaml @@ -37,6 +37,19 @@ Sections: - Type: I32 Count: 1 Body: 108180808000210020000F0B + - Type: CUSTOM + Name: linking + SymbolTable: + - Index: 0 + Kind: FUNCTION + Name: func1 + Flags: [ ] + Function: 0 + - Index: 1 + Kind: FUNCTION + Name: func2 + Flags: [ ] + Function: 1 ... # CHECK: --- !WASM # CHECK: FileHeader: diff --git a/llvm/test/ObjectYAML/wasm/data_section.yaml b/llvm/test/ObjectYAML/wasm/data_section.yaml index d2595ddedb2..5c9b688f9c1 100644 --- a/llvm/test/ObjectYAML/wasm/data_section.yaml +++ b/llvm/test/ObjectYAML/wasm/data_section.yaml @@ -22,6 +22,16 @@ Sections: Index: 0 Offset: 0x00000006 Addend: -6 + - Type: CUSTOM + Name: linking + SymbolTable: + - Index: 0 + Kind: DATA + Name: dataSymbol + Flags: [ ] + Segment: 0 + Offset: 0 + Size: 4 ... # CHECK: --- !WASM # CHECK: FileHeader: @@ -44,4 +54,4 @@ Sections: # CHECK-NEXT: Opcode: I32_CONST # CHECK-NEXT: Value: 4 # CHECK-NEXT: Content: '10001000' -# CHECK-NEXT: ... +# CHECK-NEXT: - Type: CUSTOM |