History

tccelf/tcccoff: fix some type conversion warnings

grischka committed 15 years ago

Commit 21c2a681 parent 86ffc482 files · +7 −7Browse files

Unified · Split

2 files
  1. tcccoff.c +1 −1
  2. tccelf.c +6 −6
tcccoff.c+1−1
@@ -943,7 +943,7 @@ ST_FUNC int tcc_load_coff(TCCState * s1, int fd) · 942 unmodified lines
943 if (name[0] == '_' && strcmp(name, "_main") != 0)943 if (name[0] == '_' && strcmp(name, "_main") != 0)
944 name++;944 name++;
945 945
946 tcc_add_symbol(s1, name, (void*)csym.n_value);946 tcc_add_symbol(s1, name, (void*)(uplong)csym.n_value);
947 }947 }
948 // skip any aux records948 // skip any aux records
949 949
tccelf.c+6−6
@@ -506,14 +506,14 @@ static uplong add_got_table(TCCState *s1, uplong val) · 505 unmodified lines
506}506}
507#elif defined TCC_TARGET_ARM507#elif defined TCC_TARGET_ARM
508#define JMP_TABLE_ENTRY_SIZE 8508#define JMP_TABLE_ENTRY_SIZE 8
509static int add_jmp_table(TCCState *s1, int val)509static uplong add_jmp_table(TCCState *s1, int val)
510{510{
511 uint32_t *p = (uint32_t *)(s1->runtime_plt_and_got + s1->runtime_plt_and_got_offset);511 uint32_t *p = (uint32_t *)(s1->runtime_plt_and_got + s1->runtime_plt_and_got_offset);
512 s1->runtime_plt_and_got_offset += JMP_TABLE_ENTRY_SIZE;512 s1->runtime_plt_and_got_offset += JMP_TABLE_ENTRY_SIZE;
513 /* ldr pc, [pc, #-4] */513 /* ldr pc, [pc, #-4] */
514 p[0] = 0xE51FF004;514 p[0] = 0xE51FF004;
515 p[1] = val;515 p[1] = val;
516 return (int)p;516 return (uplong)p;
517}517}
518#endif518#endif
519#endif519#endif
@@ -666,8 +666,8 @@ ST_FUNC void relocate_section(TCCState *s1, Section *s) · 146 unmodified lines
666 *(int*)ptr ^= 0xE12FFF10 ^ 0xE1A0F000; /* BX Rm -> MOV PC, Rm */666 *(int*)ptr ^= 0xE12FFF10 ^ 0xE1A0F000; /* BX Rm -> MOV PC, Rm */
667 break;667 break;
668 default:668 default:
669 fprintf(stderr,"FIXME: handle reloc type %x at %lx [%.8x] to %lx\n",669 fprintf(stderr,"FIXME: handle reloc type %x at %x [%.8x] to %x\n",
670 type,addr,(unsigned int)(long)ptr,val);670 type, (unsigned)addr, (unsigned)(uplong)ptr, (unsigned)val);
671 break;671 break;
672#elif defined(TCC_TARGET_C67)672#elif defined(TCC_TARGET_C67)
673 case R_C60_32:673 case R_C60_32:
@@ -692,8 +692,8 @@ ST_FUNC void relocate_section(TCCState *s1, Section *s) · 18 unmodified lines
692 case R_C60HI16:692 case R_C60HI16:
693 break;693 break;
694 default:694 default:
695 fprintf(stderr,"FIXME: handle reloc type %x at %lx [%.8x] to %lx\n",695 fprintf(stderr,"FIXME: handle reloc type %x at %x [%.8x] to %x\n",
696 type,addr,(unsigned int)(long)ptr, val);696 type, (unsigned)addr, (unsigned)(uplong)ptr, (unsigned)val);
697 break;697 break;
698#elif defined(TCC_TARGET_X86_64)698#elif defined(TCC_TARGET_X86_64)
699 case R_X86_64_64:699 case R_X86_64_64:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t