aboutsummaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2014-01-17 16:54:32 -0800
committerH. Peter Anvin <hpa@zytor.com>2014-01-17 16:55:34 -0800
commit12eae5ce91273ba9a98b7fe9a838f5ef2f9044b7 (patch)
tree871283162279ea3cff76c9c776ea024c4839c4dd /linux
parent39311d7551b2834c67f3fd3ac197f8f634afb2d1 (diff)
downloadsyslinux-12eae5ce91273ba9a98b7fe9a838f5ef2f9044b7.tar.gz
syslinux-12eae5ce91273ba9a98b7fe9a838f5ef2f9044b7.tar.xz
syslinux-12eae5ce91273ba9a98b7fe9a838f5ef2f9044b7.zip
installer: Add sparse address space annotations to the syslinux image
Add sparse address space annotations for the syslinux boot image, to make it easier to catch errors that break the DOS installer build again. Use "make CC=cgcc" to run sparse. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'linux')
-rwxr-xr-xlinux/syslinux.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/linux/syslinux.c b/linux/syslinux.c
index f64834bd..912de71f 100755
--- a/linux/syslinux.c
+++ b/linux/syslinux.c
@@ -433,7 +433,8 @@ int main(int argc, char *argv[])
}
/* Write it the first time */
- if (xpwrite(fd, boot_image, boot_image_len, 0) != (int)boot_image_len ||
+ if (xpwrite(fd, (const char _force *)boot_image, boot_image_len, 0)
+ != (int)boot_image_len ||
xpwrite(fd, syslinux_adv, 2 * ADV_SIZE,
boot_image_len) != 2 * ADV_SIZE) {
fprintf(stderr, "%s: write failure on %s\n", program, ldlinux_name);
@@ -468,7 +469,8 @@ int main(int argc, char *argv[])
goto umount;
}
- rv = xpwrite(fd, syslinux_ldlinuxc32, syslinux_ldlinuxc32_len, 0);
+ rv = xpwrite(fd, (const char _force *)syslinux_ldlinuxc32,
+ syslinux_ldlinuxc32_len, 0);
if (rv != (int)syslinux_ldlinuxc32_len) {
fprintf(stderr, "%s: write failure on %s\n", program, ldlinux_name);
exit(1);
@@ -505,7 +507,9 @@ umount:
* Write the now-patched first sectors of ldlinux.sys
*/
for (i = 0; i < patch_sectors; i++) {
- xpwrite(dev_fd, boot_image + i * SECTOR_SIZE, SECTOR_SIZE,
+ xpwrite(dev_fd,
+ (const char _force *)boot_image + i * SECTOR_SIZE,
+ SECTOR_SIZE,
opt.offset + ((off_t) sectors[i] << SECTOR_SHIFT));
}