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]

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~


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