NetBSD-Bugs archive

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

port-macppc/52564: current ofwboot.xcf crashes because of .eh_frame* in .text



>Number:         52564
>Category:       port-macppc
>Synopsis:       current ofwboot.xcf crashes because of .eh_frame* in .text
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    port-macppc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 20 17:30:00 +0000 2017
>Originator:     scole_mail
>Release:        current
>Organization:
none
>Environment:
NetBSD pm7500 8.99.2 NetBSD 8.99.2 (GENERIC-$Revision: 1.15 $) #0: Wed Sep 20 09:57:58 PDT 2017  scole@dstar:/home/scole/nbsd/cvs/src/sys/arch/macppc/compile/obj/GENERIC_601 macppc
>Description:
current ofwboot.xcf is crashing on my powermac 7500:

0 > boot file: 10.0.0.1,ofwboot.xcfloading XCOFF
 tsize=10000 dsize=258 bsize=2750 entry=E00000 
 SECTIONS:
 .text    00E00000 00E00000 00010000 00001000
 .data    00E10000 00E10000 00000258 00011000
 .bss     00E10258 00E10258 00002750 00000000
 .gnu.att 00000000 00000000 00000010 00011258
 .ident   00000000 00000000 00000076 00011268
 loading .textDEFAULT CATCH!, code=FFF00300 
  ok

 7.1 worked fine for me though:
 0 > boot file: 10.0.0.1,ofwboot.xcfloading XCOFF
 tsize=EF00 dsize=250 bsize=2750 entry=E00000 
 SECTIONS:
 .eh_fram 00000074 00000074 00002218 0000014C
 .text    00E00000 00E00000 0000EF00 00002370
 .data    00E0F000 00E0F000 00000250 00011270
 .bss     00E0F250 00E0F250 00002750 00000000
 .gnu.att 00000000 00000000 00000010 000114C0
 .ident   00000000 00000000 00000076 000114D0
 loading .text, done..
 loading .data, done..
 clearing .bss, done..

It seems the issue is caused by rev 1.4 in elf32_powerpc_merge.x
https://nxr.netbsd.org/history/src/sys/arch/macppc/stand/fixcoff/elf32_powerpc_merge.x
which put
 *(.eh_frame_hdr)
 *(.eh_frame)
in the .text section. 

I'm not exactly sure why 7.1 worked and .eh_frame is at 0x74, that seems unnatural, maybe some ld or fixcoff issue.  But with the patch below, my machine booted fine and sections appear in a reasonable order:

0 > boot file: 10.0.0.1,ofwboot.xcfloading XCOFF
tsize=F6C0 dsize=260 bsize=2750 entry=E00000 
SECTIONS:
.text    00E00000 00E00000 0000F6C0 00001000
.eh_fram 00E0F6BC 00E0F6BC 00002940 000106C0
.data    00E12000 00E12000 00000260 00013000
.bss     00E12260 00E12260 00002750 00000000
.gnu.att 00000000 00000000 00000010 00013260
.ident   00000000 00000000 00000076 00013270
loading .text, done..
loading .data, done..
clearing .bss, done..

If this change seems safe and won't break other machines, let me know and I'll commit it myself.

Thanks

>How-To-Repeat:
boot with ofwboot.xcf from current.

my machine is openfirmware 1.0.5, maybe more recent versions don't have the same problem.
>Fix:


Summary of changes:  (A/? = New, R/D = Removed, M = Modified)
=============================================================
M elf32_powerpc_merge.x

Apply patch with "cd .../src/sys/arch/macppc/stand/fixcoff ; patch -s -p0 < .../patchfile"

Index: elf32_powerpc_merge.x
===================================================================
RCS file: /cvsroot/src/sys/arch/macppc/stand/fixcoff/elf32_powerpc_merge.x,v
retrieving revision 1.4
diff -b -u -r1.4 elf32_powerpc_merge.x
--- elf32_powerpc_merge.x       20 Apr 2017 18:53:12 -0000      1.4
+++ elf32_powerpc_merge.x       20 Sep 2017 17:14:43 -0000
@@ -32,9 +32,14 @@
     *(.rodata.*)
     *(.rodata1)
     *(.got1)
+  }
+
+  .eh_frame :
+   {
     *(.eh_frame_hdr)
     *(.eh_frame)
   }
+
   .fini      : { *(.fini)    } =0
   .ctors     : { *(.ctors)   }
   .dtors     : { *(.dtors)   }



Home | Main Index | Thread Index | Old Index