[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gas/31889] gas confuses operand types for tbz/tbnz/adrp (accepts il
From: |
rearnsha at sourceware dot org |
Subject: |
[Bug gas/31889] gas confuses operand types for tbz/tbnz/adrp (accepts illegal syntax) |
Date: |
Tue, 07 Jan 2025 18:07:34 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=31889
Richard Earnshaw <rearnsha at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
CC| |rearnsha at sourceware dot org
Last reconfirmed| |2025-01-07
Status|UNCONFIRMED |NEW
--- Comment #1 from Richard Earnshaw <rearnsha at sourceware dot org> ---
Labels are just constants that get assigned by the assembler. But the bigger
problem here is that we silently convert an absolute value into something PC
relative and that's clearly incorrect:
If I run your testcase through "objdump -dr", I see:
0000000000000000 <.text>:
0: 36080020 tbz w0, #1, 4 <.text+0x4>
4: 37080020 tbnz w0, #1, 8 <.text+0x8>
8: 90000000 adrp x0, 0 <.text>
8: R_AARCH64_ADR_PREL_PG_HI21 *ABS*+0x4
So the first two instructions have clearly been assembled incorrectly, but the
third is (technically) correct in that has a pc-relative relocation relative to
the absolute section (whether or not that's what the user really intended is
somewhat tangential).
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gas/31889] gas confuses operand types for tbz/tbnz/adrp (accepts illegal syntax),
rearnsha at sourceware dot org <=