diff options
author | Weining Lu <luweining@loongson.cn> | 2023-03-13 15:44:56 +0800 |
---|---|---|
committer | Weining Lu <luweining@loongson.cn> | 2023-03-13 16:23:10 +0800 |
commit | 174a38f9c3167573e060493b94135cf453d27879 (patch) | |
tree | 90e0f426af133873bc290985728d002ba881bd97 /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | |
parent | c2c93873d1912a62685818ec9f4e020ee7a1c616 (diff) | |
download | llvm-174a38f9c3167573e060493b94135cf453d27879.zip llvm-174a38f9c3167573e060493b94135cf453d27879.tar.gz llvm-174a38f9c3167573e060493b94135cf453d27879.tar.bz2 |
[LLDB][ObjectFileELF] Correct the return type of RelocOffset64 and RelocAddend64
According to `/usr/include/elf.h` and `lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h`.
For ELF64 relocation, types of `offset` and `addend` should be `elf_addr` and `elf_sxword`.
Reviewed By: DavidSpickett
Differential Revision: https://reviews.llvm.org/D145550
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index d91b350..6281cfa 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -116,11 +116,11 @@ public: static unsigned RelocOffset32(const ELFRelocation &rel); - static unsigned RelocOffset64(const ELFRelocation &rel); + static elf_addr RelocOffset64(const ELFRelocation &rel); static unsigned RelocAddend32(const ELFRelocation &rel); - static unsigned RelocAddend64(const ELFRelocation &rel); + static elf_sxword RelocAddend64(const ELFRelocation &rel); bool IsRela() { return (reloc.is<ELFRela *>()); } @@ -192,7 +192,7 @@ unsigned ELFRelocation::RelocOffset32(const ELFRelocation &rel) { return rel.reloc.get<ELFRela *>()->r_offset; } -unsigned ELFRelocation::RelocOffset64(const ELFRelocation &rel) { +elf_addr ELFRelocation::RelocOffset64(const ELFRelocation &rel) { if (rel.reloc.is<ELFRel *>()) return rel.reloc.get<ELFRel *>()->r_offset; else @@ -206,7 +206,7 @@ unsigned ELFRelocation::RelocAddend32(const ELFRelocation &rel) { return rel.reloc.get<ELFRela *>()->r_addend; } -unsigned ELFRelocation::RelocAddend64(const ELFRelocation &rel) { +elf_sxword ELFRelocation::RelocAddend64(const ELFRelocation &rel) { if (rel.reloc.is<ELFRel *>()) return 0; else |