Open andreyv opened 6 years ago
Still reproducible with clang version 9.0.0 (tags/RELEASE_900/final)
.
Looks like only adds
and subs
are affected, and only the variants which set condition flags. This also reproduces the issue:
adds r0, #(.-.)
But all these are good:
.byte .-.
adds r0, #1
add r0, #(.-.)
ands r0, #(.-.)
movs r0, #(.-.)
rsbs r0, r0, #(.-.)
Another bad sample:
adds r0, #.
generates a random immediate without any relocations.
Extended Description
Assembling the following source:
with
clang -fintegrated-as -target armv7-none-linux-androideabi16 -c x.s
produces, for example,where the immediate value varies with each run.
This seems to affect any expression with addresses, e.g.,
(.-.)
,(.-.L0)
etc. The+1
is there just for non-zero expected output.clang --version
: