[PATCH] D56569: [ObjectYAML][yaml2obj][ELF] Add basic support for dynamic entries
Armando Montanez via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 14 12:01:49 PST 2019
amontanez marked 2 inline comments as done.
amontanez added inline comments.
================
Comment at: llvm/include/llvm/ObjectYAML/ELFYAML.h:94
+ ELF_DT Tag;
+ Optional<uint64_t> Val;
+ Optional<llvm::yaml::Hex64> Ptr;
----------------
ruiu wrote:
> jhenderson wrote:
> > Somewhat moot if you follow @ruiu's suggestion (which I support), but this should be an int64_t.
> Hmm, why is this of type `StringRef`? Isn't this `uint64_t`?
Making `Value` a StringRef gives more flexibility for how the value of a dynamic entry can be populated. I've listed a few examples below that illustrate how this is currently used.
Using a section name rather than manually entering the address of a section:
```
Tag: DT_STRTAB
Value: .dynstr
```
Using a string that will be added to .dynstr:
```
Tag: DT_SONAME
Value: libsomething.so
```
Or, the simple case of using a numeric value:
```
Tag: DT_STRSZ
Value: 0xa0
```
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56569/new/
https://reviews.llvm.org/D56569
More information about the llvm-commits
mailing list