summaryrefslogtreecommitdiffstats
path: root/base/debug_on_start.h
diff options
context:
space:
mode:
authormaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 13:02:03 +0000
committermaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 13:02:03 +0000
commitc88873923d37e1d77d985f8fe614aaf835dcfa82 (patch)
treeef1c4f68daac23e83b2bc149c9b5802781bf3815 /base/debug_on_start.h
parentf9fb868acd8f9977254f33fc50565a9b7bdb3295 (diff)
downloadchromium_src-c88873923d37e1d77d985f8fe614aaf835dcfa82.zip
chromium_src-c88873923d37e1d77d985f8fe614aaf835dcfa82.tar.gz
chromium_src-c88873923d37e1d77d985f8fe614aaf835dcfa82.tar.bz2
Fix most issues when building base as a x64 target.
BUG=1282556 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/debug_on_start.h')
-rw-r--r--base/debug_on_start.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/base/debug_on_start.h b/base/debug_on_start.h
index 87afe9b..b260122 100644
--- a/base/debug_on_start.h
+++ b/base/debug_on_start.h
@@ -62,14 +62,29 @@ class DebugOnStart {
// theory it should be called before any user created global variable
// initialization code and CRT initialization code.
// Note: See VC\crt\src\defsects.inc and VC\crt\src\crt0.c for reference.
+#ifdef _WIN64
-// "Fix" the data section.
+// "Fix" the segment. On x64, the .CRT segment is merged into the .rdata segment
+// so it constains const data only.
+#pragma const_seg(push, ".CRT$XIB")
+// Declare the pointer so the CRT will find it.
+extern const DebugOnStart::PIFV debug_on_start;
+DECLSPEC_SELECTANY const DebugOnStart::PIFV debug_on_start =
+ &DebugOnStart::Init;
+// Fix back the segment.
+#pragma const_seg(pop)
+
+#else // _WIN64
+
+// "Fix" the segment. On x86, the .CRT segment is merged into the .data segment
+// so it constains non-const data only.
#pragma data_seg(push, ".CRT$XIB")
// Declare the pointer so the CRT will find it.
DECLSPEC_SELECTANY DebugOnStart::PIFV debug_on_start = &DebugOnStart::Init;
-// Fix back the data segment.
+// Fix back the segment.
#pragma data_seg(pop)
+#endif // _WIN64
#endif // _WIN32
#endif // BASE_DEBUG_ON_START_H__