Sat Jan 26 16:00:04 2013 UTC ()
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).


(tsutsui)
diff -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/boot.ldscript

cvs diff -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/boot.ldscript (expand / switch to unified diff)

--- src/sys/arch/luna68k/stand/boot/boot.ldscript 2013/01/20 02:35:13 1.4
+++ src/sys/arch/luna68k/stand/boot/boot.ldscript 2013/01/26 16:00:04 1.5
@@ -1,27 +1,31 @@ @@ -1,27 +1,31 @@
1/* $NetBSD: boot.ldscript,v 1.4 2013/01/20 02:35:13 tsutsui Exp $ */ 1/* $NetBSD: boot.ldscript,v 1.5 2013/01/26 16:00:04 tsutsui Exp $ */
2 2
3OUTPUT_FORMAT("elf32-m68k") 3OUTPUT_FORMAT("elf32-m68k")
4OUTPUT_ARCH(m68k) 4OUTPUT_ARCH(m68k)
5ENTRY(start) 5ENTRY(start)
6SECTIONS 6SECTIONS
7{ 7{
8 /* Read-only sections, merged into text segment: */ 8 /* Read-only sections, merged into text segment: */
9 .text : 9 .text :
10 { 10 {
11 *(.text) 11 *(.text)
12 *(.text.*) 12 *(.text.*)
13 *(.rodata) *(.rodata.*) 13 *(.rodata) *(.rodata.*)
14 . = ALIGN(4); 14 /* The data and bss sections are 8 byte aligned on ELF format,
 15 but a.out header doesn't have section addresses and only
 16 contains size values, so we have to pad size of text section
 17 to make data section get aligned even after elf2aout. */
 18 . = ALIGN(8);
15 } =0 19 } =0
16 PROVIDE (__etext = .); 20 PROVIDE (__etext = .);
17 PROVIDE (_etext = .); 21 PROVIDE (_etext = .);
18 PROVIDE (etext = .); 22 PROVIDE (etext = .);
19 .data : 23 .data :
20 { 24 {
21 __data_start = . ; 25 __data_start = . ;
22 *(.data) 26 *(.data)
23 *(.data.*) 27 *(.data.*)
24 *(.sdata) 28 *(.sdata)
25 *(.sdata.*) 29 *(.sdata.*)
26 } 30 }
27 _edata = .; 31 _edata = .;