This is the mail archive of the binutils@sourceware.org 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] New ia64 @slotcount pseudo func (2nd try)


On Thu, Oct 29, 2009 at 12:08:20AM -0700, Douglas B Rupp wrote:
> I tried to address all your concerns, but I didn't understand the  
> comment about checking for a comma.

You have a separator of some sort between the symbols.  Hmm, from
previous posts I see you expect an expression of the form end-beg, and
in fact if I'd read the comment I'd have seen that too.  :-)
Actually @slotinfo(end-beg) strikes me as a little odd.  You aren't
calculating a function of a single variable, so I think it would parse
better as @slotinfo(end,beg).

> +	    end = S_GET_VALUE (symbolPend);
> +	    beg = S_GET_VALUE (symbolPbeg);

I missed noticing this first time around, but there are some missing
checks here.  Presumably you will only support references to symbols
that are defined, so you should use symbol_find rather than
symbol_find_or_make, and add the following check.

if (symbolPend == NULL
    || symbolPbeg == NULL
    || !S_IS_DEFINED (symbolPend)
    || !S_IS_DEFINED (symbolPbeg)
    || S_GET_SEGMENT (symbolPend) != S_GET_SEGMENT (symbolPbeg)
    || !frag_offset_fixed_p (symbol_get_frag (symbolPend),
			     symbol_get_frag (symbolPbeg),
			     &frag_off))
  as_bad (some_error_message);

You'll also need to adjust your "end" value by frag_off.  At this
stage of assembly, symbol values are offsets within their frags.  The
two symbols may be in different frags.  I hope ia64 gas always creates
insn frags that are multiples of 16 in size.  If it doesn't then you
can't resolve the expression..

-- 
Alan Modra
Australia Development Lab, IBM


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