This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
pc-relative symbol resolution bug
- From: Richard Henderson <rth at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Thu, 29 Aug 2002 10:55:11 -0700
- Subject: pc-relative symbol resolution bug
The following test case:
.section .rodata
A:
.align 4
.long B-.+(.-A)
.text
B:
results in
z.s:4: Error: invalid section for operation
This only happens when (.-A) spans two fragments, and
thus cannot be ireduced to a constant by expr.
This affects large x86-64 switch statements, as currently
emitted by gcc. I have a work-around, which is to form
the expression as
.long B+(.-A)-.
instead. Seems to me that both forms ought to work, but
it looks decidedly wicked to attempt with the current
order of evaluation within gas.
r~