Re: Is there a way to use __builtin___memcpy_chk() for compiler-generated memcpy calls?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* John via Gcc-help Dallman:

> Hi, folks, 
>
> I'm trying to eliminate calls to classic string functions (strcpy,
> strcat, etc.) and memcpy from a shared library, built from C and C++
> code with GCC 11.2. With -D_FORTIFY=2 and a bit of work with macros,
> I've eliminated all of them from the source, but I still have calls to
> memcpy from the object files. My suspected causes of these are:
>
> a) Struct copying, with memcpy calls inserted by the compiler.

GCC will also optimize __memcpy_chk calls to memcpy if it knows that the
bounds cannot be wrong.  With struct copies, such a mismatch can only
happen if the types are wrong, and that's currently out of scope for
source fortification.

Thanks,
Florian




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux