summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-readobj
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/tools/llvm-readobj
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/tools/llvm-readobj')
-rw-r--r--llvm/test/tools/llvm-readobj/elf-verdef-invalid.test2
-rw-r--r--llvm/test/tools/llvm-readobj/elf-verneed-invalid.test2
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/test/tools/llvm-readobj/elf-verdef-invalid.test b/llvm/test/tools/llvm-readobj/elf-verdef-invalid.test
index 253a2179008..2eb262f555c 100644
--- a/llvm/test/tools/llvm-readobj/elf-verdef-invalid.test
+++ b/llvm/test/tools/llvm-readobj/elf-verdef-invalid.test
@@ -52,7 +52,7 @@ Sections:
# RUN: llvm-readobj -V %t3 2>&1 | FileCheck %s --check-prefix=INVALID-DATA -DFILE=%t3
# RUN: llvm-readelf -V %t3 2>&1 | FileCheck %s --check-prefix=INVALID-DATA -DFILE=%t3
-# INVALID-DATA: warning: '[[FILE]]': cannot read content of SHT_GNU_verdef section with index 1: section [index 1] has a sh_offset (0xffffffff) + sh_size (0x0) that cannot be represented
+# INVALID-DATA: warning: '[[FILE]]': cannot read content of SHT_GNU_verdef section with index 1: section [index 1] has a sh_offset (0xffffffff) + sh_size (0x0) that is greater than the file size (0x230)
--- !ELF
FileHeader:
diff --git a/llvm/test/tools/llvm-readobj/elf-verneed-invalid.test b/llvm/test/tools/llvm-readobj/elf-verneed-invalid.test
index 81976539bbc..6a04519a05d 100644
--- a/llvm/test/tools/llvm-readobj/elf-verneed-invalid.test
+++ b/llvm/test/tools/llvm-readobj/elf-verneed-invalid.test
@@ -372,7 +372,7 @@ DynamicSymbols:
# RUN: llvm-readobj --sections -V %t7 2>&1 | FileCheck %s -DFILE=%t7 --check-prefix=INVALID-DATA
# RUN: llvm-readelf --sections -V %t7 2>&1 | FileCheck %s -DFILE=%t7 --check-prefix=INVALID-DATA
-# INVALID-DATA: warning: '[[FILE]]': cannot read content of SHT_GNU_verneed section with index 1: section [index 1] has a sh_offset (0xffffffff) + sh_size (0x0) that cannot be represented
+# INVALID-DATA: warning: '[[FILE]]': cannot read content of SHT_GNU_verneed section with index 1: section [index 1] has a sh_offset (0xffffffff) + sh_size (0x0) that is greater than the file size (0x230)
--- !ELF
FileHeader:
OpenPOWER on IntegriCloud