[PATCH] D70956: [yaml2obj] - Make DynamicSymbols to be Optional<> too.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 04:59:41 PST 2019


grimar created this revision.
grimar added reviewers: jhenderson, MaskRay.
Herald added subscribers: hiraditya, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.
grimar edited the summary of this revision.

We already have `Symbols` property to list regular symbols and
it is currently `Optional<>`. This patch makes `DynamicSymbols` to be optional
too. With this there is no need to define a dummy symbol anymore to trigger
creation of the .dynsym and it is now possible to define an empty .dynsym using
just the following line:

`DynamicSymbols: []`
(it is important to have when you need a strictly empty .dynsym)

Now the code is consistent and it helped to fix a bug: previously we
did not report an error when both `Content`/`Size` and an empty
`Symbols`/`DynamicSymbols` list were specified.


https://reviews.llvm.org/D70956

Files:
  llvm/include/llvm/ObjectYAML/ELFYAML.h
  llvm/lib/ObjectYAML/ELFEmitter.cpp
  llvm/test/tools/yaml2obj/ELF/dynsymtab-implicit-sections-size-content.yaml
  llvm/test/tools/yaml2obj/ELF/gnu-hash-section.yaml
  llvm/test/tools/yaml2obj/ELF/implicit-sections-addr.yaml
  llvm/test/tools/yaml2obj/ELF/implicit-sections-types.yaml
  llvm/test/tools/yaml2obj/ELF/implicit-sections.yaml
  llvm/test/tools/yaml2obj/ELF/symtab-implicit-sections-size-content.yaml
  llvm/tools/obj2yaml/elf2yaml.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70956.231875.patch
Type: text/x-patch
Size: 13074 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191203/53b2db31/attachment.bin>


More information about the llvm-commits mailing list