diff --git a/mold.h b/mold.h index 4591acb9..7efae7ae 100644 --- a/mold.h +++ b/mold.h @@ -676,12 +676,12 @@ struct ComdatGroup { class InputFile { public: - InputFile(MemoryBufferRef mb) - : mb(mb), name(mb.getBufferIdentifier()), + InputFile(MemoryBufferRef mb, bool is_dso) + : mb(mb), name(mb.getBufferIdentifier()), is_dso(is_dso), obj(check(ELFFile::create(mb.getBuffer()))) {} std::string name; - bool is_dso = false; + bool is_dso; u32 priority; MemoryBufferRef mb; ELFFile obj; @@ -743,9 +743,7 @@ private: class SharedFile : public InputFile { public: - SharedFile(MemoryBufferRef mb) : InputFile(mb) { - is_dso = true; - } + SharedFile(MemoryBufferRef mb) : InputFile(mb, true) {} void parse(); void resolve_symbols(); diff --git a/object_file.cc b/object_file.cc index 1abe3a37..a4c68c9d 100644 --- a/object_file.cc +++ b/object_file.cc @@ -12,7 +12,7 @@ using namespace llvm; using namespace llvm::ELF; ObjectFile::ObjectFile(MemoryBufferRef mb, StringRef archive_name) - : InputFile(mb), archive_name(archive_name), + : InputFile(mb, false), archive_name(archive_name), is_in_archive(archive_name != "") { is_alive = (archive_name == ""); }