On Mon, Oct 07, 2013 at 01:31:29PM +0400, Ilya Enkovich wrote: > Seems assembler may not always detect MPX relocation. For simple calls > it may check for 'bnd' prefix, but for indirect call we need to > generate MPX relocation for 'mov' instruction storing address of the > called function. This instruction does not have any prefix and > therefore compiler has to specify relocation by itself.
Ugh, not only mov I guess. You can easily have: int *fn1 (int *, int *); int *fn2 (int *, int *); typedef int (*fnt) (int *, int *); fnt fns[2] = { fn1, fn2 }; So perhaps we need some directive that will say that all the relocations that could be used to refer to PLT slots need to be turned into corresponding MPX relocations? Or assembler switch. Jakub