summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/commands/command/script/TestCommandScript.py
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-09-02 10:33:58 +0000
committerFangrui Song <maskray@google.com>2019-09-02 10:33:58 +0000
commitd8bc6a48eaa9111b1fc232aa678695a57ae25ec6 (patch)
treefd8b66ad4be55416be86dbf4101b4f33817f8b48 /lldb/packages/Python/lldbsuite/test/commands/command/script/TestCommandScript.py
parent252a584cbd018e21b0ab4d9ee89eab31f4c84ee2 (diff)
downloadbcm5719-llvm-d8bc6a48eaa9111b1fc232aa678695a57ae25ec6.tar.gz
bcm5719-llvm-d8bc6a48eaa9111b1fc232aa678695a57ae25ec6.zip
[ELF] Do not ICF two sections with different output sections (by SECTIONS commands)
Fixes PR39418. Complements D47241 (the non-linker-script case). processSectionCommands() assigns input sections to output sections. ICF is called before it, so .text.foo and .text.bar may be folded even if their output sections are made different by SECTIONS commands. ``` markLive<ELFT>() doIcf<ELFT>() // During ICF, we don't know the output sections writeResult() combineEhSections<ELFT>() script->processSectionCommands() // InputSection -> OutputSection assignment ``` This patch splits processSectionCommands() into processSectionCommands() and processSymbolAssignments(), and moves processSectionCommands() before ICF: ``` markLive<ELFT>() combineEhSections<ELFT>() script->processSectionCommands() doIcf<ELFT>() // should remove folded input sections writeResult() script->processSymbolAssignments() ``` An alternative approach is to unfold a section `sec` in processSectionCommands() when we find `sec` and `sec->repl` belong to different output sections. I feel this patch is superior because this can fold more sections and the decouple of SectionCommand/SymbolAssignment gives flexibility: * An ExprValue can't be evaluated before its section is assigned to an output section -> we can delete getOutputSectionVA and simplify another place where we had to check if the output section is null. Moreover, a case in linkerscript/early-assign-symbol.s can be handled now. * processSectionCommands/processSymbolAssignments can be freely moved around. Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D66717 llvm-svn: 370635
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/commands/command/script/TestCommandScript.py')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud