comparison ticoff/armdis.c @ 114:ca8e43288836

tiobjd: ARM_B reloc handling
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 03 Apr 2014 06:42:39 +0000
parents d97fbe98600b
children 2f23301d2f86
comparison
equal deleted inserted replaced
113:d97fbe98600b 114:ca8e43288836
495 printf("swi%s\t0x%x\n", condition_decode[word>>28], 495 printf("swi%s\t0x%x\n", condition_decode[word>>28],
496 word & 0xFFFFFF); 496 word & 0xFFFFFF);
497 return; 497 return;
498 } 498 }
499 } 499 }
500
501 void
502 arm_branch_reloc(sec, rel)
503 struct internal_scnhdr *sec;
504 struct internal_reloc *rel;
505 {
506 unsigned word, dest;
507
508 word = get_u32(filemap + sec->data_offset + rel->location);
509 printf("%08x R\t", word);
510 if ((word & 0x0E000000) != 0x0A000000) {
511 printf("<invalid ARM_B reloc: opcode not B or BL>\n");
512 return;
513 }
514 dest = (word & 0x00FFFFFF) << 2;
515 if (dest & 0x02000000)
516 dest |= 0xFC000000;
517 dest += rel->location + 8;
518 printf("b%s%s\t", word&0x1000000 ? "l" : "",
519 condition_decode[word>>28]);
520 disasm_reloc_target(sec, rel, dest);
521 putchar('\n');
522 }