aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objdump/llvm-objdump.cpp
diff options
context:
space:
mode:
authorSimon Tatham <simon.tatham@arm.com>2022-07-25 14:55:31 +0100
committerSimon Tatham <simon.tatham@arm.com>2022-07-25 14:55:33 +0100
commite35fec2c0277c27f13d06e4a3a8a3e676286daab (patch)
tree8febd6c4be115b9559631ef4cb790b783674a0dd /llvm/tools/llvm-objdump/llvm-objdump.cpp
parent9c1d133c3a0256cce7f40e2e06966f84e8b99ffe (diff)
downloadllvm-e35fec2c0277c27f13d06e4a3a8a3e676286daab.zip
llvm-e35fec2c0277c27f13d06e4a3a8a3e676286daab.tar.gz
llvm-e35fec2c0277c27f13d06e4a3a8a3e676286daab.tar.bz2
[llvm-objdump,ARM] Fix .byte directives dumping the wrong byte.
The clause in `dumpARMELFData` that dumps a single byte as a `.byte` directive was printing the operand of that directive as `Bytes[0]`, not `Bytes[Index]`. In particular, this led to the `dumpBytes` output to its left not matching it! Reviewed By: DavidSpickett Differential Revision: https://reviews.llvm.org/D130360
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
-rw-r--r--llvm/tools/llvm-objdump/llvm-objdump.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index 9e4fa7c..c486088 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -914,7 +914,7 @@ static uint64_t dumpARMELFData(uint64_t SectionAddr, uint64_t Index,
return 2;
}
dumpBytes(Bytes.slice(Index, 1), OS);
- OS << "\t\t.byte\t" << format_hex(Bytes[0], 4);
+ OS << "\t\t.byte\t" << format_hex(Bytes[Index], 4);
return 1;
}