forked from OSchip/llvm-project
[ELF] --gc-sections: Work around SHT_PROGBITS .init_array.N for Rust
See https://github.com/rust-lang/rust/issues/92181
This commit is contained in:
parent
319181f767
commit
de92a13fec
|
@ -177,11 +177,12 @@ static bool isReserved(InputSectionBase *sec) {
|
|||
// SHT_NOTE sections in a group are subject to garbage collection.
|
||||
return !sec->nextInSectionGroup;
|
||||
default:
|
||||
// Support SHT_PROGBITS .init_array for a while
|
||||
// (https://golang.org/issue/50295).
|
||||
// Support SHT_PROGBITS .init_array (https://golang.org/issue/50295) and
|
||||
// .init_array.N (https://github.com/rust-lang/rust/issues/92181) for a
|
||||
// while.
|
||||
StringRef s = sec->name;
|
||||
return s == ".init" || s == ".fini" || s == ".init_array" || s == ".jcr" ||
|
||||
s.startswith(".ctors") || s.startswith(".dtors");
|
||||
return s == ".init" || s == ".fini" || s.startswith(".init_array") ||
|
||||
s == ".jcr" || s.startswith(".ctors") || s.startswith(".dtors");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -157,6 +157,10 @@ h:
|
|||
.section .init_array,"aw",@progbits
|
||||
.quad 0
|
||||
|
||||
# Work around https://github.com/rust-lang/rust/issues/92181
|
||||
.section .init_array.00001,"aw",@progbits
|
||||
.quad 0
|
||||
|
||||
.section .preinit_array,"aw",@preinit_array
|
||||
.quad 0
|
||||
|
||||
|
|
Loading…
Reference in New Issue