diff options
| author | Petr Hosek <phosek@chromium.org> | 2018-09-21 00:55:42 +0000 |
|---|---|---|
| committer | Petr Hosek <phosek@chromium.org> | 2018-09-21 00:55:42 +0000 |
| commit | e717ae211770cd243fef48e343ad3cb77ba11eec (patch) | |
| tree | 58d7b7ee2a52f7603c34e7dfd595671013b9125d /lld/ELF/InputSection.cpp | |
| parent | 45b3ddc5a4919b72e3a15e55eea86d470728a43b (diff) | |
| download | bcm5719-llvm-e717ae211770cd243fef48e343ad3cb77ba11eec.tar.gz bcm5719-llvm-e717ae211770cd243fef48e343ad3cb77ba11eec.zip | |
[ELF] Use the Repl point to avoid the segfault when using ICF
This addresses PR38918.
Differential Revision: https://reviews.llvm.org/D52202
llvm-svn: 342704
Diffstat (limited to 'lld/ELF/InputSection.cpp')
| -rw-r--r-- | lld/ELF/InputSection.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index dbc12fef6d4..88c71ccb8c0 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -402,7 +402,7 @@ void InputSection::copyRelocations(uint8_t *Buf, ArrayRef<RelTy> Rels) { } if (RelTy::IsRela) - P->r_addend = Sym.getVA(Addend) - Section->getOutputSection()->Addr; + P->r_addend = Sym.getVA(Addend) - Section->Repl->getOutputSection()->Addr; else if (Config->Relocatable) Sec->Relocations.push_back({R_ABS, Type, Rel.r_offset, Addend, &Sym}); } |

