[all-commits] [llvm/llvm-project] 06d0d4: [COFF] [ARM64] Create symbols with regular interva...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Tue Nov 23 00:39:35 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 06d0d449d8555ae5f1ac33e8d4bb4ae40eb080d3
      https://github.com/llvm/llvm-project/commit/06d0d449d8555ae5f1ac33e8d4bb4ae40eb080d3
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-11-23 (Tue, 23 Nov 2021)

  Changed paths:
    M llvm/lib/MC/WinCOFFObjectWriter.cpp
    A llvm/test/MC/AArch64/coff-relocations-offset.s

  Log Message:
  -----------
  [COFF] [ARM64] Create symbols with regular intervals for relocations against temporary symbols

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.

Differential Revision: https://reviews.llvm.org/D114340


  Commit: 7c15da67614eca9272553ecfe8c1a0f6f68c134b
      https://github.com/llvm/llvm-project/commit/7c15da67614eca9272553ecfe8c1a0f6f68c134b
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-11-23 (Tue, 23 Nov 2021)

  Changed paths:
    M lld/COFF/Chunks.cpp
    M lld/test/COFF/arm64-relocs-imports.test

  Log Message:
  -----------
  [LLD] [COFF] Interpret the immediate in ARM64 adr/adrp relocations as signed 21 bit

This matches how MS link.exe interprets this relocation.

Differential Revision: https://reviews.llvm.org/D114347


  Commit: 4e5488afb27a64d12a76b770cc86bab8074e9c57
      https://github.com/llvm/llvm-project/commit/4e5488afb27a64d12a76b770cc86bab8074e9c57
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-11-23 (Tue, 23 Nov 2021)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
    M llvm/test/CodeGen/AArch64/win64-jumptable.ll

  Log Message:
  -----------
  [AArch64] [COFF] Move jump tables back to the readonly section

This essentially reverts f5884d255e78305d41c28c6e001a460ff83981d8
(D57277).

That commit was made as a workaround since LLVM back then didn't
support cross-section relative relocations (IMAGE_REL_ARM64_REL32)
in COFF for ARM64. Support for this was implemented later,
in d5c5cf5ce8d921fc8c5e1b608c298a1ffa688d37 (D99572) and
382c505d9cfca8adaec47aea2da7bbcbc00fc05c (D102217).

The commit that moved jump tables to the function section noted
that it woud be ideal to utilize IMAGE_REL_ARM64_REL32.

Differential Revision: https://reviews.llvm.org/D113576


  Commit: d703b922961e0d02a5effdd4bfbb23ad50a3cc9f
      https://github.com/llvm/llvm-project/commit/d703b922961e0d02a5effdd4bfbb23ad50a3cc9f
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-11-23 (Tue, 23 Nov 2021)

  Changed paths:
    M lld/COFF/Writer.cpp
    M lld/test/COFF/strtab-size.s
    M lld/test/COFF/symtab.test

  Log Message:
  -----------
  [LLD] [COFF] Omit section symbols and IMAGE_SYM_CLASS_LABEL from the PE symbol table

The section symbols aren't of much practical use when looking at
a linked image. This shrinks one observed mingw style unstripped
binary by 14%.

IMAGE_SYM_CLASS_LABEL is in spirit the same as a temporary assembler
label that isn't emitted on the object file level at all.

Differential Revision: https://reviews.llvm.org/D113866


Compare: https://github.com/llvm/llvm-project/compare/b2729fda60db...d703b922961e


More information about the All-commits mailing list