llvm.org GIT mirror llvm / 71e3525
Simplify printing the soname. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242786 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 5 years ago
3 changed file(s) with 7 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
5656 void printNeededLibraries() override;
5757 void printProgramHeaders() override;
5858 void printHashTable() override;
59 void printLoadName() override;
5960
6061 void printAttributes() override;
6162 void printMipsPLTGOT() override;
11391140 W.printList("Chains", HT->chains());
11401141 }
11411142
1143 template void ELFDumper::printLoadName() {
1144 outs() << "LoadName: " << Obj->getLoadName() << '\n';
1145 }
1146
11421147 template
11431148 void ELFDumper::printAttributes() {
11441149 W.startLine() << "Attributes not implemented.\n";
3737 virtual void printNeededLibraries() { }
3838 virtual void printProgramHeaders() { }
3939 virtual void printHashTable() { }
40 virtual void printLoadName() {}
4041
4142 // Only implemented for ARM ELF at this time.
4243 virtual void printAttributes() { }
250250 return readobj_error::unsupported_obj_file_format;
251251 }
252252
253 static StringRef getLoadName(const ObjectFile *Obj) {
254 if (auto *ELF = dyn_cast(Obj))
255 return ELF->getELFFile()->getLoadName();
256 if (auto *ELF = dyn_cast(Obj))
257 return ELF->getELFFile()->getLoadName();
258 if (auto *ELF = dyn_cast(Obj))
259 return ELF->getELFFile()->getLoadName();
260 if (auto *ELF = dyn_cast(Obj))
261 return ELF->getELFFile()->getLoadName();
262 llvm_unreachable("Not ELF");
263 }
264
265253 /// @brief Dumps the specified object file.
266254 static void dumpObject(const ObjectFile *Obj) {
267255 StreamWriter Writer(outs());
278266 << Triple::getArchTypeName((llvm::Triple::ArchType)Obj->getArch())
279267 << "\n";
280268 outs() << "AddressSize: " << (8*Obj->getBytesInAddress()) << "bit\n";
281 if (Obj->isELF())
282 outs() << "LoadName: " << getLoadName(Obj) << "\n";
269 Dumper->printLoadName();
283270
284271 if (opts::FileHeaders)
285272 Dumper->printFileHeaders();