[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gas/30788] New: gas aarch64: GOT relocations referencing a local sy
From: |
i at maskray dot me |
Subject: |
[Bug gas/30788] New: gas aarch64: GOT relocations referencing a local symbol should not be changed to reference STT_SECTION |
Date: |
Wed, 23 Aug 2023 03:33:47 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=30788
Bug ID: 30788
Summary: gas aarch64: GOT relocations referencing a local
symbol should not be changed to reference STT_SECTION
Product: binutils
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: gas
Assignee: unassigned at sourceware dot org
Reporter: i at maskray dot me
Target Milestone: ---
Extracted from https://github.com/llvm/llvm-project/issues/63418
```
cat > a.s <<EOF
ldr x1, [x1, :got_lo12:x] // converted to .data+0
ldr x1, [x1, :got_lo12:y] // converted to .data+4
.data
// .globl x, y would suppress STT_SECTION conversion
x:
.zero 4
y:
.long 42
aarch64-linux-gnu-gcc -c a.s
```
The two R_AARCH64_LD64_GOT_LO12_NC relocations are converted to reference the
STT_SECTION symbol .data .
After linking, they will share the same GOT entry (GNU ld and ld.lld use just
the symbol to decide an entry, not symbol plus addend), which is not expected.
I think this is a neglection for AArch64. For most targets (including AArch32,
x86, PowerPC, and RISC-V) local symbol to STT_SECTION conversion is suppressed
for GOT-generating relocations.
https://github.com/ARM-software/abi-aa/issues/217 is created to decide how we
should create GOT entries, GDAT(S+A) vs GDAT(S).
If the decision is to respect existing linker behaviors and allow the same GOT
entry for :got_lo12:(.data+0) and :got_lo12:(.data+4),
this assembler change is IMO a prerequisite.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gas/30788] New: gas aarch64: GOT relocations referencing a local symbol should not be changed to reference STT_SECTION,
i at maskray dot me <=