Ensure proper alignment of subsections.
authorKevin O'Connor <kevin@koconnor.net>
Sun, 6 Jul 2008 01:08:56 +0000 (21:08 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 6 Jul 2008 01:08:56 +0000 (21:08 -0400)
Also, do a better job of halting build on a failure in checkrom.py

Makefile
src/rombios32.lds.S
tools/checkrom.py

index b4dcd8e9094d2d578cb95fb94620bb3a39e81478..70b0a3efae6c21e842b4fc3da46732ecfbc0c018 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -103,10 +103,10 @@ $(OUT)rom16.o: $(OUT)romlayout16.o $(OUT)rom32.notreloc.o $(OUT)rombios16.lds
 $(OUT)rom32.o: $(OUT)rom16.o $(OUT)romlayout32.o $(OUT)rombios32.lds
        @echo "  Linking $@"
        $(Q)ld -T $(OUT)rombios32.lds $(OUT)rom16.o $(OUT)romlayout32.o -o $@
-       $(Q)nm $@ | ./tools/checkrom.py
 
 $(OUT)bios.bin.elf: $(OUT)rom32.o
-       @echo "  Stripping $<"
+       @echo "  Prepping $@"
+       $(Q)nm $< | ./tools/checkrom.py
        $(Q)strip $< -o $@
 
 $(OUT)bios.bin: $(OUT)bios.bin.elf
index 66985fd2bf94fc8af0e67db6c38160b8d1581dfd..095703fa25744517886138e71fa58e694338342d 100644 (file)
@@ -14,7 +14,13 @@ SECTIONS
         .text BUILD_BIOS_ADDR : {
                 code32_start = . ;
                 *(.text)
+
+                . = ALIGN(16) ;
+                code32_rodata = . ;
                 *(.rodata*)
+
+                . = ALIGN(16) ;
+                code32_data = . ;
                 *(.data)
                 code32_end = . ;
 
index 6eda341b6512485c18dce646b0ac757dd0020603..032783b6098e0c4ea64bfb1db1f7481aa8da2fd5 100755 (executable)
@@ -17,8 +17,11 @@ def main():
         except:
             pass
 
-    if syms['code16_start'] != syms['_code32_code16_start']:
-        print "Error!  16bit code moved during linking"
+    c16s = syms['code16_start']
+    c32s = syms['_code32_code16_start']
+    if c16s != c32s:
+        print "Error!  16bit code moved during linking (0x%x vs 0x%x)" % (
+            c32s, c16s)
         sys.exit(1)
 
     size16 = syms['code16_end'] - syms['code16_start']