Revision 82790064

b/elf_ops.h
159 159
        goto fail;
160 160

  
161 161
    if (pentry)
162
   	*pentry = (uint64_t)ehdr.e_entry;
162
   	*pentry = (uint64_t)(elf_sword)ehdr.e_entry;
163 163

  
164 164
    glue(load_symbols, SZ)(&ehdr, fd, must_swab);
165 165

  
......
206 206
    }
207 207
    qemu_free(phdr);
208 208
    if (lowaddr)
209
        *lowaddr = (uint64_t)low;
209
        *lowaddr = (uint64_t)(elf_sword)low;
210 210
    if (highaddr)
211
        *highaddr = (uint64_t)high;
211
        *highaddr = (uint64_t)(elf_sword)high;
212 212
    return total_size;
213 213
 fail:
214 214
    qemu_free(data);
b/loader.c
173 173

  
174 174
#define SZ		32
175 175
#define elf_word        uint32_t
176
#define elf_sword        int32_t
176 177
#define bswapSZs	bswap32s
177 178
#include "elf_ops.h"
178 179

  
......
182 183
#undef elf_sym
183 184
#undef elf_note
184 185
#undef elf_word
186
#undef elf_sword
185 187
#undef bswapSZs
186 188
#undef SZ
187 189
#define elfhdr		elf64_hdr
......
190 192
#define elf_shdr	elf64_shdr
191 193
#define elf_sym		elf64_sym
192 194
#define elf_word        uint64_t
195
#define elf_sword        int64_t
193 196
#define bswapSZs	bswap64s
194 197
#define SZ		64
195 198
#include "elf_ops.h"

Also available in: Unified diff