[all-commits] [llvm/llvm-project] c43bff: [AArch64] Add support for the SEH opcode for retur...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Wed Oct 12 01:07:59 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c43bff64e903f726d456ca27fd167b91198ae169
      https://github.com/llvm/llvm-project/commit/c43bff64e903f726d456ca27fd167b91198ae169
  Author: Martin Storsjö <martin at martin.st>
  Date:   2022-10-12 (Wed, 12 Oct 2022)

  Changed paths:
    M llvm/include/llvm/Support/Win64EH.h
    M llvm/lib/MC/MCWin64EH.cpp
    M llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
    M llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
    M llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.h
    M llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp
    M llvm/test/MC/AArch64/seh.s

  Log Message:
  -----------
  [AArch64] Add support for the SEH opcode for return address signing

This was documented upstream in
https://github.com/MicrosoftDocs/cpp-docs/pull/4202.

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


  Commit: afa6bb643fd4a691262f407c3ed477c5cb293529
      https://github.com/llvm/llvm-project/commit/afa6bb643fd4a691262f407c3ed477c5cb293529
  Author: Martin Storsjö <martin at martin.st>
  Date:   2022-10-12 (Wed, 12 Oct 2022)

  Changed paths:
    M llvm/lib/MC/MCWin64EH.cpp
    M llvm/test/MC/AArch64/seh-packed-unwind.s

  Log Message:
  -----------
  [MC] [Win64EH] Generate ARM64 packed unwind info with signed return addresses

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


  Commit: e75c87f22cf2adfd9b80536654414fb96b0110a9
      https://github.com/llvm/llvm-project/commit/e75c87f22cf2adfd9b80536654414fb96b0110a9
  Author: Martin Storsjö <martin at martin.st>
  Date:   2022-10-12 (Wed, 12 Oct 2022)

  Changed paths:
    M lld/MinGW/Driver.cpp
    M lld/test/MinGW/lib.test

  Log Message:
  -----------
  [LLD] [MinGW] Look for libs named "<libname>.lib" even with -static

This matches how ld.bfd works in practice; this fixes
https://github.com/mstorsjo/llvm-mingw/issues/305.

Adding a test for the new lib name combination that this allows, but
also adding a few negative tests for combinations that aren't
matched when -static is specified (because this change in itself
didn't break any of the existing tests either).

The logic in how ld.bfd looks for various libraries based on
an -l<libname> argument is rather complex; the
ldemul_open_dynamic_archive function looks for various combinations:
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=ld/emultempl/pep.em;h=e68d1e69f17ad73af065b6bed19ae89ded913172;hb=b51c2fec1da205ea3e7354cbb3e253018d64873c#l2066
This function is only called if looking for dynamic libraries
(i.e. if -static wasn't specified):
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=ld/ldfile.c;h=731ae5f7aedcf921bd36a1b32a3e0f5bfa189071;hb=b51c2fec1da205ea3e7354cbb3e253018d64873c#l365

However even this function is skipped, it still looks for libraries
in the form of "lib<libname>.a" (this is what lld did before):
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=ld/ldfile.c;h=731ae5f7aedcf921bd36a1b32a3e0f5bfa189071;hb=b51c2fec1da205ea3e7354cbb3e253018d64873c#l440
But it also calls a format specific function called
ldemul_find_potential_libraries, which for PE targets looks for
files named "<libname>.lib":
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=ld/emultempl/pep.em;h=e68d1e69f17ad73af065b6bed19ae89ded913172;hb=b51c2fec1da205ea3e7354cbb3e253018d64873c#l2175

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


Compare: https://github.com/llvm/llvm-project/compare/2a66abb17ed3...e75c87f22cf2


More information about the All-commits mailing list