[llvm] [lld] [llvm-readobj][Object][COFF] Print COFF import library symbol export name. (PR #78769)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 14:50:47 PST 2024


================
@@ -52,6 +52,32 @@ StringRef COFFImportFile::getFileFormatName() const {
   }
 }
 
+StringRef COFFImportFile::getExportName() const {
+  const coff_import_header *hdr = getCOFFImportHeader();
+  StringRef name = StringRef(Data.getBufferStart() + sizeof(*hdr));
----------------
efriedma-quic wrote:

I'd prefer not to implicitly assume the MemoryBuffer is null-terminated... maybe rewrite to something like `Data.getBuffer().substr(sizeof(*hdr)).split('\0').first`.

https://github.com/llvm/llvm-project/pull/78769


More information about the llvm-commits mailing list