[all-commits] [llvm/llvm-project] de3cef: [yaml2obj, obj2yaml] - Add support for SHT_NOTE se...

GeorgiiR via All-commits all-commits at lists.llvm.org
Fri Oct 25 03:31:11 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: de3cef1d5d33212059164d6095aca5c5b0284001
      https://github.com/llvm/llvm-project/commit/de3cef1d5d33212059164d6095aca5c5b0284001
  Author: georgerim <georgerim at gmail.com>
  Date:   2019-10-25 (Fri, 25 Oct 2019)

  Changed paths:
    M llvm/include/llvm/ObjectYAML/ELFYAML.h
    M llvm/include/llvm/Support/YAMLTraits.h
    M llvm/lib/ObjectYAML/ELFEmitter.cpp
    M llvm/lib/ObjectYAML/ELFYAML.cpp
    M llvm/test/tools/llvm-objcopy/ELF/set-section-alignment.test
    M llvm/test/tools/llvm-readobj/elf-section-types.test
    M llvm/test/tools/llvm-readobj/gnu-notes.test
    M llvm/test/tools/llvm-size/elf-sysv.test
    M llvm/test/tools/yaml2obj/implicit-sections-types.test
    M llvm/tools/obj2yaml/elf2yaml.cpp

  Log Message:
  -----------
  [yaml2obj, obj2yaml] - Add support for SHT_NOTE sections.

SHT_NOTE is the section that consists of
namesz, descsz, type, name + padding, desc + padding data.
This patch teaches yaml2obj, obj2yaml to dump and parse them.

This patch implements the section how it is described here:
https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-18048.html
Which says: "For 64–bit objects and 32–bit objects, each entry is an array of 4-byte words in
the format of the target processor"

The official specification is different
http://www.sco.com/developers/gabi/latest/ch5.pheader.html#note_section
And says: "n 64-bit objects (files with e_ident[EI_CLASS] equal to ELFCLASS64), each entry is an array
of 8-byte words in the format of the target processor. In 32-bit objects (files with e_ident[EI_CLASS]
equal to ELFCLASS32), each entry is an array of 4-byte words in the format of the target processor"

Since LLVM uses the first, 32-bit way, this patch follows it.

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




More information about the All-commits mailing list