Re: [PATCH v6 02/27] x86: Use symbol name in jump table for PIE support

2019-02-07 Thread Thomas Garnier
On Thu, Feb 7, 2019 at 9:11 AM Borislav Petkov wrote: > > On Thu, Feb 07, 2019 at 09:04:45AM -0800, Thomas Garnier wrote: > > I assume that's an optimisation done by gcc later. > > So why is that change even needed? Where does it break? > > > The P modifier in the documentation does state that it

Re: [PATCH v6 02/27] x86: Use symbol name in jump table for PIE support

2019-02-07 Thread Borislav Petkov
On Thu, Feb 07, 2019 at 09:04:45AM -0800, Thomas Garnier wrote: > I assume that's an optimisation done by gcc later. So why is that change even needed? Where does it break? > The P modifier in the documentation does state that it is used to > generate PIC code. The documentation says: "If used

Re: [PATCH v6 02/27] x86: Use symbol name in jump table for PIE support

2019-02-07 Thread Thomas Garnier
On Thu, Feb 7, 2019 at 4:17 AM Borislav Petkov wrote: > > On Thu, Jan 31, 2019 at 11:24:09AM -0800, Thomas Garnier wrote: > > Replace the %c constraint with %P. The %c is incompatible with PIE > > because it implies an immediate value whereas %P reference a symbol. > > How so? > > AFAIK, %c

Re: [PATCH v6 02/27] x86: Use symbol name in jump table for PIE support

2019-02-07 Thread Borislav Petkov
On Thu, Jan 31, 2019 at 11:24:09AM -0800, Thomas Garnier wrote: > Replace the %c constraint with %P. The %c is incompatible with PIE > because it implies an immediate value whereas %P reference a symbol. How so? AFAIK, %c requires a constant operand and if %P is used to print a constant, it