[PATCH] D124656: [ELF] Support custom sections before DATA_SEGMENT_RELRO_END

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 00:49:26 PDT 2022


MaskRay added a comment.

Related:
I think the original `is not contiguous with other relro sections` error from https://reviews.llvm.org/D40359 is useful.

When building glibc there is a feature request that marks a custom section RELRO.
(specifying a full `SECTIONS` command is clumsy and lld doesn't support dumping its built-in rules).
The best I can come up with is

  SECTIONS {
           __libc_subfreeres : { *(__libc_subfreeres) }
           __libc_atexit : { *(__libc_atexit) }
           __libc_IO_vtables : { *(__libc_IO_vtables) }
  } INSERT BEFORE .data.rel.ro;

But it will trigger the `is not contiguous with other relro sections` error.

I wonder how we should (un)support the case: https://sourceware.org/pipermail/libc-alpha/2022-April/138284.html
I remember that ~2 years some folks asked on llvm-dev how to make a custom section RELRO but that discussion did not lead to any action item.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124656



More information about the llvm-commits mailing list