diff options
Diffstat (limited to 'tools/creative.c')
-rw-r--r-- | tools/creative.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/creative.c b/tools/creative.c index 7748f56611..566904f78c 100644 --- a/tools/creative.c +++ b/tools/creative.c | |||
@@ -83,7 +83,8 @@ static int elf_convert(const unsigned char *inbuf, unsigned char *outbuf) | |||
83 | { | 83 | { |
84 | Elf32_Ehdr *main_header; | 84 | Elf32_Ehdr *main_header; |
85 | Elf32_Shdr *section_header; | 85 | Elf32_Shdr *section_header; |
86 | unsigned int i, j, sum, startaddr; | 86 | unsigned int i, j, sum; |
87 | int startaddr; | ||
87 | 88 | ||
88 | main_header = (Elf32_Ehdr*)inbuf; | 89 | main_header = (Elf32_Ehdr*)inbuf; |
89 | if( !( main_header->e_ident[0] == ELFMAG0 && main_header->e_ident[1] == ELFMAG1 | 90 | if( !( main_header->e_ident[0] == ELFMAG0 && main_header->e_ident[1] == ELFMAG1 |
@@ -93,7 +94,7 @@ static int elf_convert(const unsigned char *inbuf, unsigned char *outbuf) | |||
93 | return -1; | 94 | return -1; |
94 | } | 95 | } |
95 | 96 | ||
96 | startaddr = (unsigned int)outbuf; | 97 | startaddr = (intptr_t)outbuf; |
97 | 98 | ||
98 | for(i = 0; i < main_header->e_shnum; i++) | 99 | for(i = 0; i < main_header->e_shnum; i++) |
99 | { | 100 | { |
@@ -102,7 +103,7 @@ static int elf_convert(const unsigned char *inbuf, unsigned char *outbuf) | |||
102 | if( (section_header->sh_flags & SHF_WRITE || section_header->sh_flags & SHF_ALLOC | 103 | if( (section_header->sh_flags & SHF_WRITE || section_header->sh_flags & SHF_ALLOC |
103 | || section_header->sh_flags & SHF_EXECINSTR) && section_header->sh_size > 0 | 104 | || section_header->sh_flags & SHF_EXECINSTR) && section_header->sh_size > 0 |
104 | && section_header->sh_type != SHT_NOBITS ) | 105 | && section_header->sh_type != SHT_NOBITS ) |
105 | { | 106 | { |
106 | /* Address */ | 107 | /* Address */ |
107 | int2le(section_header->sh_addr, outbuf); | 108 | int2le(section_header->sh_addr, outbuf); |
108 | outbuf += 4; | 109 | outbuf += 4; |
@@ -122,7 +123,7 @@ static int elf_convert(const unsigned char *inbuf, unsigned char *outbuf) | |||
122 | outbuf += section_header->sh_size; | 123 | outbuf += section_header->sh_size; |
123 | } | 124 | } |
124 | } | 125 | } |
125 | return (unsigned int)(outbuf - startaddr); | 126 | return (intptr_t)(outbuf - startaddr); |
126 | } | 127 | } |
127 | 128 | ||
128 | static int make_jrm_file(const unsigned char *inbuf, unsigned char *outbuf) | 129 | static int make_jrm_file(const unsigned char *inbuf, unsigned char *outbuf) |