Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/luna68k/stand/boot Add proper padding to text secti...



details:   https://anonhg.NetBSD.org/src/rev/7c1914131bcc
branches:  trunk
changeset: 784350:7c1914131bcc
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Jan 26 16:00:04 2013 +0000

description:
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).

diffstat:

 sys/arch/luna68k/stand/boot/boot.ldscript |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (22 lines):

diff -r d9cb5e2f4b9f -r 7c1914131bcc sys/arch/luna68k/stand/boot/boot.ldscript
--- a/sys/arch/luna68k/stand/boot/boot.ldscript Sat Jan 26 15:52:59 2013 +0000
+++ b/sys/arch/luna68k/stand/boot/boot.ldscript Sat Jan 26 16:00:04 2013 +0000
@@ -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 @@
     *(.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 = .);



Home | Main Index | Thread Index | Old Index