[all-commits] [llvm/llvm-project] 107b9d: [ELF][PPC64] Fix potentially corrupted section con...

Fangrui Song via All-commits all-commits at lists.llvm.org
Mon Aug 8 12:53:57 PDT 2022


  Branch: refs/heads/release/15.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 107b9db28bd7e16e8ba5a165a7936e8d3331fe64
      https://github.com/llvm/llvm-project/commit/107b9db28bd7e16e8ba5a165a7936e8d3331fe64
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-08-08 (Mon, 08 Aug 2022)

  Changed paths:
    M lld/ELF/SyntheticSections.cpp

  Log Message:
  -----------
  [ELF][PPC64] Fix potentially corrupted section content with empty .got

D91426 makes .got possibly empty while needed. If .got and .data have the same
address, and .got's content is written after .data, the first word of .data will
be corrupted.

The bug is not testable without D131247.

(cherry picked from commit 28d05d672300e51f53c73fe9a4bd053e73844247)


  Commit: 9383f823971f847baafd0b05dc35c6cc530000e1
      https://github.com/llvm/llvm-project/commit/9383f823971f847baafd0b05dc35c6cc530000e1
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-08-08 (Mon, 08 Aug 2022)

  Changed paths:
    M lld/ELF/Driver.cpp

  Log Message:
  -----------
  [ELF] Keep only getTarget() call. NFC

The place from D61712 seems unneeded now. We can just use the place added by
D62609 (support AArch64 BTI/PAC).

(cherry picked from commit e89d6d2ac527f973c43563373dfdeb9e4c3bbcc5)


  Commit: bf271375cc086c1d0a382d6a4ffc0dd3976c964d
      https://github.com/llvm/llvm-project/commit/bf271375cc086c1d0a382d6a4ffc0dd3976c964d
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-08-08 (Mon, 08 Aug 2022)

  Changed paths:
    M lld/ELF/Arch/AArch64.cpp

  Log Message:
  -----------
  [ELF][AArch64] Fix potentially corrupted section content for PAC

D74537 introduced a bug: if `(config->andFeatures & GNU_PROPERTY_AARCH64_FEATURE_1_PAC) != 0`
with -z pac-plt unspecified, we incorrectly use AArch64BtiPac, whose writePlt will make
out-of-bounds write after the .plt section. This is often benign because the
output section after .plt will usually overwrite the content.

This is very difficult to test without D131247 (Parallelize writes of different OutputSections).

(cherry picked from commit d7cbfcf36ace575ec90434624279dd3ebce78c47)


Compare: https://github.com/llvm/llvm-project/compare/4acca1b014ec...bf271375cc08


More information about the All-commits mailing list