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]

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


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