[Bug target/78631] [Intel MPX] libmpxwrappers shared library leads to a non-bounds-preserving memcpy()

ienkovich at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Dec 2 23:13:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78631

--- Comment #7 from Ilya Enkovich <ienkovich at gcc dot gnu.org> ---
(In reply to H.J. Lu from comment #6)
> -z bndplt is needed to call external functions with bounds.  But
> it isn't needed for internal function calls.

That doesn't explain why we need a hack you propose. Code like 

void *fn1 (void *p) {
  return fn2(p);
}

should work fine for any fn1 and fn2 compiled with MPX. Both internal and
external functions should work. If call goes through PLT then BNDPLT should be
used. If it's not then it's a bug in toolchain.


More information about the Gcc-bugs mailing list