diff options
author | Jay Freeman <saurik@saurik.com> | 2008-03-08 11:53:51 +0000 |
---|---|---|
committer | Jay Freeman <saurik@saurik.com> | 2008-03-08 11:53:51 +0000 |
commit | c2bea5000a0d07d1f4b5c5dcf6560b3bd24fae03 (patch) | |
tree | 3924a6539de282a7a0e9f0e85ad383f00e447f96 /data/odcctools/imm12.diff | |
parent | c6320f629d8d1c9f617f3f77748980cb255ab1fb (diff) |
Added the most recent patches to odcctools.
git-svn-id: http://svn.telesphoreo.org/trunk@165 514c082c-b64e-11dc-b46d-3d985efe055d
Diffstat (limited to 'data/odcctools/imm12.diff')
-rw-r--r-- | data/odcctools/imm12.diff | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/data/odcctools/imm12.diff b/data/odcctools/imm12.diff new file mode 100644 index 000000000..3c7df13f0 --- /dev/null +++ b/data/odcctools/imm12.diff @@ -0,0 +1,46 @@ +diff -ru odcctools/as/arm.c odcctools+iPhone/as/arm.c +--- odcctools/as/arm.c 2007-09-13 02:31:45.000000000 +0000 ++++ odcctools+iPhone/as/arm.c 2008-03-06 10:46:58.000000000 +0000 +@@ -592,7 +592,7 @@ + void md_number_to_imm(unsigned char *buf, signed_expr_t val, int size, fixS * + fixP, int nsect) + { +- unsigned int n = 0; ++ unsigned int n = 0, err; + + switch (fixP->fx_r_type) { + case ARM_RELOC_VANILLA: +@@ -644,8 +644,19 @@ + break; + + case ARM_RELOC_SHIFT_IMM12: +- n = generate_shifted_immediate(val, NULL); +- fill_reloc_value(buf, (unsigned int)n, 0x00000fff); ++ n = generate_shifted_immediate(val, &err); ++ if (err) { ++ n = (0x3 << 21) | generate_shifted_immediate(~val, &err); ++ if (!err) ++ as_warn("Immediate value is out of range: converting " ++ "automatically to a MVN instruction, but if this " ++ "was not a MOV instruction then this is unsafe!"); ++ else ++ as_bad("Immediate value out of range"); ++ printf("%x\n", n); ++ fill_reloc_value(buf, (unsigned int)n, (0x3 << 21) | 0x00000fff); ++ } else ++ fill_reloc_value(buf, (unsigned int)n, 0x00000fff); + break; + + case ARM_RELOC_SHIFT_IMM: +diff -ru odcctools/as/army.y odcctools+iPhone/as/army.y +--- odcctools/as/army.y 2007-10-16 23:11:52.000000000 +0000 ++++ odcctools+iPhone/as/army.y 2008-03-06 10:47:08.000000000 +0000 +@@ -249,7 +249,7 @@ + | expr + { + register_reloc_type(ARM_RELOC_SHIFT_IMM12, 4, 0); +- $$ = ((0x1 << 25) | $1); ++ $$ = ((0x1 << 25) | $1 & 0xfff); + } + ; + |