HomePhabricator

ELF: allow non allocated sections to go into allocated sections

Authored by ruiu on Dec 4 2018, 10:47 AM.

Description

ELF: allow non allocated sections to go into allocated sections

Patch from Andrew Kelley.

For context, see https://bugs.llvm.org/show_bug.cgi?id=39862

The use case is embedded / OS programming where the kernel wants
access to its own debug info via mapped dwarf info. I have a proof of
concept of this working, using this linker script snippet:

.rodata : ALIGN(4K) {
  *(.rodata)
  __debug_info_start = .;
  KEEP(*(.debug_info))
  __debug_info_end = .;
  __debug_abbrev_start = .;
  KEEP(*(.debug_abbrev))
  __debug_abbrev_end = .;
  __debug_str_start = .;
  KEEP(*(.debug_str))
  __debug_str_end = .;
  __debug_line_start = .;
  KEEP(*(.debug_line))
  __debug_line_end =
  .;
  __debug_ranges_start
  = .;
  KEEP(*(.debug_ranges))
  __debug_ranges_end
  = .;
}

Differential revision: https://reviews.llvm.org/D55276

llvm-svn: 348291

Details

Committed
ruiuDec 4 2018, 10:47 AM
Differential Revision
D55276: ELF: allow non allocated sections to go into allocated sections
Parents
rGb17241b12d04: Move llc-start-stop-instance to x86
Branches
Unknown
Tags
Unknown