summaryrefslogtreecommitdiffstats
path: root/arch/arc/lib
diff options
context:
space:
mode:
authorIgor Guryanov <guryanov@synopsys.com>2014-12-24 17:17:11 +0300
committerAlexey Brodkin <abrodkin@synopsys.com>2015-01-15 22:38:42 +0300
commit20a58ac0d8e09d0bf1a74c6b68fea22784512b51 (patch)
treedf909ca56ce3685deec112fdda3e723e77c09262 /arch/arc/lib
parentdcb431e723f132d0df63fb1e711042a6bbfc3a6a (diff)
downloadtalos-obmc-uboot-20a58ac0d8e09d0bf1a74c6b68fea22784512b51.tar.gz
talos-obmc-uboot-20a58ac0d8e09d0bf1a74c6b68fea22784512b51.zip
arc: introduce separate section for interrupt vector table
Even though existing implementation works fine in preparation to submission of ARCv2 architecture we need this change. In case of ARCv2 interrupt vector table consists of just addresses of corresponding handlers. And if those addresses will be in .text section then assembler will encode them as everything in .text section as middle-endian and then on real execution CPU will read swapped addresses and will jump into the wild. Once introduced new section is situated so .text section remains the first which allows us to use common linker option for linking everything to a specified CONFIG_SYS_TEXT_BASE. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Igor Guryanov <guryanov@synopsys.com>
Diffstat (limited to 'arch/arc/lib')
-rw-r--r--arch/arc/lib/relocate.c4
-rw-r--r--arch/arc/lib/sections.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/arch/arc/lib/relocate.c b/arch/arc/lib/relocate.c
index 2482bcdffc..5618b6ae93 100644
--- a/arch/arc/lib/relocate.c
+++ b/arch/arc/lib/relocate.c
@@ -44,7 +44,7 @@ int do_elf_reloc_fixups(void)
#ifdef __LITTLE_ENDIAN__
/* If location in ".text" section swap value */
if ((unsigned int)offset_ptr_rom <
- (unsigned int)&__text_end)
+ (unsigned int)&__ivt_end)
val = (val << 16) | (val >> 16);
#endif
@@ -55,7 +55,7 @@ int do_elf_reloc_fixups(void)
#ifdef __LITTLE_ENDIAN__
/* If location in ".text" section swap value */
if ((unsigned int)offset_ptr_rom <
- (unsigned int)&__text_end)
+ (unsigned int)&__ivt_end)
val = (val << 16) | (val >> 16);
#endif
memcpy(offset_ptr_ram, &val, sizeof(int));
diff --git a/arch/arc/lib/sections.c b/arch/arc/lib/sections.c
index b0b46a4e9a..a72c6946d5 100644
--- a/arch/arc/lib/sections.c
+++ b/arch/arc/lib/sections.c
@@ -19,3 +19,5 @@ char __rel_dyn_end[0] __attribute__((section(".__rel_dyn_end")));
char __text_start[0] __attribute__((section(".__text_start")));
char __text_end[0] __attribute__((section(".__text_end")));
char __init_end[0] __attribute__((section(".__init_end")));
+char __ivt_start[0] __attribute__((section(".__ivt_start")));
+char __ivt_end[0] __attribute__((section(".__ivt_end")));
OpenPOWER on IntegriCloud