summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2016-08-04 02:03:29 +0000
committerRui Ueyama <ruiu@google.com>2016-08-04 02:03:29 +0000
commitc163318b212d839bfb40aaa6e11c1e07141350fc (patch)
treef6adc4b53ff2515ac8de60cfb7b1864d365ed487
parent104165643ee017aa38b620d96ee2bb808293ab45 (diff)
downloadbcm5719-llvm-c163318b212d839bfb40aaa6e11c1e07141350fc.tar.gz
bcm5719-llvm-c163318b212d839bfb40aaa6e11c1e07141350fc.zip
Remove buggy PROVIDE-in-output-description command.
With the previous change, it is now obvious that readProvide in this context appended new commands to a wrong command list. It was mistakenly adding new commands to the top level. Thus, all commands inside output section descriptions were interpreted as they were written on top level. PROVIDE command naturally requires symbol assignment support in the output section description. We don't have that one yet. I removed the implementation because there's no way to fix it now. We can resurrect the test once we support the symbol assignment (with a modification to detect errors that we failed to find as described.) llvm-svn: 277687
-rw-r--r--lld/ELF/LinkerScript.cpp12
-rw-r--r--lld/test/ELF/linkerscript/linkerscript-provide-in-section.s20
2 files changed, 3 insertions, 29 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 194f4b76166..e58b3be0277 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -822,17 +822,11 @@ ScriptParser::readOutputSectionDescription(StringRef OutSec) {
Cmd->Commands.emplace_back(readInputSectionDescription());
continue;
}
-
- StringRef Tok = next();
- if (Tok == "PROVIDE") {
- Opt.Commands.emplace_back(readProvide(false));
- } else if (Tok == "PROVIDE_HIDDEN") {
- Opt.Commands.emplace_back(readProvide(true));
- } else if (Tok == "SORT") {
+ if (skip("SORT")) {
readSort();
- } else {
- setError("unknown command " + Tok);
+ continue;
}
+ setError("unknown command " + peek());
}
Cmd->Phdrs = readOutputSectionPhdrs();
Cmd->Filler = readOutputSectionFiller();
diff --git a/lld/test/ELF/linkerscript/linkerscript-provide-in-section.s b/lld/test/ELF/linkerscript/linkerscript-provide-in-section.s
deleted file mode 100644
index dc4269541ab..00000000000
--- a/lld/test/ELF/linkerscript/linkerscript-provide-in-section.s
+++ /dev/null
@@ -1,20 +0,0 @@
-# REQUIRES: x86
-# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
-# RUN: echo \
-# RUN: "SECTIONS { . = 1000; .blah : { PROVIDE(foo = .); } }" \
-# RUN: > %t.script
-# RUN: ld.lld -o %t1 --script %t.script %t -shared
-# RUN: llvm-objdump -t %t1 | FileCheck %s
-# CHECK: 00000000000003e8 *ABS* 00000000 foo
-
-# RUN: echo \
-# RUN: "SECTIONS { . = 1000; .blah : { PROVIDE_HIDDEN(foo = .); } }" \
-# RUN: > %t2.script
-# RUN: ld.lld -o %t2 --script %t2.script %t -shared
-# RUN: llvm-objdump -t %t2 | FileCheck %s --check-prefix=HIDDEN
-# HIDDEN: 00000000000003e8 *ABS* 00000000 .hidden foo
-
-.section .blah
-.globl patatino
-patatino:
- movl $foo, %edx
OpenPOWER on IntegriCloud