分段堆栈是否可以与其他库自由使用

Can segmented stacks be used freely with other libraries

按照我的理解,分段堆栈是在编译器支持下构建的,因此每当分段堆栈上的函数 运行 调用另一个函数时,如果首先检查堆栈是否有足够的 space该新函数的堆栈帧。如果没有,则附加另一个分段堆栈并将代码分支到该函数。

但是如果说我有一个纤程 运行 并且我从另一个未使用 [=10= 编译的共享(或编译到非共享对象文件)库中调用另一个函数,这是否有效] 选项?该库中的函数如何知道它们必须检查分段堆栈中是否有足够的 space 来继续?

只对 clang 和 gcc 实现感兴趣(尤其是对 boost 上下文),谢谢!

我要找回我记得在之前关于这个主题的问题中看到的文档:

Backward compatibility

We want to be able to use split stack programs on systems with prebuilt libraries compiled without split stacks. This means that we need to ensure that there is sufficient stack space before calling any such function.

Each object file compiled in split stack mode will be annotated to indicate that the functions use split stacks. This should probably be annotated with a note but there is no general support for creating arbitrary notes in GNU as. Therefore, each object file compiled in split stack mode will have an empty section with a special name: .note.GNU-split-stack. If an object file compiled in split stack mode includes some functions with the no_split_stack attribute, then the object file will also have a .note.GNU-no-split-stack section. This will tell the linker that some functions may not have the expected split stack prologue.

[...]

For calls from split-stack code to non-split-stack code, the linker will change the initial instructions in the split-stack (caller) function. This means that the linker will have to have special knowledge of the instructions that the compiler emits. The effect of the changes will be to increase the required framesize by a number large enough to reasonably work for a non-split-stack. This will be a target dependent number; the default will be something like 64K. Note that this large stack will be released when the split-stack function returns. Note that I'm disregarding the case of split-stack code in a shared library calling non-split-stack code in the main executable; that seems like an unlikely problem.

我特别记得列表(斜体)警告 - 我不记得是我还是其他人强调了它。该讨论中的关键字是关于“回调”的。