[PATCH] D56569: [ObjectYAML][yaml2obj][ELF] Add basic support for dynamic entries

Armando Montanez via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 11 18:44:09 PST 2019


amontanez updated this revision to Diff 181412.
amontanez marked 8 inline comments as done.
amontanez edited the summary of this revision.
amontanez added a comment.
Herald added a subscriber: srhines.

I changed a lot and included the majority of what was originally going to be in a second follow-up patch.

Added:

- Some dynamic entries are validated for correctness.
- Some dynamic entries can be automatically inferred.
- Values can be numbers, strings (for things like DT_SONAME and DT_NEEDED, for example), or section names that are converted to addresses.

Changed:

- `initSymtabSectionHeader()` is split into `initSymtabSectionHeader()` and `finalizeSymtabSection()`. This allows .dynamic strings to be placed in .dynstr alongside the strings from .dynsym (since `DotDynstr.finalize()` is now separated out).

Removed:

- SHT_DYNAMIC no longer supports the "Content" tag for sections that have raw content. This breaks `tools/llvm-objdump/private-headers-no-dynamic-segment.test`
- `zero(SHeader)` removed from beginning of `finalizeSymtabSection()` and `initStrtabSectionHeader()`. This prevented `sh_addr` from being populated when symbol tables were specified.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56569/new/

https://reviews.llvm.org/D56569

Files:
  llvm/include/llvm/ObjectYAML/ELFYAML.h
  llvm/lib/ObjectYAML/ELFYAML.cpp
  llvm/test/tools/yaml2obj/dynamic-dtstrtab-inconsistent.yaml
  llvm/test/tools/yaml2obj/dynamic-dtstrtab-invalid.yaml
  llvm/test/tools/yaml2obj/dynamic-entries.yaml
  llvm/test/tools/yaml2obj/dynamic-link-str-offset.yaml
  llvm/test/tools/yaml2obj/dynamic-link-str-req-offset.yaml
  llvm/test/tools/yaml2obj/dynamic-soname.yaml
  llvm/test/tools/yaml2obj/dynamic-strsz-gt.yaml
  llvm/test/tools/yaml2obj/dynamic-strsz-invalid.yaml
  llvm/test/tools/yaml2obj/dynamic-strsz-lt.yaml
  llvm/tools/yaml2obj/yaml2elf.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56569.181412.patch
Type: text/x-patch
Size: 32026 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190112/ec164d51/attachment.bin>


More information about the llvm-commits mailing list