https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78631
--- Comment #11 from Ilya Enkovich <ienkovich at gcc dot gnu.org> --- (In reply to H.J. Lu from comment #10) > > MPX wrapper library isn't built with -z bndplt since it doesn't call > external functions with bounds. But some internal functions, which > need bounds, are called via PLT which clear bounds. It should call > call those internal functions directly instead of via PLT. Thanks for explanation. I thought we added '-fcheck-pointer-bounds -mmpx' libmpxwrappers link flags but now I see we didn't. We also added tests to check memcpy copies bounds correctly but didn't check memcpy detects bounds violation. I suppose your patch is OK with such test added.