summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Smith <aaron.smith@microsoft.com>2019-11-18 13:07:35 +0000
committerAaron Smith <aaron.smith@microsoft.com>2019-11-18 13:07:35 +0000
commitdbb64b39b8bc137bb88b9f847ab8adf25a8c8583 (patch)
treef3e197ed5be621da852e436855ad5865012394b8
parent1ce5fcda17e6683bcbec8585349afcad02a9c98a (diff)
downloadbcm5719-llvm-dbb64b39b8bc137bb88b9f847ab8adf25a8c8583.tar.gz
bcm5719-llvm-dbb64b39b8bc137bb88b9f847ab8adf25a8c8583.zip
Fix a print error found while testing llvm-objcopy
A value was not printed as hex. This updates the output and test cases.
-rw-r--r--llvm/include/llvm/Object/ELF.h2
-rw-r--r--llvm/test/Object/invalid.test4
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/include/llvm/Object/ELF.h b/llvm/include/llvm/Object/ELF.h
index 0d5482ae831..dc848cee7e5 100644
--- a/llvm/include/llvm/Object/ELF.h
+++ b/llvm/include/llvm/Object/ELF.h
@@ -406,7 +406,7 @@ ELFFile<ELFT>::getSectionContentsAsArray(const Elf_Shdr *Sec) const {
Offset + Size > Buf.size())
return createError("section " + getSecIndexForError(this, Sec) +
" has a sh_offset (0x" + Twine::utohexstr(Offset) +
- ") + sh_size (0x" + Twine(Size) +
+ ") + sh_size (0x" + Twine::utohexstr(Size) +
") that cannot be represented");
if (Offset % alignof(T))
diff --git a/llvm/test/Object/invalid.test b/llvm/test/Object/invalid.test
index ab498f237c9..254b8f43e7b 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 (0x16777215) that cannot be represented
+# INVALID-STRTAB-SIZE: error: '[[FILE]]': section [index 1] has a sh_offset (0x70) + sh_size (0xffffff) that cannot be represented
## 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.
@@ -282,7 +282,7 @@ Sections:
# RUN: yaml2obj %s --docnum=14 -o %t14
# RUN: not llvm-readobj --symbols %t14 2>&1 | FileCheck -DFILE=%t14 --check-prefix=INVALID-SECTION-SIZE2 %s
-# INVALID-SECTION-SIZE2: error: '[[FILE]]': section [index 1] has a sh_offset (0xffffffff) + sh_size (0x27) that cannot be represented
+# INVALID-SECTION-SIZE2: error: '[[FILE]]': section [index 1] has a sh_offset (0xffffffff) + sh_size (0x1b) that cannot be represented
--- !ELF
FileHeader:
OpenPOWER on IntegriCloud