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]

Re: [PATCH] Fix s390 as


On Wed, Jan 22, 2003 at 08:01:22PM -0500, Hans-Peter Nilsson wrote:
> On Thu, 23 Jan 2003, Alan Modra wrote:
> 
> > On Wed, Jan 22, 2003 at 11:39:36PM +1030, Alan Modra wrote:
> > > #define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG)	\
> > >   (! SEG_NORMAL (SEG) || TC_FORCE_RELOCATION (FIX))
> >
> > Breaks gas/testsuite/gas/cris/binop-segref.s
> 
> I'm not totally sure about the test-case.  It includes
> subtraction of two global symbols.  This *is* actually fine
> provided they are *not* supposed to be overridden by other
> objects (as expected when producing a DSO).
> 
> I think the globalness of a subtractive symbol was deemed to be
> ignored for a similar case for x86 some time ago, which leaves
> the globalness of the additive symbol, which isn't changed into
> a PC-relative reloc for CRIS, but instead an error case.

Hmm, you named the tests using binop-segref.s:

FAIL: gas/cris/rd-dw2-2
FAIL: False broken words

which leads me to suspect this construct is used when emitting
dwarf debug info, at least in some versions of gcc.

I'm inclined to say the test is correct.  On one hand we have ELF
symbol overriding to consider, but on the other hand can an expression
like sym1 - sym2, with both syms in the same section and no relocation
specifiers really have any sensible meaning other than the value
calculated using known symbol values?

To allow these expressions to resolve, we can tweak all the target
force_relocation routines to test for relocs, then call S_FORCE_RELOC
only when fx_subsy is 0.  Sound reasonable?

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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