Subject: Re: Self build error
To: None <thorpej@wasabisystems.com>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: port-dreamcast
Date: 01/27/2003 03:23:14
In article <200301242232.h0OMWg800801@mirage.ceres.dti.ne.jp>
I wrote:

> In article <20030124215106.GB8538@yeah-baby.shagadelic.org>
> thorpej@wasabisystems.com wrote:
> 
> > On Sat, Jan 25, 2003 at 05:45:27AM +0900, Izumi Tsutsui wrote:
> >  > The following patch seems to fix the problem.
> >  > (though I don't know gas statements..)
> > 
> > I'm a little confused as to why the globl is needed ... it's supposed
> > to be calling a non-global (static) function...
> 
> I know all functions used in the macro declared as static, but
> without .globl, MD_CALL_STATIC_FUNCTION(.init, __do_global_[cd]tors_aux)
> jumps __ctors() (first function?), not __do_global_[cd]tors_aux().

It seems SH bfd relocation bug. I applied the following diff:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/elf32-sh.c.diff?r1=1.35&r2=1.36&cvsroot=src
to toolchain/bfd/elf32-sh.c, and it changes the behavoir a bit,
but it still sets wrong address.
(no longer points __ctors(), but offset -8 bytes from
 __do_global_[cd]tors_aux()).

I'll punt this to bfd guys..
---
Izumi Tsutsui
tsutsui@ceres.dti.ne.jp