gcl-devel
[Top][All Lists]
Advanced

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

Re: [Gcl-devel] Re: BFD relocations


From: Camm Maguire
Subject: Re: [Gcl-devel] Re: BFD relocations
Date: 05 Jun 2002 19:03:51 -0400

Greetings!  Many thanks again!

This works without problem!  Hooray!

1) Is it possible to know for sure that a smaller range could be
   flushed safely?
2) Any other machines supported by binutils which require similar
   flushing?  Assembly instructions?
3) Separately, do you know what the alignment requirements are for
   sparc32 user code on a sparc64 system?  I'm getting a SIGBUS on
   Debian sparc, but the relevant addresses seem to be aligned on 8
   byte boundaries, which I thought should be plenty.

Thanks again!

Daniel Jacobowitz <address@hidden> writes:

> On Tue, Jun 04, 2002 at 06:06:18PM -0400, Camm Maguire wrote:
> > Greetings!
> > 
> > Daniel Jacobowitz <address@hidden> writes:
> > 
> > > On Tue, Jun 04, 2002 at 05:33:57PM -0400, Camm Maguire wrote:
> > > > Greetings. and thank you again for your reply!
> > > > 
> > > > In brief, I can relocate, but I get SIGILL on apparently correctly
> > > > relocated code when trying to execute.
> > > > 
> > > > I would be very appreciative if you might save me the pain of
> > > > searching through the kernel sources and brief me on what raises
> > > > SIGILL on ppc.  I'm already aware of divide by zero, and of course an
> > > > unknown opcode, but neither seems to be the case here.  Alignment?
> > > 
> > > Cache.  Are you explicitly flushing the data and instruction caches
> > > over the entire loaded range?  If not, you absolutely should try that.
> > > 
> > 
> > Thanks for this suggestion!  I'm afraid I'm a neophyte wrt cache
> > flushing.  Is there a specific assembly instruction I should add, or
> > do I flush via a read through the .text and .(s)data sections, or a
> > copy to some distant memory? 
> 
> You need to do a dcbst (and an icbi for safety) on every cache line. 
> That's every 32 bytes on a mainstream PPC processor (16 on the 8xx's
> and 64 on the POWER4s).  Like:
>   asm ("dcbst 0,%0\n\tsync\n\ticbi 0,%0\n\tsync\n\tisync"
>       : : "r" (ptr) : "memory");
> That's more paranoid than you need to be, I think, but should work.
> 
> > 
> > Thanks again!
> > 
> > > > Detail:
> > > > 
> > > > gcl builds fine on ppc with bfd relocations, including gcl-tk.  When
> > > > building maxima-5.6 with it, which involves loading several object
> > > > files, I've gotten SIGILL in the following two places when executing
> > > > code from kclmac.o:
> > > > 
> > > > objdump -d kclmac.o |head -40l
> > > > 
> > > > kclmac.o:     file format elf32-powerpc
> > > > 
> > > > Disassembly of section .text:
> > > > 
> > > > 00000000 <init_kclmac>:
> > > > ->   0: 94 21 ff f0     stwu    r1,-16(r1)
> > > >    4:   7c 08 02 a6     mflr    r0
> > > >    8:   90 01 00 14     stw     r0,20(r1)
> > > >    c:   3c 60 00 00     lis     r3,0
> > > >   10:   38 63 00 00     addi    r3,r3,0
> > > >   14:   4c c6 31 82     crclr   4*cr1+eq
> > > >   18:   48 00 00 01     bl      18 <init_kclmac+0x18>
> > > >   1c:   80 01 00 14     lwz     r0,20(r1)
> > > > ->  20: 7c 08 03 a6     mtlr    r0
> > > >   24:   38 21 00 10     addi    r1,r1,16
> > > >   28:   4e 80 00 20     blr
> > > > 
> > > > 0000002c <L1>:
> > > >   2c:   94 21 ff e0     stwu    r1,-32(r1)
> > > >   30:   7c 08 02 a6     mflr    r0
> > > 
> > > Those two spots are both apparently undistinguished, and 32 bytes
> > > apart.  Coincidence?  I think not.
> > > 
> > > 
> > > -- 
> > > Daniel Jacobowitz                           Carnegie Mellon University
> > > MontaVista Software                         Debian GNU/Linux Developer
> > > 
> > > 
> > 
> > -- 
> > Camm Maguire                                                address@hidden
> > ==========================================================================
> > "The earth is but one country, and mankind its citizens."  --  Baha'u'llah
> > 
> 
> -- 
> Daniel Jacobowitz                           Carnegie Mellon University
> MontaVista Software                         Debian GNU/Linux Developer
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah



reply via email to

[Prev in Thread] Current Thread [Next in Thread]