summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2010-02-02 14:42:02 +1100
committerSimon Horman <horms@verge.net.au>2010-02-02 14:42:02 +1100
commit3fb7c2ba7a96ac3a76795632369464acc6c1a776 (patch)
tree1c9ad819f6c6fc456d0637c5f84ee22fcbf1bbaf
parent77ee5cf2143417ca19c1dd981abcd016579f0cd9 (diff)
Make purgatory a signed char buffer
The consumer of the purgatory buffer, elf_rel_build_load() expects a signed char buffer. Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/arch/i386/kexec-bzImage.c4
-rw-r--r--kexec/arch/i386/kexec-elf-x86.c2
-rw-r--r--kexec/arch/i386/kexec-multiboot-x86.c2
-rw-r--r--kexec/arch/ppc64/kexec-elf-ppc64.c2
-rw-r--r--kexec/kexec.h2
-rw-r--r--util/bin-to-hex.c2
6 files changed, 7 insertions, 7 deletions
diff --git a/kexec/arch/i386/kexec-bzImage.c b/kexec/arch/i386/kexec-bzImage.c
index c1345d5..6180764 100644
--- a/kexec/arch/i386/kexec-bzImage.c
+++ b/kexec/arch/i386/kexec-bzImage.c
@@ -200,10 +200,10 @@ int do_bzImage_load(struct kexec_info *info,
* overflow takes place while applying relocations.
*/
if (!real_mode_entry && relocatable_kernel)
- elf_rel_build_load(info, &info->rhdr, (char *) purgatory, purgatory_size,
+ elf_rel_build_load(info, &info->rhdr, purgatory, purgatory_size,
0x3000, 0x7fffffff, -1, 0);
else
- elf_rel_build_load(info, &info->rhdr, (char *) purgatory, purgatory_size,
+ elf_rel_build_load(info, &info->rhdr, purgatory, purgatory_size,
0x3000, 640*1024, -1, 0);
dbgprintf("Loaded purgatory at addr 0x%lx\n", info->rhdr.rel_addr);
/* The argument/parameter segment */
diff --git a/kexec/arch/i386/kexec-elf-x86.c b/kexec/arch/i386/kexec-elf-x86.c
index 2e394e9..ccc5778 100644
--- a/kexec/arch/i386/kexec-elf-x86.c
+++ b/kexec/arch/i386/kexec-elf-x86.c
@@ -191,7 +191,7 @@ int elf_x86_load(int argc, char **argv, const char *buf, off_t len,
/* Do we want arguments? */
if (arg_style != ARG_STYLE_NONE) {
/* Load the setup code */
- elf_rel_build_load(info, &info->rhdr, (char *) purgatory, purgatory_size,
+ elf_rel_build_load(info, &info->rhdr, purgatory, purgatory_size,
0, ULONG_MAX, 1, 0);
}
if (arg_style == ARG_STYLE_NONE) {
diff --git a/kexec/arch/i386/kexec-multiboot-x86.c b/kexec/arch/i386/kexec-multiboot-x86.c
index 2a8a8a8..970de2a 100644
--- a/kexec/arch/i386/kexec-multiboot-x86.c
+++ b/kexec/arch/i386/kexec-multiboot-x86.c
@@ -217,7 +217,7 @@ int multiboot_x86_load(int argc, char **argv, const char *buf, off_t len,
elf_exec_build_load(info, &ehdr, buf, len, 0);
/* Load the setup code */
- elf_rel_build_load(info, &info->rhdr, (char *) purgatory, purgatory_size, 0,
+ elf_rel_build_load(info, &info->rhdr, purgatory, purgatory_size, 0,
ULONG_MAX, 1, 0);
/* The first segment will contain the multiboot headers:
diff --git a/kexec/arch/ppc64/kexec-elf-ppc64.c b/kexec/arch/ppc64/kexec-elf-ppc64.c
index 2a72482..d65a5d5 100644
--- a/kexec/arch/ppc64/kexec-elf-ppc64.c
+++ b/kexec/arch/ppc64/kexec-elf-ppc64.c
@@ -207,7 +207,7 @@ int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len,
}
/* Add v2wrap to the current image */
- elf_rel_build_load(info, &info->rhdr, (const char *)purgatory,
+ elf_rel_build_load(info, &info->rhdr, purgatory,
purgatory_size, 0, max_addr, 1, 0);
/* Add a ram-disk to the current image
diff --git a/kexec/kexec.h b/kexec/kexec.h
index 63e7bfa..ccda539 100644
--- a/kexec/kexec.h
+++ b/kexec/kexec.h
@@ -226,7 +226,7 @@ extern void arch_reuse_initrd(void);
extern int ifdown(void);
-extern unsigned char purgatory[];
+extern char purgatory[];
extern size_t purgatory_size;
#define BOOTLOADER "kexec"
diff --git a/util/bin-to-hex.c b/util/bin-to-hex.c
index 5906f93..48a71e7 100644
--- a/util/bin-to-hex.c
+++ b/util/bin-to-hex.c
@@ -6,7 +6,7 @@ int main(int argc, char **argv)
int i;
const char *name = argv[1];
printf("#include <stddef.h>\n");
- printf("const unsigned char %s[] = {\n", name);
+ printf("const char %s[] = {\n", name);
i = 0;
while((c = getchar()) != EOF) {
if ((i % 16) != 0) {