https://sourceware.org/bugzilla/show_bug.cgi?id=20364
Bug ID: 20364 Summary: Data-based padding causes current address evaluation to be non-constant on aarch64 Product: binutils Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: gas Assignee: unassigned at sourceware dot org Reporter: contact at paulk dot fr Target Milestone: --- It appears that starting with binutils 2.26, evaluating the current address (using the dot symbol) after a .align directive using data-based padding (e.g. .align 6, 0) makes it non-constant, resulting in errors such as: "Error: non-constant expression in ".if" statement" when evaluating "." inside an .if statement. This is on aarch64. The issue appeared when build the ARM Trusted Firmware: https://github.com/ARM-software/arm-trusted-firmware The related assembly is a combination of the vector_entry/vector_base (that does the alignment) and check_vector_size (that uses the dot symbol) macros, defined at: https://github.com/ARM-software/arm-trusted-firmware/blob/master/include/common/asm_macros.S#L69 and used at https://github.com/ARM-software/arm-trusted-firmware/blob/master/bl31/aarch64/runtime_exceptions.S#L171 The assembly is correct and is apparently not the problem. However, switching the ".align x, 0" directives to ".align x" solves the issue, but upstream is not going to make that change. The issue was discussed in depth at https://www.mail-archive.com/linaro-toolchain@lists.linaro.org/msg05685.html and an issue was opened on the ARM Trusted Firmware tracker at https://github.com/ARM-software/tf-issues/issues/401 A test case was provided at https://www.mail-archive.com/linaro-toolchain@lists.linaro.org/msg05688/tmp.s The issue was bisected down to (bad) commit c1baaddf8861aea666b84baeb4746caff51a579d commit c1baaddf8861aea666b84baeb4746caff51a579d Author: Renlin Li <renlin...@arm.com> Date: Thu Apr 2 14:59:45 2015 +0100 [AArch64] Emit DATA_MAP in order within text section 2015-03-27 Renlin Li <renlin...@arm.com> gas/ * config/tc-aarch64.c (mapping_state): Emit MAP_DATA within text section in order. (mapping_state_2): Don't emit MAP_DATA here. (s_aarch64_inst): Align frag during state transition. (md_assemble): Likewise. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils