]> git.proxmox.com Git - qemu.git/commitdiff
Link ARM prologue closer to code segment to avoid a build failure
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 10 Jul 2008 17:21:31 +0000 (17:21 +0000)
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 10 Jul 2008 17:21:31 +0000 (17:21 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4867 c046a42c-6fe2-441c-8c8c-71466251a162

arm.ld
exec.c

diff --git a/arm.ld b/arm.ld
index e216cbfa7097d6ab6186130b93ef3d6154f49b1d..93285d697960def2f9243e6c4a43ec86b54cde3e 100644 (file)
--- a/arm.ld
+++ b/arm.ld
@@ -63,6 +63,7 @@ SECTIONS
   . = ALIGN(0x100000) + (. & (0x100000 - 1));
   .data    :
   {
+    *(.gen_code)
     *(.data)
     *(.gnu.linkonce.d*)
     CONSTRUCTORS
diff --git a/exec.c b/exec.c
index 5b43172f365c6b47f5da9ba71e72e5b21c1460ee..47f35e5b2e7fbd092550ef2ea666b7f036c3f7c5 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -89,7 +89,19 @@ int nb_tbs;
 /* any access to the tbs or the page table must use this lock */
 spinlock_t tb_lock = SPIN_LOCK_UNLOCKED;
 
-uint8_t code_gen_prologue[1024] __attribute__((aligned (32)));
+#if defined(__arm__)
+/* The prologue must be reachable with a direct jump. ARM has a
+ limited branch range (possibly also PPC and SPARC?) so place it in a
+ section close to code segment. */
+#define code_gen_section                                \
+    __attribute__((__section__(".gen_code")))           \
+    __attribute__((aligned (32)))
+#else
+#define code_gen_section                                \
+    __attribute__((aligned (32)))
+#endif
+
+uint8_t code_gen_prologue[1024] code_gen_section;
 uint8_t *code_gen_buffer;
 unsigned long code_gen_buffer_size;
 /* threshold to flush the translated code buffer */