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]
Other format: [Raw text]

Problems with the 2003-01-23 patch (was Re: [PATCH] Fix s390 as)


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


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