This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: TC_FORCE_RELOCATION_SECTION macro
- To: Alan Modra <alan at linuxcare dot com dot au>
- Subject: Re: TC_FORCE_RELOCATION_SECTION macro
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Thu, 14 Sep 2000 08:38:35 -0600
- cc: binutils at sourceware dot cygnus dot com
- Reply-To: law at cygnus dot com
In message <Pine.LNX.4.21.0009150051250.14452-100000@front.linuxcare.com.au>y
ou write:
> Hi,
> I want to commit the following to have hppa-elf emit relocations for
> extern or weak syms, but before I do so, I'd like to have some
> feedback/comments on TC_FORCE_RELOCATION_SECTION.
>
> It looks to me like TC_FORCE_RELOCATION_SECTION has suffered bit-rot since
> Michael Meissner added it for ppc. Currently, the macro is invoked from
> just one place in gas/write.c, and it happens to be where we are
> subtracting two symbols. TC_FORCE_RELOCATION_SECTION is only defined
> by tc-i370.h, where it seems totally bogus, and by tc-ppc.h. The tc-ppc.h
> definition is where I suspect bit-rot has occurred, as it's equivalent to
> TC_FORCE_RELOCATION since (FIXP)->fx_subsy is non-zero.
>
> So.. a) Does the tc-ppc.h definition need fixing?
> b) Would the macro be better named TC_FORCE_RELOCATION_SUBTRACT, so
> that someone doesn't have the bright idea of using it elsewhere in
> write.c and breaking my assumption in this patch that it's only
> called when subtracting two symbols in the same section.
>
>
> gas/ChangeLog
> * config/tc-hppa.h (TC_FORCE_RELOCATION_SECTION): Allow
> subtraction of two syms without emitting a relocation.
>
> * config/tc-hppa.c (hppa_force_relocation): Force relocations for
> global or weak symbols. Delete a FIXME handled a bit later.
At the least, this needs to be ELF specific as SOM requires the ability to
create relocations for sym1-sym2 expressions.
jeff