This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ilya Enkovich <enkovich dot gnu at gmail dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, GNU C Library <libc-alpha at sourceware dot org>, GCC Development <gcc at gcc dot gnu dot org>, Binutils <binutils at sourceware dot org>, "Girkar, Milind" <milind dot girkar at intel dot com>, "Kreitzer, David L" <david dot l dot kreitzer at intel dot com>
- Date: Mon, 7 Oct 2013 11:47:27 +0200
- Subject: Re: [x86-64 psABI] RFC: Extend x86-64 PLT entry to support MPX
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOp=1v38F_aV-pbv50YOGSEr_ju+byZP1L_G_h4bm5Ad3w at mail dot gmail dot com> <20130814154948 dot GR1814 at tucnak dot redhat dot com> <CAMe9rOp8V+V_iBWdu=wQRs-hWmTKvhEHqy_SnGzeMB0sPP2wzQ at mail dot gmail dot com> <CAMbmDYaU=vTGKne63Ji-Em2D8tyJaRUOix1B33vN4D-kTPqqaw at mail dot gmail dot com> <20131001122740 dot GB30970 at tucnak dot zalov dot cz> <CAMbmDYYvSA3cUo21+gp07E3AAFAAmUYJWZjDcWzyAVHVQpCrtQ at mail dot gmail dot com> <CAMbmDYaU1y8Wn1A+e-VY6V5-xFzF4c1-ueMt5WReEL3_EMcBOQ at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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