diff options
author | Stephane Sezer <sas@cd80.net> | 2018-08-06 22:04:08 +0000 |
---|---|---|
committer | Stephane Sezer <sas@cd80.net> | 2018-08-06 22:04:08 +0000 |
commit | b015ca6f520538d611b31f50baf6243283e804d3 (patch) | |
tree | 2693d8a87879e411ac94fff0896492c7cfc82aab /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | |
parent | d9f66ba3400c79784cf7d49a6f9f26cd454301fd (diff) | |
download | bcm5719-llvm-b015ca6f520538d611b31f50baf6243283e804d3.tar.gz bcm5719-llvm-b015ca6f520538d611b31f50baf6243283e804d3.zip |
Add a relocation for R_AARCH64_ABS32 in ObjectFileELF
Summary:
.rela.debug_info relocations are being done via
ObjectFileELF::ApplyRelocations for aarch64. Currently, the switch case
that iterates over the relocation type is only implemented for a few
different types and `assert(false)`es over the rest.
Implement the relocation for R_AARCH64_ABS32 in ApplyRelocations
Reviewers: sas, xiaobai, peter.smith, clayborg, javed.absar, espindola
Differential Revision: https://reviews.llvm.org/D49407
Change by Nathan Lanza <lanza@fb.com>
llvm-svn: 339068
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index 8701908378f..1ec003a4cfd 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -2697,15 +2697,20 @@ unsigned ObjectFileELF::ApplyRelocations( break; } case R_X86_64_32: - case R_X86_64_32S: { + case R_X86_64_32S: + case R_AARCH64_ABS32: { symbol = symtab->FindSymbolByID(reloc_symbol(rel)); if (symbol) { addr_t value = symbol->GetAddressRef().GetFileAddress(); value += ELFRelocation::RelocAddend32(rel); - assert( - (reloc_type(rel) == R_X86_64_32 && (value <= UINT32_MAX)) || - (reloc_type(rel) == R_X86_64_32S && - ((int64_t)value <= INT32_MAX && (int64_t)value >= INT32_MIN))); + if (!((IsRelocABS32(rel) && value <= UINT32_MAX) || + (reloc_type(rel) == R_X86_64_32S && + ((int64_t)value <= INT32_MAX && + (int64_t)value >= INT32_MIN)))) { + Log *log = + lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_MODULES); + log->Printf("Failed to apply debug info relocations"); + } uint32_t truncated_addr = (value & 0xFFFFFFFF); DataBufferSP &data_buffer_sp = debug_data.GetSharedDataBuffer(); uint32_t *dst = reinterpret_cast<uint32_t *>( |