Skip to content

Commit 07bb667

Browse files
committed
[llvm-readobj] Fix std::abs overflow after D156821
Tested by llvm/test/tools/llvm-readobj/ELF/relocations.test
1 parent 28134a2 commit 07bb667

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/tools/llvm-readobj/ELFDumper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3775,7 +3775,7 @@ void GNUELFDumper<ELFT>::printRelRelaReloc(const Relocation<ELFT> &R,
37753775
if (!Fields[4].Str.empty()) {
37763776
if (RelAddend < 0) {
37773777
Addend = " - ";
3778-
RelAddend = std::abs(RelAddend);
3778+
RelAddend = -static_cast<uint64_t>(RelAddend);
37793779
} else {
37803780
Addend = " + ";
37813781
}

0 commit comments

Comments
 (0)