]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Support for more SPARC relocations, by Martin Bochnig.
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 10 Feb 2007 21:31:43 +0000 (21:31 +0000)
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 10 Feb 2007 21:31:43 +0000 (21:31 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2407 c046a42c-6fe2-441c-8c8c-71466251a162

dyngen.c
elf.h

index bcfb86ea0dded612d51562e23cef3fe90041980a..c6a878c6dee23a367094e4ad6a538847443b9b76 100644 (file)
--- a/dyngen.c
+++ b/dyngen.c
@@ -2349,6 +2349,33 @@ void gen_code(const char *name, host_ulong offset, host_ulong size,
                                     reloc_offset, reloc_offset, name, addend,
                                    reloc_offset);
                             break;
+                        case R_SPARC_HH22:
+                            fprintf(outfile,
+                                   "    *(uint32_t *)(gen_code_ptr + %d) = "
+                                   "((*(uint32_t *)(gen_code_ptr + %d)) "
+                                   " & ~0x00000000) "
+                                   " | (((%s + %d) >> 42) & 0x00000000);\n",
+                                    reloc_offset, reloc_offset, name, addend);
+                             break;
+
+                       case R_SPARC_LM22:
+                            fprintf(outfile,
+                                   "    *(uint32_t *)(gen_code_ptr + %d) = "
+                                   "((*(uint32_t *)(gen_code_ptr + %d)) "
+                                   " & ~0x00000000) "
+                                   " | (((%s + %d) >> 10) & 0x00000000);\n",
+                                    reloc_offset, reloc_offset, name, addend);
+                           break;
+
+                       case R_SPARC_HM10:
+                            fprintf(outfile,
+                                   "    *(uint32_t *)(gen_code_ptr + %d) = "
+                                   "((*(uint32_t *)(gen_code_ptr + %d)) "
+                                   " & ~0x00000000) "
+                                   " | ((((%s + %d) >> 32 & 0x3ff)) & 0x00000000);\n",
+                                    reloc_offset, reloc_offset, name, addend);
+                           break;
+
                         default:
                            error("unsupported sparc64 relocation (%d) for symbol %s", type, name);
                         }
diff --git a/elf.h b/elf.h
index 1825d50e82a20cef8bad0511ae3fb355c884832e..e6ccfebede802cafaf4ee64c5ad11963e6306965 100644 (file)
--- a/elf.h
+++ b/elf.h
@@ -328,6 +328,9 @@ typedef struct {
 #define R_SPARC_11             31
 #define R_SPARC_64             32
 #define R_SPARC_OLO10           33
+#define R_SPARC_HH22            34
+#define R_SPARC_HM10            35
+#define R_SPARC_LM22            36
 #define R_SPARC_WDISP16                40
 #define R_SPARC_WDISP19                41
 #define R_SPARC_7              43