summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2017-05-08 10:18:12 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2017-05-08 10:18:12 +0000
commitd86a4e505bb9a76feab10f587d311dd27227cd4b (patch)
tree1df2a0ab1f882325a368b3ae8b84ee935566b5e3 /lld/ELF/LinkerScript.cpp
parent810c6257f112e582624a70e9523d94275f66d004 (diff)
downloadbcm5719-llvm-d86a4e505bb9a76feab10f587d311dd27227cd4b.tar.gz
bcm5719-llvm-d86a4e505bb9a76feab10f587d311dd27227cd4b.zip
[ELF] - Linkerscript: support combination of linkerscript and --compress-debug-sections.
Previously it was impossible to use linkerscript with --compress-debug-sections because of assert failture: Assertion failed: isFinalized(), file C:\llvm\lib\MC\StringTableBuilder.cpp, line 64 Patch fixes the issue llvm-svn: 302413
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r--lld/ELF/LinkerScript.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index d9adc6025cf..d7858e173c7 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -406,15 +406,8 @@ void LinkerScript::processCommands(OutputSectionFactory &Factory) {
}
// Add input sections to an output section.
- unsigned Pos = 0;
- for (InputSectionBase *S : V) {
- // The actual offset will be computed during
- // assignAddresses. For now, use the index as a very crude
- // approximation so that it is at least easy for other code to
- // know the section order.
- cast<InputSection>(S)->OutSecOff = Pos++;
+ for (InputSectionBase *S : V)
Factory.addInputSec(S, Cmd->Name, Cmd->Sec);
- }
if (OutputSection *Sec = Cmd->Sec) {
assert(Sec->SectionIndex == INT_MAX);
Sec->SectionIndex = I;
@@ -648,6 +641,11 @@ void LinkerScript::assignOffsets(OutputSectionCommand *Cmd) {
Dot = CurMemRegion->Offset;
switchTo(Sec);
+ // We do not support custom layout for compressed debug sectons.
+ // At this point we already know their size and have compressed content.
+ if (CurOutSec->Flags & SHF_COMPRESSED)
+ return;
+
for (BaseCommand *C : Cmd->Commands)
process(*C);
}
OpenPOWER on IntegriCloud