This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [Patch]: Re: gas 2.10.91 from 20000920 cvs is broken under hpux


> On Sun, 24 Sep 2000, John David Anglin wrote:
> 
> > The fix for the problem is to change arg_reloc_stub_needed so that stubs
> > are generated for recursive calls.
> 
> This might cure the problem, but I don't think it's correct.  CALLEE !=
> CALLER in arg_reloc_stub_needed really means the callers idea of which
> registers to use to pass parameters and return values, differs from the
> actual registers used by the called function (which is why you need an
> arg reloc stub).

I shouldn't stay up so late trying to fix these things!  I think that
arg_reloc_stub_needed macro may not be doing the right thing and that
this has been hiding the problem to some extent.

When the function `int f(char *p)' is called recursively, I see the following
in md_apply_fix when the function is called:

Breakpoint 1, md_apply_fix (fixP=0x40026f10, valp=0x7b03ab84)
    at ./config/tc-hppa.c:4412
4412          if ((fmt == 12 || fmt == 17 || fmt == 22)
(gdb) p fixP->fx_pcrel
$3 = 1
(gdb) p (((obj_symbol_type *) symbol_get_bfdsym (fixP->fx_addsy))->tc_data.ap.hppa_arg_reloc)
$4 = 257
(gdb) p hppa_fixP->fx_arg_reloc
$5 = 256

It doesn't see right that a simple function such as the one above should
need an argument relocation stub.  If I change the return type to void, then
both values are 256 and no stub is needed.   I haven't been able to 
find where the bits for fx_arg_reloc are defined.  Does this seem right?

> I've been playing a little with the following, which isn't yet ready
> to install mainly because I noticed a few other things along the way, and
> it's gotten too late here for me to think straight..

It definitely looks like your on the right track here.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]