freemyipod r449 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r448‎ | r449 | r450 >
Date:02:26, 19 January 2011
Author:theseven
Status:new
Tags:
Comment:
elf2flt: Fix some more problems, seems to work now
Modified paths:
  • /tools/elf2flt (modified) (history)
  • /tools/elf2flt/elf2flt.c (modified) (history)

Diff [purge]

Index: tools/elf2flt/elf2flt.c
@@ -798,6 +798,7 @@
799799 break;
800800 case R_ARM_GOT32:
801801 case R_ARM_GOTPC:
 802+ case R_ARM_V4BX:
802803 /* Should be fine as is */
803804 break;
804805 case R_ARM_PLT32:
@@ -811,6 +812,7 @@
812813 (*p)->howto->rightshift,
813814 *(uint32_t *)r_mem);
814815 case R_ARM_PC24:
 816+ case R_ARM_JUMP24:
815817 sym_vma = 0;
816818 sym_addr = (sym_addr-q->address)>>(*p)->howto->rightshift;
817819 break;
@@ -1403,7 +1405,7 @@
14041406 ((*p)->howto->type != R_ARM_PLT32)))
14051407 tmp.c[i3] = (hl >> 24) & 0xff;
14061408 if ((*p)->howto->type == R_ARM_ABS32)
1407 - *(uint32_t *)r_mem = htonl(hl);
 1409+ *(uint32_t *)r_mem = hl;
14081410 else
14091411 *(uint32_t *)r_mem = tmp.l;
14101412 #elif defined(TARGET_e1)
@@ -1857,24 +1859,23 @@
18581860
18591861 /* Fill in the binflt_flat header */
18601862 memcpy(hdr.magic,"bFLT",4);
1861 - hdr.rev = htonl(FLAT_VERSION);
1862 - hdr.entry = htonl(sizeof(hdr) + bfd_get_start_address(abs_bfd));
1863 - hdr.data_start = htonl(sizeof(hdr) + text_offs + text_len);
1864 - hdr.data_end = htonl(sizeof(hdr) + text_offs + text_len +data_len);
1865 - hdr.bss_end = htonl(sizeof(hdr) + text_offs + text_len +data_len+bss_len);
1866 - hdr.stack_size = htonl(stack); /* FIXME */
1867 - hdr.reloc_start = htonl(sizeof(hdr) + text_offs + text_len +data_len);
1868 - hdr.reloc_count = htonl(reloc_len);
1869 - hdr.flags = htonl(0
 1863+ hdr.rev = FLAT_VERSION;
 1864+ hdr.entry = sizeof(hdr) + bfd_get_start_address(abs_bfd);
 1865+ hdr.data_start = sizeof(hdr) + text_offs + text_len;
 1866+ hdr.data_end = sizeof(hdr) + text_offs + text_len +data_len;
 1867+ hdr.bss_end = sizeof(hdr) + text_offs + text_len +data_len+bss_len;
 1868+ hdr.stack_size = stack; /* FIXME */
 1869+ hdr.reloc_start = sizeof(hdr) + text_offs + text_len +data_len;
 1870+ hdr.reloc_count = reloc_len;
 1871+ hdr.flags = 0
18701872 | (load_to_ram || text_has_relocs ? FLAT_FLAG_RAM : 0)
18711873 | (ktrace ? FLAT_FLAG_KTRACE : 0)
18721874 | (pic_with_got ? FLAT_FLAG_GOTPIC : 0)
1873 - | (docompress ? (docompress == 2 ? FLAT_FLAG_GZDATA : FLAT_FLAG_GZIP) : 0)
1874 - );
1875 - hdr.build_date = htonl((uint32_t)time(NULL));
 1875+ | (docompress ? (docompress == 2 ? FLAT_FLAG_GZDATA : FLAT_FLAG_GZIP) : 0);
 1876+ hdr.build_date = (uint32_t)time(NULL);
18761877 memset(hdr.filler, 0x00, sizeof(hdr.filler));
18771878
1878 - for (i=0; i<reloc_len; i++) reloc[i] = htonl(reloc[i]);
 1879+ for (i=0; i<reloc_len; i++) reloc[i] = reloc[i];
18791880
18801881 if (verbose) {
18811882 printf("SIZE: .text=0x%04x, .data=0x%04x, .bss=0x%04x",
Index: tools/elf2flt
Property changes on: tools/elf2flt
___________________________________________________________________
Modified: svn:ignore
## -2,3 +2,8 ##
18821883 config.log
18831884 config.status
18841885 Makefile
 1886+elf2flt
 1887+elf2flt.ld
 1888+flthdr
 1889+ld-elf2flt
 1890+ld-elf2flt.sh