[libcxx-commits] [libcxx] [libcxx] Option to disable overridden function detection (PR #108734)

Petr Hosek via libcxx-commits libcxx-commits at lists.llvm.org
Sun Sep 15 15:46:26 PDT 2024


petrhosek wrote:

> Why does this require a feature to disable? Can't you just update the linker script? That shouldn't be that hard.

Ideally yes, we would update the linker script, but that can be challenging since we always don't have access to linker scripts used by our partners and even when we do, it can require significant effort to find and update every single linker script. I'm worried that this is really going to hamper libc++ adoption in the embedded space. 

> Or we could even look into putting it into a subsection like `.text.__libcxx_whatever_it_was`. Wouldn't that also solve the problem?

That doesn't work. We rely on the generated `__start_<name>` and `__stop_<name>` symbols but those are only generated for sections that use C identifier names (so not `.text`). Plus if we used `.text.<whatever>`, it'd be merged merged into `.text` output section and `__is_function_overridden` would always return `true` making this feature useless.

https://github.com/llvm/llvm-project/pull/108734


More information about the libcxx-commits mailing list