[PATCH] D111181: [llvm-objcopy][ELF] Don't assume RELA sections are dynamic if they carry the SHF_ALLOC flag

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 6 15:58:57 PDT 2021


MaskRay added a comment.

> While this occurs rarely for normal user programs, the Linux kernel uses partially linked ET_REL objects as its loadable module format, and there, we sometimes rely on SHF_ALLOC to indicate to the module loader that the static relocations (which the Linux kernel fixes up at module load time) need to be preserved in memory after loading of the module completes.

This should be refined. https://android-review.googlesource.com/c/kernel/common/+/1842462/3 seems to propose to add such usage but it is not pre-existing. I would certainly object to such usage if I had a chance to review such kernel code.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111181/new/

https://reviews.llvm.org/D111181



More information about the llvm-commits mailing list