Subversion Repositories freemyipod

Rev

Rev 447 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 447 Rev 449
Line 796... Line 796...
796
					sym_vma = bfd_section_vma(abs_bfd, sym_section);
796
					sym_vma = bfd_section_vma(abs_bfd, sym_section);
797
					sym_addr += sym_vma + q->addend;
797
					sym_addr += sym_vma + q->addend;
798
					break;
798
					break;
799
				case R_ARM_GOT32:
799
				case R_ARM_GOT32:
800
				case R_ARM_GOTPC:
800
				case R_ARM_GOTPC:
-
 
801
                case R_ARM_V4BX:
801
					/* Should be fine as is */
802
					/* Should be fine as is */
802
					break;
803
					break;
803
				case R_ARM_PLT32:
804
				case R_ARM_PLT32:
804
					if (verbose)
805
					if (verbose)
805
						fprintf(stderr,
806
						fprintf(stderr,
Line 809... Line 810...
809
							sym_vma, (*(q->sym_ptr_ptr))->value,
810
							sym_vma, (*(q->sym_ptr_ptr))->value,
810
							q->address, sym_addr,
811
							q->address, sym_addr,
811
							(*p)->howto->rightshift,
812
							(*p)->howto->rightshift,
812
							*(uint32_t *)r_mem);
813
							*(uint32_t *)r_mem);
813
				case R_ARM_PC24:
814
				case R_ARM_PC24:
-
 
815
                case R_ARM_JUMP24:
814
					sym_vma = 0;
816
					sym_vma = 0;
815
					sym_addr = (sym_addr-q->address)>>(*p)->howto->rightshift;
817
					sym_addr = (sym_addr-q->address)>>(*p)->howto->rightshift;
816
					break;
818
					break;
817
#endif
819
#endif
818
 
820
 
Line 1401... Line 1403...
1401
				if (use_resolved ||
1403
				if (use_resolved ||
1402
					(((*p)->howto->type != R_ARM_PC24) &&
1404
					(((*p)->howto->type != R_ARM_PC24) &&
1403
					((*p)->howto->type != R_ARM_PLT32)))
1405
					((*p)->howto->type != R_ARM_PLT32)))
1404
					tmp.c[i3] = (hl >> 24) & 0xff;
1406
					tmp.c[i3] = (hl >> 24) & 0xff;
1405
				if ((*p)->howto->type == R_ARM_ABS32)
1407
				if ((*p)->howto->type == R_ARM_ABS32)
1406
					*(uint32_t *)r_mem = htonl(hl);
1408
					*(uint32_t *)r_mem = hl;
1407
				else
1409
				else
1408
					*(uint32_t *)r_mem = tmp.l;
1410
					*(uint32_t *)r_mem = tmp.l;
1409
#elif defined(TARGET_e1)
1411
#elif defined(TARGET_e1)
1410
#define OPCODE_SIZE 2           /* Add 2 bytes, counting the opcode size*/
1412
#define OPCODE_SIZE 2           /* Add 2 bytes, counting the opcode size*/
1411
				switch ((*p)->howto->type) {
1413
				switch ((*p)->howto->type) {
Line 1855... Line 1857...
1855
 
1857
 
1856
  text_offs = real_address_bits(text_vma);
1858
  text_offs = real_address_bits(text_vma);
1857
 
1859
 
1858
  /* Fill in the binflt_flat header */
1860
  /* Fill in the binflt_flat header */
1859
  memcpy(hdr.magic,"bFLT",4);
1861
  memcpy(hdr.magic,"bFLT",4);
1860
  hdr.rev         = htonl(FLAT_VERSION);
1862
  hdr.rev         = FLAT_VERSION;
1861
  hdr.entry       = htonl(sizeof(hdr) + bfd_get_start_address(abs_bfd));
1863
  hdr.entry       = sizeof(hdr) + bfd_get_start_address(abs_bfd);
1862
  hdr.data_start  = htonl(sizeof(hdr) + text_offs + text_len);
1864
  hdr.data_start  = sizeof(hdr) + text_offs + text_len;
1863
  hdr.data_end    = htonl(sizeof(hdr) + text_offs + text_len +data_len);
1865
  hdr.data_end    = sizeof(hdr) + text_offs + text_len +data_len;
1864
  hdr.bss_end     = htonl(sizeof(hdr) + text_offs + text_len +data_len+bss_len);
1866
  hdr.bss_end     = sizeof(hdr) + text_offs + text_len +data_len+bss_len;
1865
  hdr.stack_size  = htonl(stack); /* FIXME */
1867
  hdr.stack_size  = stack; /* FIXME */
1866
  hdr.reloc_start = htonl(sizeof(hdr) + text_offs + text_len +data_len);
1868
  hdr.reloc_start = sizeof(hdr) + text_offs + text_len +data_len;
1867
  hdr.reloc_count = htonl(reloc_len);
1869
  hdr.reloc_count = reloc_len;
1868
  hdr.flags       = htonl(0
1870
  hdr.flags       = 0
1869
	  | (load_to_ram || text_has_relocs ? FLAT_FLAG_RAM : 0)
1871
	  | (load_to_ram || text_has_relocs ? FLAT_FLAG_RAM : 0)
1870
	  | (ktrace ? FLAT_FLAG_KTRACE : 0)
1872
	  | (ktrace ? FLAT_FLAG_KTRACE : 0)
1871
	  | (pic_with_got ? FLAT_FLAG_GOTPIC : 0)
1873
	  | (pic_with_got ? FLAT_FLAG_GOTPIC : 0)
1872
	  | (docompress ? (docompress == 2 ? FLAT_FLAG_GZDATA : FLAT_FLAG_GZIP) : 0)
1874
	  | (docompress ? (docompress == 2 ? FLAT_FLAG_GZDATA : FLAT_FLAG_GZIP) : 0);
1873
	  );
-
 
1874
  hdr.build_date = htonl((uint32_t)time(NULL));
1875
  hdr.build_date = (uint32_t)time(NULL);
1875
  memset(hdr.filler, 0x00, sizeof(hdr.filler));
1876
  memset(hdr.filler, 0x00, sizeof(hdr.filler));
1876
 
1877
 
1877
  for (i=0; i<reloc_len; i++) reloc[i] = htonl(reloc[i]);
1878
  for (i=0; i<reloc_len; i++) reloc[i] = reloc[i];
1878
 
1879
 
1879
  if (verbose) {
1880
  if (verbose) {
1880
    printf("SIZE: .text=0x%04x, .data=0x%04x, .bss=0x%04x",
1881
    printf("SIZE: .text=0x%04x, .data=0x%04x, .bss=0x%04x",
1881
	text_len, data_len, bss_len);
1882
	text_len, data_len, bss_len);
1882
    if (reloc)
1883
    if (reloc)