Linux: don't use GOT patching to intercept localtime(_r)
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: de016e52bd170d2d4f2344f9bf92d50478b649e0@22636 0039d316-1c4b-4281-b951-d872f2087c98

hgl888/chromium-crosswalk,Jonekee/chromium.src,timopulkkinen/BubbleFish,markYoungH/chromium.src,Fireblend/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,junmin-zhu/chromium-rivertrail,junmin-zhu/chromium-rivertrail,crosswalk-project/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,ondra-novak/chromium.src,axinging/chromium-crosswalk,anirudhSK/chromium,dednal/chromium.src,Chilledheart/chromium,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,zcbenz/cefode-chromium,hujiajie/pa-chromium,Just-D/chromium-1,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ondra-novak/chromium.src,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,junmin-zhu/chromium-rivertrail,ltilve/chromium,ChromiumWebApps/chromium,dushu1203/chromium.src,anirudhSK/chromium,fujunwei/chromium-crosswalk,littlstar/chromium.src,pozdnyakov/chromium-crosswalk,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,M4sse/chromium.src,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Chilledheart/chromium,dednal/chromium.src,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,hgl888/chromium-crosswalk,rogerwang/chromium,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,robclark/chromium,fujunwei/chromium-crosswalk,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,chuan9/chromium-crosswalk,anirudhSK/chromium,ChromiumWebApps/chromium,rogerwang/chromium,M4sse/chromium.src,hujiajie/pa-chromium,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,chuan9/chromium-crosswalk,timopulkkinen/BubbleFish,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,hujiajie/pa-chromium,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,junmin-zhu/chromium-rivertrail,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,rogerwang/chromium,zcbenz/cefode-chromium,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,robclark/chromium,robclark/chromium,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,dushu1203/chromium.src,Chilledheart/chromium,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk,jaruba/chromium.src,krieger-od/nwjs_chromium.src,keishi/chromium,hgl888/chromium-crosswalk-efl,patrickm/chromium.src,robclark/chromium,rogerwang/chromium,dednal/chromium.src,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,jaruba/chromium.src,Just-D/chromium-1,timopulkkinen/BubbleFish,krieger-od/nwjs_chromium.src,littlstar/chromium.src,dednal/chromium.src,krieger-od/nwjs_chromium.src,ChromiumWebApps/chromium,axinging/chromium-crosswalk,Jonekee/chromium.src,Jonekee/chromium.src,ltilve/chromium,ondra-novak/chromium.src,patrickm/chromium.src,mogoweb/chromium-crosswalk,markYoungH/chromium.src,keishi/chromium,hujiajie/pa-chromium,keishi/chromium,krieger-od/nwjs_chromium.src,zcbenz/cefode-chromium,rogerwang/chromium,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,chuan9/chromium-crosswalk,mogoweb/chromium-crosswalk,timopulkkinen/BubbleFish,M4sse/chromium.src,ondra-novak/chromium.src,Jonekee/chromium.src,Jonekee/chromium.src,nacl-webkit/chrome_deps,keishi/chromium,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hujiajie/pa-chromium,anirudhSK/chromium,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,rogerwang/chromium,patrickm/chromium.src,M4sse/chromium.src,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,jaruba/chromium.src,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,anirudhSK/chromium,Just-D/chromium-1,ondra-novak/chromium.src,hgl888/chromium-crosswalk,littlstar/chromium.src,dushu1203/chromium.src,nacl-webkit/chrome_deps,anirudhSK/chromium,timopulkkinen/BubbleFish,robclark/chromium,keishi/chromium,M4sse/chromium.src,crosswalk-project/chromium-crosswalk-efl,zcbenz/cefode-chromium,pozdnyakov/chromium-crosswalk,M4sse/chromium.src,crosswalk-project/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,Chilledheart/chromium,hgl888/chromium-crosswalk,ltilve/chromium,junmin-zhu/chromium-rivertrail,rogerwang/chromium,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,robclark/chromium,TheTypoMaster/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ChromiumWebApps/chromium,dushu1203/chromium.src,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,nacl-webkit/chrome_deps,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,keishi/chromium,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,keishi/chromium,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,keishi/chromium,timopulkkinen/BubbleFish,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,Chilledheart/chromium,junmin-zhu/chromium-rivertrail,Pluto-tv/chromium-crosswalk,hujiajie/pa-chromium,littlstar/chromium.src,bright-sparks/chromium-spacewalk,patrickm/chromium.src,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,markYoungH/chromium.src,Fireblend/chromium-crosswalk,dushu1203/chromium.src,zcbenz/cefode-chromium,zcbenz/cefode-chromium,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,jaruba/chromium.src,Just-D/chromium-1,fujunwei/chromium-crosswalk,junmin-zhu/chromium-rivertrail,robclark/chromium,ondra-novak/chromium.src,pozdnyakov/chromium-crosswalk,junmin-zhu/chromium-rivertrail,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,littlstar/chromium.src,littlstar/chromium.src,zcbenz/cefode-chromium,ChromiumWebApps/chromium,rogerwang/chromium,keishi/chromium,nacl-webkit/chrome_deps,markYoungH/chromium.src,chuan9/chromium-crosswalk,dushu1203/chromium.src,ltilve/chromium,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,mogoweb/chromium-crosswalk,robclark/chromium,anirudhSK/chromium,littlstar/chromium.src,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,anirudhSK/chromium,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,hujiajie/pa-chromium,axinging/chromium-crosswalk,Just-D/chromium-1,patrickm/chromium.src,anirudhSK/chromium,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,robclark/chromium,ltilve/chromium,pozdnyakov/chromium-crosswalk,ltilve/chromium,patrickm/chromium.src,dednal/chromium.src,dednal/chromium.src,ondra-novak/chromium.src,junmin-zhu/chromium-rivertrail,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,dednal/chromium.src,markYoungH/chromium.src,Chilledheart/chromium,M4sse/chromium.src,patrickm/chromium.src,littlstar/chromium.src,mogoweb/chromium-crosswalk,axinging/chromium-crosswalk,robclark/chromium,pozdnyakov/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,nacl-webkit/chrome_deps,dushu1203/chromium.src,dednal/chromium.src,fujunwei/chromium-crosswalk,M4sse/chromium.src,keishi/chromium,ltilve/chromium,Chilledheart/chromium,anirudhSK/chromium,timopulkkinen/BubbleFish,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,hujiajie/pa-chromium,zcbenz/cefode-chromium,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,dednal/chromium.src,jaruba/chromium.src,patrickm/chromium.src,ChromiumWebApps/chromium,jaruba/chromium.src,nacl-webkit/chrome_deps,M4sse/chromium.src,ondra-novak/chromium.src,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,mogoweb/chromium-crosswalk,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,ltilve/chromium,TheTypoMaster/chromium-crosswalk,nacl-webkit/chrome_deps,ltilve/chromium,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,rogerwang/chromium,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,chuan9/chromium-crosswalk,ondra-novak/chromium.src,dushu1203/chromium.src,rogerwang/chromium,zcbenz/cefode-chromium,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,chuan9/chromium-crosswalk,hujiajie/pa-chromium,patrickm/chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,keishi/chromium,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk