SuccessChanges

Summary

  1. [lldb] [Python] Do not attempt to flush() a read-only fd (details)
  2. [ELF] -r: fix crash when processing a SHT_REL[A] that relocates a (details)
Commit 267cc3292ec4f6a7ea062b3551d20ea4692b6b78 by labath
[lldb] [Python] Do not attempt to flush() a read-only fd
Summary: When creating a FileSP object, do not flush() the underlying
file unless it is open for writing.  Attempting to flush() a read-only
fd results in EBADF on NetBSD.
Reviewers: lawrence_danna, labath, krytarowski
Reviewed By: lawrence_danna, labath
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D69320
The file was modifiedlldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
Commit 56d81104f145ad2ff65ec88b249262888f80e9bc by maskray
[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
The file was modifiedlld/ELF/InputFiles.cpp
The file was addedlld/test/ELF/merge-relocatable.s