[PATCH] D65367: [Object] Create MutableELFObject Class for Doing Mutations on ELFObjectFiles [Part 2]

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 12 15:03:20 PDT 2019


rupprecht added inline comments.


================
Comment at: llvm/include/llvm/Object/MutableELFObject.h:48
+template <typename ELFT> struct MutableELFSymbol {
+  using Elf_Sym = Elf_Sym_Impl<ELFT>;
+
----------------
```
using Elf_Sym = typename ELFT::Sym;
```


================
Comment at: llvm/unittests/Object/MutableELFObjectTest.cpp:364-368
+  EXPECT_EQ(MutSymOrErr->Name, "new_name");
+  TestSym = symbol_iterator(++MutableObject.symbol_begin());
+  auto NameOrErr = TestSym->getName();
+  ASSERT_THAT_EXPECTED(NameOrErr, Succeeded());
+  EXPECT_EQ(*NameOrErr, "new_name");
----------------
What happens to the string table in this case?

The names for symbols in the symbol table is backed by the string table, so if you change the name from "test" to "new_name", the string table needs to be rewritten for that, but it doesn't looks like there's a corresponding `MutableTable StringTable` to back that change.


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

https://reviews.llvm.org/D65367





More information about the llvm-commits mailing list