This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Computing .long .L123-.L100
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: binutils at sources dot redhat dot com
- Date: Wed, 21 Jan 2004 15:02:54 -0500 (EST)
- Subject: Computing .long .L123-.L100
Hi,
I have a question about computing the difference of two labels at
assembly time. Does gas/tc-<target>.c have to do something special?
I thought defining DIFF_EXPR_OK would do the job, but it doesn't seem
to.
Is a difference of two labels computed as soon as the values of both
labels become available? While assembling the following piece of code
on sh-elf, which does support the difference of two labels, I found
that the value of .L3-.L9 seems to be computed from colon () in
symbols.c.
.text
.global _foo
.type _foo, @function
_foo:
nop
nop
.L9:
.long .L3-.L9
nop
.L3:
nop
Another related question is that sh_cons_fix_new() outputs a reloc for
.long .L3-.L9., but the disassembly of the resulting object file does
not contain the reloc anymore. Where is such a reloc deleted?
Thanks in advance,
Kazu Hirata