I suggest following change.
It allows to simplify code.
Details
Diff Detail
Event Timeline
I think I like the direction of this patch.
ELF/LinkerScript.cpp | ||
---|---|---|
286 | Question: is it possible that a section is assigned to some output section but is not live? It sounds like a bad state to me. |
ELF/LinkerScript.cpp | ||
---|---|---|
286 | Yes, it is possible for following case: (I would probably try to completely get rid of 'Assigned' flag, I think we should be able to do that). |
ELF/LinkerScript.cpp | ||
---|---|---|
286 | No, I don't think that is OK. /DISCARD/ is a keyword and not a real section. Sections discarded by /DISCARD/ should be not Assigned and not Live. |
ELF/LinkerScript.cpp | ||
---|---|---|
286 | I think that is fine because specification explicitly mentions that input sections are assigned:
(https://sourceware.org/binutils/docs-2.16/ld/Output-Section-Discarding.html) Anyways I believe nice way to solve this would be to remove Assigned flag, |
ELF/LinkerScript.cpp | ||
---|---|---|
286 | I don't think that is fine, please read my commit message for r316622. Can you rebase this patch? |
- Rebased.
ELF/LinkerScript.cpp | ||
---|---|---|
286 | Rebased, but we still need to check both conditions here:
|
Question: is it possible that a section is assigned to some output section but is not live? It sounds like a bad state to me.