[PATCH] D120701: [ELF] Add -z pack-relative-relocs

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 1 00:57:04 PST 2022


MaskRay created this revision.
MaskRay added reviewers: ikudrin, peter.smith.
Herald added subscribers: arichardson, emaste.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

GNU ld 2.38 added -z pack-relative-relocs which is similar but
--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 / (Ali
Bahrami) time travel compatibility 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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120701

Files:
  lld/ELF/Config.h
  lld/ELF/Driver.cpp
  lld/ELF/SyntheticSections.cpp
  lld/test/ELF/pack-dyn-relocs-glibc.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120701.411998.patch
Type: text/x-patch
Size: 5628 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220301/0af88682/attachment.bin>


More information about the llvm-commits mailing list