[llvm-commits] Add ObjectFile::getLoadName() to retrieve the soname/install name of a shared object

Michael Spencer bigcheesegs at gmail.com
Thu Mar 1 14:17:18 PST 2012


On Thu, Mar 1, 2012 at 2:06 PM, David Meyer <pdox at google.com> wrote:
> Implemented for ELF.
> Added test case for readobj output.
>
> - pdox

@@ -155,6 +156,14 @@
   outs() << "  Total: " << count << "\n\n";
 }

+void DumpHeaders(const ObjectFile *obj) {
+  outs() << "File Format : " << obj->getFileFormatName() << "\n";
+  outs() << "Arch        : " <<
Triple::getArchTypeName((llvm::Triple::ArchType)obj->getArch()) <<
"\n";

80 cols.

+  outs() << "Address Size: " << (8*obj->getBytesInAddress()) << " bits\n";
+  outs() << "Load Name   : " << obj->getLoadName() << "\n";
+  outs() << "\n";
+}
+
 int main(int argc, char** argv) {
   error_code ec;
   sys::PrintStackTraceOnErrorSignal();
@@ -180,6 +189,7 @@

Other than that it looks good to me.

- Michael Spencer



More information about the llvm-commits mailing list