NetBSD-Bugs archive

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

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



The following reply was made to PR port-macppc/52564; it has been noted by GNATS.

From: Valery Ushakov <uwe%stderr.spb.ru@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: port-macppc/52564: current ofwboot.xcf crashes because of
 .eh_frame* in .text
Date: Sun, 1 Oct 2017 02:36:59 +0300

 On Mon, Sep 25, 2017 at 18:40:01 +0000, scole_mail wrote:
 
 >  Valery Ushakov <uwe%stderr.spb.ru@localhost> writes:
 >  
 >  >  Ok, just to be clear, the timeline here seems to be:
 >  >  
 >  >  1) my commit to elf32_powerpc_merge.x to merge .eh_frame* to .text
 >  >  2) my commit to ../Makefile.inc to disable .eh_frame generation
 >  >  3) christos@ commit to keep .eh_frame section
 >  >  4) commenting out unwind-related flags in ../Makefile.inc
 >  >  
 >  
 >  I think that is correct. Just for testing, I added these cases
 >  
 >     0) before any of 1-4 changes
 >     5) what's in current as of today
 [...]
 >  So I went through and built all the cases and saved of the obj/ dirs.
 >  If you want to look at them, let me know and I'll upload them somewhere.
 >  
 >  None of the cases boot now except for 4)
 [...]
 >  4/obj/ofwboot.xcf:     file format aixcoff-rs6000
 >  
 >  Sections:
 >  Idx Name          Size      VMA       LMA       File off  Algn
 >    0 .text         0000f6e0  00e00000  00e00000  00001000  2**3
 >                    CONTENTS, ALLOC, LOAD, CODE
 >    1 .eh_fram      00002920  00e0f6dc  00e0f6dc  000106e0  2**3
 >                    CONTENTS, ALLOC, LOAD, DATA
 >    2 .data         00000258  00e12000  00e12000  00013000  2**3
 >                    CONTENTS, ALLOC, LOAD, DATA
 >    3 .bss          00002750  00e12258  00e12258  00000000  2**3
 >                    ALLOC
 
 My uneducated guess is that this has nothing to do with .eh_frame
 
 The .eh_frame just makes .text section not padded up artificially and
 absorbs that padding instead.
 
 Please, can you try this patch?  Compile tested only and more of a
 shot in the dark.
 
 Index: elf32_powerpc_merge.x
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/macppc/stand/fixcoff/elf32_powerpc_merge.x,v
 retrieving revision 1.5
 diff -u -p -u -r1.5 elf32_powerpc_merge.x
 --- elf32_powerpc_merge.x	20 Sep 2017 18:44:22 -0000	1.5
 +++ elf32_powerpc_merge.x	30 Sep 2017 23:29:32 -0000
 @@ -32,9 +32,6 @@ SECTIONS
      *(.rodata.*)
      *(.rodata1)
      *(.got1)
 -  }
 -  .eh_frame  :
 -  {
      *(.eh_frame_hdr)
      *(.eh_frame)
    }
 @@ -43,6 +40,7 @@ SECTIONS
    .dtors     : { *(.dtors)   }
    _etext = .;
    PROVIDE (etext = .);
 +  .pad       : { LONG(0) }
    /* Read-write section, merged into data segment: */
    . = (. + 0x0FFF) & 0xFFFFF000;
    .data    :
 
 
 With it I get:
 
 Idx Name          Size      VMA       LMA       File off  Algn
   0 .text         0000f6e0  00e00000  00e00000  00001000  2**3
                   CONTENTS, ALLOC, LOAD, CODE
   1 .pad          00000920  00e0f6dc  00e0f6dc  000106e0  2**3
                   CONTENTS
   2 .data         00000258  00e10000  00e10000  00011000  2**3
                   CONTENTS, ALLOC, LOAD, DATA
   3 .bss          00002750  00e10258  00e10258  00000000  2**3
                   ALLOC
 
 so this should be equivalent to the 4) above.
 
 -uwe
 


Home | Main Index | Thread Index | Old Index