diff options
author | Fangrui Song <maskray@google.com> | 2019-10-24 10:52:19 -0700 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-10-24 11:35:29 -0700 |
commit | 56d81104f145ad2ff65ec88b249262888f80e9bc (patch) | |
tree | e1084a16e1e39353cb2184084e0a3a84f03a0ac4 /clang/unittests/Basic/SourceManagerTest.cpp | |
parent | 267cc3292ec4f6a7ea062b3551d20ea4692b6b78 (diff) | |
download | llvm-56d81104f145ad2ff65ec88b249262888f80e9bc.zip llvm-56d81104f145ad2ff65ec88b249262888f80e9bc.tar.gz llvm-56d81104f145ad2ff65ec88b249262888f80e9bc.tar.bz2 |
[ELF] -r: fix crash when processing a SHT_REL[A] that relocates a SHF_MERGE after D67504/r372734
Fix PR43767
In -r mode, when processing a SHT_REL[A] that relocates a SHF_MERGE, sec->getRelocatedSection() is a
MergeInputSection and its parent is an OutputSection but is asserted to
be a SyntheticSection (MergeSyntheticSection) in LinkerScript.cpp:addInputSec().
##
The code path is not exercised in non -r mode because the relocated
section changed from MergeInputSection to InputSection.
Reorder the code to make the non -r logic apply to -r as well, thus fix
the crash.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D69364
Diffstat (limited to 'clang/unittests/Basic/SourceManagerTest.cpp')
0 files changed, 0 insertions, 0 deletions