[PATCH] D134250: [ObjectYAML] Support chained fixups, dyld exports trie, data in code

Chris Bieneman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 09:20:06 PDT 2022


beanz added a reviewer: lhames.
beanz added a subscriber: lhames.
beanz added a comment.
Herald added a subscriber: StephenFan.

Looping in @lhames in case he has any thoughts from Apple.

>From a design perspective I'm not sure this is the approach I'd take, but I also don't know that I'm the best person to judge since I'm not going to be the user here.

When I added the initial mach-o support the emphasis was on representing the binary accurately enough to reproduce binary-accurate transformations, but to also have the YAML representation be human readable wherever it could be. This patch really just treats it as binary data, which makes it pretty unreadable.



================
Comment at: llvm/lib/ObjectYAML/MachOEmitter.cpp:610
+void MachOWriter::writeChainedFixups(raw_ostream &OS) {
+  for (auto Data : Obj.LinkEdit.ChainedFixups) {
+    OS.write(reinterpret_cast<const char *>(&Data),
----------------



================
Comment at: llvm/lib/ObjectYAML/MachOEmitter.cpp:617
+void MachOWriter::writeDyldExportsTrie(raw_ostream &OS) {
+  for (auto Data : Obj.LinkEdit.DyldExportsTrie) {
+    OS.write(reinterpret_cast<const char *>(&Data),
----------------



================
Comment at: llvm/lib/ObjectYAML/MachOEmitter.cpp:624
+void MachOWriter::writeDataInCode(raw_ostream &OS) {
+  for (auto Data : Obj.LinkEdit.DataInCode) {
+    OS.write(reinterpret_cast<const char *>(&Data),
----------------



================
Comment at: llvm/tools/obj2yaml/macho2yaml.cpp:632
+
+  for (auto& LC : Y->LoadCommands) {
+    if (LC.Data.load_command_data.cmd == llvm::MachO::LC_DYLD_CHAINED_FIXUPS) {
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134250



More information about the llvm-commits mailing list