Change removes code duplication happened because
of 2 similar methods for searching output section by name what
hopefully makes code a bit cleaner.
Details
Diff Detail
Event Timeline
ELF/LinkerScript.cpp | ||
---|---|---|
107 | What does Location.empty() mean? |
ELF/LinkerScript.cpp | ||
---|---|---|
107 | It is the same as check in LinkerScript::createOutputSection. When we parse scripts, sometimes we have forward references to sections, SECTIONS { foo = ADDR(.text) - ABSOLUTE(ADDR(.text)); }; In that case script parser calls getOrCreateOutputSection to declare output section early, This function returns sections only if it was already defined (processed by factory). |
ELF/LinkerScript.cpp | ||
---|---|---|
107 | That's too subtle. I couldn't understand it without your explanation, and you won't be able to understand that too if you come back to this code a few years later. Also, why don't you want to return a forward reference? |
What does Location.empty() mean?