[all-commits] [llvm/llvm-project] 4a8de2: [ELF] Add -z pack-relative-relocs

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Mar 10 19:54:33 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4a8de2832a2a730f63b71bdf1c1b446285ec5b6f
      https://github.com/llvm/llvm-project/commit/4a8de2832a2a730f63b71bdf1c1b446285ec5b6f
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-03-10 (Thu, 10 Mar 2022)

  Changed paths:
    M lld/ELF/Config.h
    M lld/ELF/Driver.cpp
    M lld/ELF/SyntheticSections.cpp
    M lld/docs/ReleaseNotes.rst
    M lld/docs/ld.lld.1
    A lld/test/ELF/pack-dyn-relocs-glibc.s

  Log Message:
  -----------
  [ELF] Add -z pack-relative-relocs

GNU ld 2.38 added -z pack-relative-relocs which is similar to
--pack-dyn-relocs=relr but synthesizes the `GLIBC_ABI_DT_RELR` version
dependency if a shared object named `libc.so.*` has a `GLIBC_2.*` version
dependency.

This is used to implement the (as some glibc folks call) version lockout
mechanism. Add this option, because glibc does not want to support
--pack-dyn-relocs=relr which does not add `GLIBC_ABI_DT_RELR`.
See https://maskray.me/blog/2021-10-31-relative-relocations-and-relr for
detail.

Close https://github.com/llvm/llvm-project/issues/53775

Reviewed By: peter.smith

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




More information about the All-commits mailing list