[all-commits] [llvm/llvm-project] 5a4498: [ELF] Support custom sections between DATA_SEGMENT...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed May 4 01:11:00 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5a44980f0a8bb2c7dafe9a9f5e5a17699e65cc3d
      https://github.com/llvm/llvm-project/commit/5a44980f0a8bb2c7dafe9a9f5e5a17699e65cc3d
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-05-04 (Wed, 04 May 2022)

  Changed paths:
    M lld/ELF/OutputSections.h
    M lld/ELF/ScriptParser.cpp
    M lld/ELF/Writer.cpp
    M lld/test/ELF/linkerscript/data-segment-relro.test

  Log Message:
  -----------
  [ELF] Support custom sections between DATA_SEGMENT_ALIGN and DATA_SEGMENT_RELRO_END

We currently hard code RELRO sections. When a custom section is between
DATA_SEGMENT_ALIGN and DATA_SEGMENT_RELRO_END, we may report a spurious
`error: section: ... is not contiguous with other relro sections`. GNU ld
makes such sections RELRO.

glibc recently switched to default --with-default-link=no. This configuration
places `__libc_atexit` and others between DATA_SEGMENT_ALIGN and
DATA_SEGMENT_RELRO_END. This patch allows such a ld.bfd --verbose
linker script to be fed into lld.

Reviewed By: peter.smith

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




More information about the All-commits mailing list