Skip to content

Commit

Permalink
diag/mbr/: use checksize.pl to pad/prevent overflow
Browse files Browse the repository at this point in the history
HPA noticed that using Fedora 15 Alpha and gcc-4.6 broke on this code
  • Loading branch information
geneC committed Mar 16, 2011
1 parent df4b01c commit 9f8b76d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 7 additions & 1 deletion diag/mbr/Makefile
Expand Up @@ -28,8 +28,14 @@ all: handoff.bin
%.elf: %.o $(mbrdir)/mbr.ld
$(LD) $(LDFLAGS) -T $(mbrdir)/mbr.ld -e _start -o $@ $<

%.bin: %.elf
%.bin: %.elf $(mbrdir)/checksize.pl
$(OBJCOPY) -O binary $< $@
$(PERL) checksize.pl $@
$(CHMOD) -x $@

handoff.bin: handoff.elf $(mbrdir)/checksize.pl
$(OBJCOPY) -O binary $< $@
$(PERL) $(mbrdir)/checksize.pl $@ 420
$(CHMOD) -x $@

mbr_bin.c: mbr.bin
Expand Down
6 changes: 0 additions & 6 deletions diag/mbr/handoff.S
Expand Up @@ -337,9 +337,3 @@ bootfail:
die:
hlt
jmp die

zerob: /* Begin zeroing block to fill to desired length */
/* 420 bytes for FAT32 */
zeroln = (420 - (zerob - _start))
.=.+zeroln /* prevents overflow */
zeroe:

0 comments on commit 9f8b76d

Please sign in to comment.