[PATCH] D114340: [COFF] [ARM64] Create symbols with regular intervals for relocations against temporary symbols

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 21 14:27:39 PST 2021


mstorsjo created this revision.
mstorsjo added reviewers: rnk, efriedma.
Herald added subscribers: hiraditya, kristof.beyls.
mstorsjo requested review of this revision.
Herald added a project: LLVM.

For relocations against temporary symbols (that don't persist in
the object file), we normally adjust them to reference the start of
the section.

For adrp relocations, the immediate offset from the referenced
symbol is stored in the opcode as the 21 bit signed immediate; this
means that the symbol referenced must be within +/- 1 MB from the
referenced symbol.

Create label symbols with regular intervals (1 MB intervals). For
relocations against temporary symbols, pick the preceding added
offset symbol and make the relocation against that instead of
against the start of the section.

This should fix the root issue behind
https://bugs.llvm.org/show_bug.cgi?id=52378.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114340

Files:
  llvm/lib/MC/WinCOFFObjectWriter.cpp
  llvm/test/MC/AArch64/coff-relocations-offset.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114340.388771.patch
Type: text/x-patch
Size: 6340 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211121/45fdf69d/attachment.bin>


More information about the llvm-commits mailing list