Fix 197259  Unsupported arch_prtctl PR_SET_GS

r3043 | philippe | 2014-12-16 15:57:51 -0800 (Tue, 16 Dec 2014) | 21 lines

Fix 197259  Unsupported arch_prtctl PR_SET_GS option

On amd64, We handle GS similar to FS, i.e. consider it is constant.
Note that FS is not always 0 on linux. It looks rather to be constant
in all threads, and is zero in the main thread.
As values for FS and/or GS differs between platforms (linux or darwin),
FS_CONST and GS_CONST are used.

Note that we cannot easily test that the value of GS or FS is the
expected one, as the value might not be set at the begin of execution
but only set after prctl has been executed.

So, we just hope that effectively GS and FS are constant.
Some trials to set GS to other values that the expected
constant value on linux was causing a SEGV.
So, it looks like this is all effectively protected.

In summary: we were counting somewhat on the luck for FS,
we now similarly count on luch for GS

(cherry-picked from svn://

Change-Id: Id696890f8c910187fb04e83e081512c995a0ad40
5 files changed