Module Name:    src
Committed By:   tsutsui
Date:           Sat Jan 26 16:00:04 UTC 2013

Modified Files:
        src/sys/arch/luna68k/stand/boot: boot.ldscript

Log Message:
Add proper padding to text section for elf2aout conversion.

The data and bss sections are 8 byte aligned on m68k ELF format,
but a.out header doesn't have section addresses and only
contains size values, so we have to pad size of text section
to make data section get aligned even after elf2aout.

Note elf2aout merges ELF data section into a.out text section
if binary is OMAGIC (i.e. text is writable too) so only
BSS section address was affected (and was almost harmless).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/boot.ldscript

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/luna68k/stand/boot/boot.ldscript
diff -u src/sys/arch/luna68k/stand/boot/boot.ldscript:1.4 src/sys/arch/luna68k/stand/boot/boot.ldscript:1.5
--- src/sys/arch/luna68k/stand/boot/boot.ldscript:1.4	Sun Jan 20 02:35:13 2013
+++ src/sys/arch/luna68k/stand/boot/boot.ldscript	Sat Jan 26 16:00:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.ldscript,v 1.4 2013/01/20 02:35:13 tsutsui Exp $	*/
+/*	$NetBSD: boot.ldscript,v 1.5 2013/01/26 16:00:04 tsutsui Exp $	*/
 
 OUTPUT_FORMAT("elf32-m68k")
 OUTPUT_ARCH(m68k)
@@ -11,7 +11,11 @@ SECTIONS
     *(.text)
     *(.text.*)
     *(.rodata) *(.rodata.*)
-    . = ALIGN(4);
+    /* The data and bss sections are 8 byte aligned on ELF format,
+       but a.out header doesn't have section addresses and only
+       contains size values, so we have to pad size of text section
+       to make data section get aligned even after elf2aout. */
+    . = ALIGN(8);
   } =0
   PROVIDE (__etext = .);
   PROVIDE (_etext = .);

Reply via email to