This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Problems with the 2003-01-23 patch (was Re: [PATCH] Fix s390 as)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Alan Modra <amodra at bigpond dot net dot au>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 12 Feb 2003 12:23:10 +0100
- Subject: Problems with the 2003-01-23 patch (was Re: [PATCH] Fix s390 as)
- References: <20030122234151.GY949@bubble.sa.bigpond.net.au> <Pine.BSF.4.44.0301221953500.94131-100000@dair.pair.com> <20030123014717.GZ949@bubble.sa.bigpond.net.au> <20030123125159.GC949@bubble.sa.bigpond.net.au>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Jan 23, 2003 at 11:21:59PM +1030, Alan Modra wrote:
> This should fix the bug shown by Jakub's s390 testcase in a way that
> preserves old behaviour regarding subtraction expressions.
Unfortunately, it seems to break things on various platforms
(those which define their own TC_FORCE_RELOCATION).
Say on Alpha
.text
1: lda $15,-128($15)
.text 1
2: ldgp $29,2b-1b($27)
causes
Fatal error: internal error? cannot generate `BFD_RELOC_ALPHA_GPDISP' relocation
(this is distilled from much bigger assembly which actually did not change
subsections in between the two labels, just a fragment break happened to
be in between the two instructions (only on Alpha, not on i686->Alpha cross)
and thus expr did not optimize that into constant 4.
As alpha_force_relocation returns 1 for BFD_RELOC_ALPHA_GPDISP_HI16,
TC_FORCE_RELOCATION_SUB_SAME was 1, later on TC_FORCE_RELOCATION_SUB_LOCAL
was 0 and thus BFD_RELOC_ALPHA_GPDISP_HI16 was turned into PC relative
gpdisp16 relocation which tc-alpha.c then complained about.
Dunno if it is better to handle subtraction of two local labels in the same
section in the generic TC_FORCE_RELOCATION_SUB_SAME implementation (and in
the unlikely case some machine wants to override that behaviour, it could
define its own TC_FORCE_RELOCATION_SUB_SAME), or call some new function
in each arch_force_relocation before checking relocation type.
Jakub