Template and register linker scripts with Rust's conditional compilation flags in hand.
SECTIONS {
.text : {
{% if contains(cfg.feature, "some_feature") %}
__feature = .;
{% endif %}
}
}
minilink::include_template("./ld/link.in.ld", "link.ld");