[all-commits] [llvm/llvm-project] 06456d: [yaml2obj] - Add a way to describe the custom data...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Mon Nov 11 00:54:09 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 06456daa9e59ffddc634e4f1aa592161653fbd36
      https://github.com/llvm/llvm-project/commit/06456daa9e59ffddc634e4f1aa592161653fbd36
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2019-11-11 (Mon, 11 Nov 2019)

  Changed paths:
    M llvm/include/llvm/ObjectYAML/ELFYAML.h
    M llvm/include/llvm/ObjectYAML/YAML.h
    M llvm/lib/ObjectYAML/ELFEmitter.cpp
    M llvm/lib/ObjectYAML/ELFYAML.cpp
    M llvm/lib/ObjectYAML/YAML.cpp
    A llvm/test/tools/yaml2obj/custom-fill.yaml
    M llvm/test/tools/yaml2obj/duplicate-section-names.test
    M llvm/test/tools/yaml2obj/program-header.yaml
    M llvm/tools/obj2yaml/elf2yaml.cpp

  Log Message:
  -----------
  [yaml2obj] - Add a way to describe the custom data that is not part of an output section.

Currently there is no way to describe the data that is not a part of an output section.
It can be a data used to align sections or to fill the gaps with something,
or another kind of custom data. In this patch I suggest a way to describe it. It looks like that:

```
Sections:
  - Type:    CustomFiller
    Pattern: "CCDD"
    Size:    4
  - Name:    .bar
    Type:    SHT_PROGBITS
    Content: "FF"
```

I.e. I've added a kind of synthetic section with a synthetic type "CustomFiller".
In the code it is called a "SyntheticFiller", which is "a synthetic section which
might be used to write the custom data around regular output sections. It does
not present in the sections header table, but it might affect the output file size and
program headers produced. Think about it as about piece of data."

`SyntheticFiller` currently has a `Pattern` field and a `Size` field + an optional `Name`.
When written, `Size` of bytes in the output will be filled with a `Pattern`.
It is possible to reference a named filler it by name from the program headers description,
just like any other normal section.

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




More information about the All-commits mailing list