Linux: don't use GOT patching to intercept localtime(_r)

Our current GOT patching code is platform specific and fails to work
when V8 is built as a library.

Instead we define global functions for those functions which we wish
to override.  Since we will be first in the dynamic resolution order,
the dynamic linker will point callers to our versions of these
functions. However, we have the same binary for both the browser and
the renderers, which means that our overrides will apply in the
browser too.

The global |g_am_zygote_or_renderer| is true iff we are in a zygote or
renderer process. It's set in ZygoteMain and inherited by the
renderers when they fork. (This means that it'll be incorrect for
global constructor functions and before ZygoteMain is called -
beware).

Our replacement functions can check this global and either proxy the
call to the browser over the sandbox IPC
(http://code.google.com/p/chromium/wiki/LinuxSandboxIPC) or they can
use dlsym with RTLD_NEXT to resolve the symbol, ignoring any symbols
in the current module.

TEST=Run javascript:alert(new Date().getTimezoneOffset()). It shouldn't return 0 unless you're actually in GMT.
BUG=16800
http://codereview.chromium.org/165011


git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22636 0039d316-1c4b-4281-b951-d872f2087c98
1 file changed