summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2013-11-14 15:36:49 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-12-10 19:17:59 +0000
commit96e034f366eacc4bfaed87685d4536dae1e1b91c (patch)
tree20fb163cc2e7a0913d4882a1ec699dbab45957e8 /include
parent93cc00fde1ba15c1f995fe963f30c9caecb02f77 (diff)
downloadchrome-ec-96e034f366eacc4bfaed87685d4536dae1e1b91c.tar.gz
nds32: WORKAROUND for toolchain bug on rodata
Sometimes the toolchain tries to put a relocation which is not suitable to access variables in a read-only section. The nds32 gcc uses GP-relative signed 17-bit relocation to access variables stored in .rodata (eg lwi.gp $r0, [ +gp ]) That's wrong since $gp is pointing in the middle of .data and .bss in the SRAM, while .rodata is sitting in flash. Since on IT8380, the flash is at 0x00000 and the SRAM is at 0x80000 (512kB further), the linker will fail trying to create the signed 17-bit relocation (it detect that it needs to truncate it) Force the compiler to put another relocation as a workaround for now. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=chrome-os-partner:24378 TEST=./util/make_all.sh ; make BOARD=it8380dev check "version" and "gpioget" on spring, link and it8380dev. Change-Id: Ife50adf3a26be28f113292f73a1a70e8d74b5d8c Reviewed-on: https://chromium-review.googlesource.com/176913 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/common.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h
index b15b72e629..5f236a1f35 100644
--- a/include/common.h
+++ b/include/common.h
@@ -110,4 +110,12 @@ enum ec_error_list {
#define test_export_static static
#endif
+/*
+ * accessor allowing to override some read only data accesses.
+ * used to workaround a buggy toolchain (cf http://crosbug.com/p/24378)
+ */
+#ifndef RO
+#define RO(var) var
+#endif
+
#endif /* __CROS_EC_COMMON_H */