----- Manuel López-Ibáñez <manuel.lopez-ibanez@xxxxxxxxxxxxxxxx> schrieb: > On 11/02/16 14:29, Sebastian Huber wrote: > > Hello, > > > > how can I implement a link-time optimization safe explicit_bzero() that works with a fully LTO enabled statically linked program? > > My understanding by reading this thread > (https://sourceware.org/ml/libc-alpha/2016-01/msg00208.html) is that this is > not possible at the moment because of lacking compiler support. See also > https://sourceware.org/ml/libc-alpha/2015-11/msg00467.html and follow-ups. I still think optimizing compilers are a good thing. > > If I were to tackle this problem, I would try first to implement a > __builtin_explicit_bzero() directly in GCC such that GCC will know exactly how > to handle it. This would be faster, safer and more portable than any trick you > may get working now (since LTO keeps improving), and it will provide the basis > for a gnu libc implementation. Ok, since I am not a compiler expert, I need an example for this. My first try was to search for the memset_s() builtin. However, this doesn't seem to exist. Is memset_s() supported at all by GCC currently? [...] > Of course, there is the question of whether explicit_bzero() or similar > functions are a solution at all to any problem > (https://sourceware.org/ml/libc-alpha/2016-01/msg00208.html) Would a builtin not fix this issue? I am not sure if I understood this post at all. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.huber at embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.