summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
diff options
context:
space:
mode:
authorGeorgii Rymar <grimar@accesssoftek.com>2019-12-02 14:08:20 +0300
committerGeorgii Rymar <grimar@accesssoftek.com>2019-12-03 17:55:55 +0300
commitd7ecc0256ebda38e4c746a1ed0faeb3005410d93 (patch)
tree365d2c42e9020b8d878944022ed13c99b83cc35d /llvm/test/Object
parent1cc0ba4cbdc54200e1b3c65e83e51a5368a819ea (diff)
downloadbcm5719-llvm-d7ecc0256ebda38e4c746a1ed0faeb3005410d93.tar.gz
bcm5719-llvm-d7ecc0256ebda38e4c746a1ed0faeb3005410d93.zip
[Object/ELF] - Refine the error reported when section's offset + size overruns the file buffer.
This is a follow-up requested in comments for D70826. It changes the message from "section X has a sh_offset (Y) + sh_size (Z) that cannot be represented" to "section X has a sh_offset (Y) + sh_size (Z) that is greater than the file size (0xABC)" when section's sh_offset + sh_size overruns a file buffer. Differential revision: https://reviews.llvm.org/D70893
Diffstat (limited to 'llvm/test/Object')
-rw-r--r--llvm/test/Object/invalid.test8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/test/Object/invalid.test b/llvm/test/Object/invalid.test
index 254b8f43e7b..37563652bd6 100644
--- a/llvm/test/Object/invalid.test
+++ b/llvm/test/Object/invalid.test
@@ -41,7 +41,7 @@ Sections:
# RUN: not llvm-objdump -s %p/Inputs/invalid-strtab-size.elf 2>&1 \
# RUN: | FileCheck %s -DFILE=%p/Inputs/invalid-strtab-size.elf --check-prefix=INVALID-STRTAB-SIZE
-# INVALID-STRTAB-SIZE: error: '[[FILE]]': section [index 1] has a sh_offset (0x70) + sh_size (0xffffff) that cannot be represented
+# INVALID-STRTAB-SIZE: error: '[[FILE]]': section [index 1] has a sh_offset (0x70) + sh_size (0xffffff) that is greater than the file size (0x218)
## Check that llvm-dwarfdump reports an error during relocation resolution
## when instead of expected SHT_RELA section it locates a section of a different type.
@@ -252,7 +252,7 @@ Symbols: []
# RUN: not llvm-readobj -r %t12 2>&1 | FileCheck -DFILE=%t12 --check-prefix=INVALID-RELOC-SH-OFFSET %s
# RUN: not llvm-readobj -r %t13 2>&1 | FileCheck -DFILE=%t13 --check-prefix=INVALID-RELOC-SH-OFFSET %s
-# INVALID-RELOC-SH-OFFSET: error: '[[FILE]]': section [index 1] has a sh_offset (0x10000) + sh_size (0x0) that cannot be represented
+# INVALID-RELOC-SH-OFFSET: error: '[[FILE]]': section [index 1] has a sh_offset (0x10000) + sh_size (0x0) that is greater than the file size (0x160)
--- !ELF
FileHeader:
@@ -286,7 +286,7 @@ Sections:
--- !ELF
FileHeader:
- Class: ELFCLASS64
+ Class: ELFCLASS32
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_386
@@ -375,7 +375,7 @@ Sections:
# RUN: not llvm-readobj --sections --section-data %t18 2>&1 \
# RUN: | FileCheck -DFILE=%t18 --check-prefix=BROKEN-SECSHOFFSET %s
-# BROKEN-SECSHOFFSET: error: '[[FILE]]': section [index 1] has a sh_offset (0xffff0000) + sh_size (0x0) that cannot be represented
+# BROKEN-SECSHOFFSET: error: '[[FILE]]': section [index 1] has a sh_offset (0xffff0000) + sh_size (0x0) that is greater than the file size (0x160)
--- !ELF
FileHeader:
OpenPOWER on IntegriCloud