From: H. Peter Anvin Date: Sun, 14 Nov 2010 21:12:28 +0000 (-0800) Subject: gfxboot: use a character array for an absolute symbol X-Git-Tag: syslinux-4.04-pre1~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51d2e40990ce9d2360300a81562b1b2f7610d336;p=platform%2Fupstream%2Fsyslinux.git gfxboot: use a character array for an absolute symbol The best way to access an absolute symbol is "extern const char foo[];" -- older gccs let you get away with "extern void" but gcc 4.5 chokes on it. Signed-off-by: H. Peter Anvin --- diff --git a/com32/gfxboot/gfxboot.c b/com32/gfxboot/gfxboot.c index 2323f8e..65b2d49 100644 --- a/com32/gfxboot/gfxboot.c +++ b/com32/gfxboot/gfxboot.c @@ -61,7 +61,7 @@ #define GFX_CB_PASSWORD_DONE 11 // real mode code chunk, will be placed into bounce buffer -extern void realmode_callback_start, realmode_callback_end; +extern const char realmode_callback_start[], realmode_callback_end[]; // gets in the way #undef linux @@ -557,7 +557,7 @@ int gfx_init(char *file) gfx_config.file = gfx_config.archive_start + file_start; - u = &realmode_callback_end - &realmode_callback_start; + u = realmode_callback_end - realmode_callback_start; u = (u + REALMODE_BUF_SIZE + 0xf) & ~0xf; if(u + code_size > lowmem_size) { @@ -565,7 +565,8 @@ int gfx_init(char *file) return 1; } - memcpy(lowmem + REALMODE_BUF_SIZE, &realmode_callback_start, &realmode_callback_end - &realmode_callback_start); + memcpy(lowmem + REALMODE_BUF_SIZE, realmode_callback_start, + realmode_callback_end - realmode_callback_start); // fill in buffer size and location *(uint16_t *) (lowmem + REALMODE_BUF_SIZE) = REALMODE_BUF_SIZE;