<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/80237>80237</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Allow renaming stack smashing protector symbols
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
matheusmoreira
</td>
</tr>
</table>
<pre>
I am developing `-ffreestanding -nostdlib` Linux applications. In order to integrate with the compiler's stack smashing protection machinery, I need to provide the following symbols:
__stack_chk_guard
__stack_chk_fail
These symbols are completely foreign to my code. It would be nice if there was a compiler option to rename these symbols to something else. I want to make them consistent with the rest of my code, thereby improving its quality.
A couple of options would be enough:
-fstack-protector-canary=my_variable
-fstack-protector-handler=my_function
Attributes would be even better:
```
uintptr_t my_canary __attribute__((stack_protector_canary));
__attribute__((noreturn, stack_protector_handler))
void my_handler(void);
```
References:
- [GCC Bug 113694 - Allow renaming stack smashing protector symbols][gcc.bug.113694]
[gcc.bug.113694]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113694
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUlMFu-ygQxp-GXEaJHJzaycGHtlFWlfa02ruFYWyzxeCFIVnv068gaZv038tKlqPAzMdvPs8gQtCDRWzY0wt7Oq5EpNH5ZhI0YgyT86i9WHVOLc0biAkUntG4WdsBWFWs-94jBhJWpZW1dYGU0R2rCvhd2_gPiHk2WgrSzoYNvFlwXqEHcqAt4eAFIVw0jUAjgnTTrA16xusAgYR8hzCJMCbt2TtCmXRgEnLUFv3C-Cu8gUVUSXD27qwVZqXeGeMuKS8sU-dMYOUzK46suL2hbbN-K8f3dojCq9s6wMNWL7S5z_tzxIAfmiD8ldkgoVmgT24NNrFMC0incANvBBcXjYIOwWqJoPsE6BEuIoD4LBncnGsjBx6tmHIZd0eRg-AmpOwFmpCk4SIs5dPEe46fQDobdCC09OWqx0Dg-g-m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