[PATCH] D92478: [yaml2obj/obj2yaml] - Make fields of the `Symbol` to be optional.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 2 23:19:32 PST 2020


grimar marked an inline comment as done.
grimar added inline comments.


================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:675
   S.Other = Sym->st_other;
-  S.Binding = Sym->getBinding();
+  if (Sym->getBinding() != ELF::STB_LOCAL)
+    S.Binding = Sym->getBinding();
----------------
MaskRay wrote:
> For undefined symbols, STB_GLOBAL is the default.
> For defined symbols, STB_LOCAL is the default.
Before this patch our default binding was always `ELF_STB (0)`, what is `STB_LOCAL (0)`.

```
 IO.mapOptional("Binding", Symbol.Binding, ELFYAML::ELF_STB(0));
```

I don't think that this patch is the right place to change defaults?


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

https://reviews.llvm.org/D92478



More information about the llvm-commits mailing list