[PATCH] D74375: [ELF] Support INSERT [AFTER|BEFORE] for orphan sections

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 12 10:33:49 PST 2020


MaskRay marked an inline comment as done.
MaskRay added inline comments.


================
Comment at: lld/ELF/ScriptParser.cpp:552
+    // TODO This rule will be dropped in the future.
+    config->singleRoRx = true;
+
----------------
nickdesaulniers wrote:
> MaskRay wrote:
> > @srhines @nickdesaulniers I want to delete `config->singleRoRx = true;` in the future to be more consistant with other parts of lld. (It also matches `ld.bfd -z separate-code`)
> > 
> > Can you please test whether any project needs adaptation with this change?
> > 
> Sorry, what is the ask? I don't see `separate-code` being used in the Linux kernel. Or are you asking about all of Android (userspace)?
I'm asking about all of Android userspace that may use the linker script `SECTIONS` command.

Currently, due to `config->singleRoRx = true;` (like enforced `--no-rosegment`), there is no R PT_LOAD segment with a `SECTIONS` command.

After deleting `config->singleRoRx = true;`, an executable with a `SECTIONS` command will get one R PT_LOAD segment and one RX PT_LOAD segment, like a regular executable without a linker script.


I don't expect it will affect Linux kernel. We can easily add `--no-rosegment` if it does.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74375





More information about the llvm-commits mailing list