[PATCH] D63280: [llvm-objdump] Use <first-symbol>-<offset> as the section start symbol

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 14 01:19:21 PDT 2019


grimar added inline comments.


================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1154
 
     // If the section has no symbol at the start, just insert a dummy one.
+    std::string StartSymbol;
----------------
The comment need an update.


================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1170
                           Section.isText() ? ELF::STT_FUNC : ELF::STT_OBJECT));
     }
 
----------------
Does the following look simpler?


```
    if (Symbols.empty()) {
      Symbols.push_back({SectionAddr, SectionName,
                         Section.isText() ? ELF::STT_FUNC : ELF::STT_OBJECT});
    } else {
      uint64_t Addr = std::get<0>(Symbols[0]);
      if (Addr != SectionAddr) {
        std::string Sym = Demangle ? demangle(std::get<1>(Symbols[0]))
                                   : std::get<1>(Symbols[0]);
        Symbols.insert(Symbols.begin(),
                       {SectionAddr,
                        Sym + "-0x" + utohexstr(Addr - SectionAddr),
                        Section.isText() ? ELF::STT_FUNC : ELF::STT_OBJECT});
      }
    }
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63280





More information about the llvm-commits mailing list