Commit b80029cad1dad2caaaae61de334488a6847a087e

Authored by ths
1 parent 43024c6a

Support for more SPARC relocations, by Martin Bochnig.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2407 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 30 additions and 0 deletions
dyngen.c
... ... @@ -2349,6 +2349,33 @@ void gen_code(const char *name, host_ulong offset, host_ulong size,
2349 2349 reloc_offset, reloc_offset, name, addend,
2350 2350 reloc_offset);
2351 2351 break;
  2352 + case R_SPARC_HH22:
  2353 + fprintf(outfile,
  2354 + " *(uint32_t *)(gen_code_ptr + %d) = "
  2355 + "((*(uint32_t *)(gen_code_ptr + %d)) "
  2356 + " & ~0x00000000) "
  2357 + " | (((%s + %d) >> 42) & 0x00000000);\n",
  2358 + reloc_offset, reloc_offset, name, addend);
  2359 + break;
  2360 +
  2361 + case R_SPARC_LM22:
  2362 + fprintf(outfile,
  2363 + " *(uint32_t *)(gen_code_ptr + %d) = "
  2364 + "((*(uint32_t *)(gen_code_ptr + %d)) "
  2365 + " & ~0x00000000) "
  2366 + " | (((%s + %d) >> 10) & 0x00000000);\n",
  2367 + reloc_offset, reloc_offset, name, addend);
  2368 + break;
  2369 +
  2370 + case R_SPARC_HM10:
  2371 + fprintf(outfile,
  2372 + " *(uint32_t *)(gen_code_ptr + %d) = "
  2373 + "((*(uint32_t *)(gen_code_ptr + %d)) "
  2374 + " & ~0x00000000) "
  2375 + " | ((((%s + %d) >> 32 & 0x3ff)) & 0x00000000);\n",
  2376 + reloc_offset, reloc_offset, name, addend);
  2377 + break;
  2378 +
2352 2379 default:
2353 2380 error("unsupported sparc64 relocation (%d) for symbol %s", type, name);
2354 2381 }
... ...
... ... @@ -328,6 +328,9 @@ typedef struct {
328 328 #define R_SPARC_11 31
329 329 #define R_SPARC_64 32
330 330 #define R_SPARC_OLO10 33
  331 +#define R_SPARC_HH22 34
  332 +#define R_SPARC_HM10 35
  333 +#define R_SPARC_LM22 36
331 334 #define R_SPARC_WDISP16 40
332 335 #define R_SPARC_WDISP19 41
333 336 #define R_SPARC_7 43
... ...