Rev 869 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 869 | Rev 872 | ||
---|---|---|---|
Line 57... | Line 57... | ||
57 | 57 | ||
58 | elf = mmap(NULL, LENGTH, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); |
58 | elf = mmap(NULL, LENGTH, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); |
59 | if ((void *) elf == (void *) -1) |
59 | if ((void *) elf == (void *) -1) |
60 | error("map failed"); |
60 | error("map failed"); |
61 | 61 | ||
62 | /*vma = elf[ELF_VMA];*/ |
- | |
63 | lma = elf[ELF_LMA]; |
62 | lma = elf[ELF_LMA]; |
64 | elf[ELF_VMA] = lma; |
63 | elf[ELF_VMA] = lma; |
65 | entry = elf[ELF_ENTRY]; |
- | |
66 | entry &= ((~0LL)>>3); |
64 | entry = lma; |
67 | elf[ELF_ENTRY] = entry; |
65 | elf[ELF_ENTRY] = entry; |
68 | elf[ELF_ENTRY] = 0x100000; |
- | |
69 | /*elf[ELF_LMA] = vma;*/ |
- | |
70 | 66 | ||
71 | if (munmap(elf, LENGTH) == -1) |
67 | if (munmap(elf, LENGTH) == -1) |
72 | error("munmap failed"); |
68 | error("munmap failed"); |
73 | 69 | ||
74 | if (close(fd) == -1) |
70 | if (close(fd) == -1) |