[all-commits] [llvm/llvm-project] 31cc97: [ELF] OVERLAY: support optional start address and LMA

Fangrui Song via All-commits all-commits at lists.llvm.org
Mon Jan 8 16:05:51 PST 2024


  Branch: refs/heads/users/MaskRay/spr/elf-overlay-support-optional-start-address-and-lma
  Home:   https://github.com/llvm/llvm-project
  Commit: 31cc97cd43061da3990aac60de6a51d72c004afa
      https://github.com/llvm/llvm-project/commit/31cc97cd43061da3990aac60de6a51d72c004afa
  Author: Fangrui Song <i at maskray.me>
  Date:   2024-01-08 (Mon, 08 Jan 2024)

  Changed paths:
    M lld/ELF/ScriptParser.cpp
    M lld/test/ELF/linkerscript/overlay.test

  Log Message:
  -----------
  [ELF] OVERLAY: support optional start address and LMA

https://reviews.llvm.org/D44780 implemented rudimentary support for
OVERLAY. The start address and `AT(ldaddr)` in `OVERLAY [start] :
[NOCROSSREFS] [AT ( ldaddr )]` are not optional.

In addition, there are two issues:

* When the start address is `.`, subsequent sections don't share the
  address of the first overlay section.
* When the first overlay section is empty and discardable, `p_paddr` is
  incorrectly zero. This is because a discarded section has a zero
  address, causing `prev->getLMA() + prev->size` where `prev` refers to
  the first section to evaluate to zero.

This patch supports optional start address and LMA and fix the issues.
Close #77265

Pull Request: https://github.com/llvm/llvm-project/pull/77272




More information about the All-commits mailing list