[all-commits] [llvm/llvm-project] 7ccae2: [yaml2obj] - Introduce the "Offset" property for s...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Fri May 15 01:30:45 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7ccae2cece72153d2c8210ef916bf0052da216ad
      https://github.com/llvm/llvm-project/commit/7ccae2cece72153d2c8210ef916bf0052da216ad
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-05-15 (Fri, 15 May 2020)

  Changed paths:
    M llvm/include/llvm/ObjectYAML/ELFYAML.h
    M llvm/lib/ObjectYAML/ELFEmitter.cpp
    M llvm/lib/ObjectYAML/ELFYAML.cpp
    M llvm/test/tools/yaml2obj/ELF/custom-null-section.yaml
    A llvm/test/tools/yaml2obj/ELF/section-offset.yaml

  Log Message:
  -----------
  [yaml2obj] - Introduce the "Offset" property for sections.

Currently there is no good way to set a physical offset for a section:

* We have the `ShOffset` that allows to override the `sh_offset`, but
  it does not affect the real data written.
* We can use a `Filler` to create an artificial gap, but it is more like a hack
  rather than a proper solution for this problem.

This patch adds the `Offset` property which allows setting physical
offsets for sections.

It also generalizes the code, so that we set sh_offset field in one place

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




More information about the All-commits mailing list