[ELF] Linkerscript: fixed bug about commands processing.
It was possible situation about some commands just were not processed (were skipped) because of a bug appeared when constraint checking used. Testcase is attached. llvm-svn: 281818
This commit is contained in:
parent
8034d49db5
commit
dfbbbc86a1
|
@ -297,6 +297,7 @@ void LinkerScript<ELFT>::processCommands(OutputSectionFactory<ELFT> &Factory) {
|
|||
for (InputSectionBase<ELFT> *S : V)
|
||||
S->OutSec = nullptr;
|
||||
Opt.Commands.erase(Iter);
|
||||
--I;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
# REQUIRES: x86
|
||||
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
|
||||
# RUN: echo "SECTIONS { \
|
||||
# RUN: .foo : ONLY_IF_RO { *(.foo) } \
|
||||
# RUN: .bar : {bar1 = .; *(.bar) } }" > %t1.script
|
||||
# RUN: ld.lld -o %t1 --script %t1.script %t
|
||||
# RUN: llvm-readobj -t %t1 | FileCheck %s
|
||||
|
||||
# CHECK: Name: bar1
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
nop
|
||||
|
||||
.section .bar, "aw"
|
||||
bar:
|
||||
.long 1
|
||||
|
||||
.section .foo, "aw"
|
||||
.long 0
|
Loading…
Reference in New Issue