From 7d2e04a23b702b5ad7479a703ff23598c4994bfe Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 9 Mar 2021 02:22:45 +0900 Subject: [PATCH] Rename variables --- input_sections.cc | 4 ++-- mold.h | 4 ++-- object_file.cc | 22 +++++++++++----------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/input_sections.cc b/input_sections.cc index 571747ee..cd7d21ea 100644 --- a/input_sections.cc +++ b/input_sections.cc @@ -319,7 +319,7 @@ void InputSection::apply_reloc_nonalloc(u8 *base) { const ElfRela &rel = rels[i]; Symbol &sym = *file->symbols[rel.r_sym]; - if (!sym.file || sym.is_placeholder) { + if (!sym.file || sym.is_lazy) { Error() << "undefined symbol: " << *file << ": " << sym; continue; } @@ -402,7 +402,7 @@ void InputSection::scan_relocations() { const ElfRela &rel = rels[i]; Symbol &sym = *file->symbols[rel.r_sym]; - if (!sym.file || sym.is_placeholder) { + if (!sym.file || sym.is_lazy) { Error() << "undefined symbol: " << *file << ": " << sym; continue; } diff --git a/mold.h b/mold.h index 1d779ad8..f0029a83 100644 --- a/mold.h +++ b/mold.h @@ -305,8 +305,8 @@ public: std::atomic_uint8_t visibility = STV_DEFAULT; std::atomic_uint8_t flags = 0; - u8 is_placeholder : 1 = false; - u8 write_symtab : 1 = false; + u8 is_lazy : 1 = false; + u8 write_to_symtab : 1 = false; u8 traced : 1 = false; u8 has_copyrel : 1 = false; u8 is_readonly : 1 = false; diff --git a/object_file.cc b/object_file.cc index d742832b..1b1bb419 100644 --- a/object_file.cc +++ b/object_file.cc @@ -366,7 +366,7 @@ void ObjectFile::initialize_symbols() { } if (should_write_symtab(sym)) { - sym.write_symtab = true; + sym.write_to_symtab = true; strtab_size += sym.name.size() + 1; num_local_symtab++; } @@ -503,7 +503,7 @@ static u64 get_rank(InputFile *file, const ElfSym &esym, InputSection *isec) { static u64 get_rank(const Symbol &sym) { if (!sym.file) return (u64)4 << 32; - if (sym.is_placeholder) + if (sym.is_lazy) return ((u64)3 << 32) + sym.file->priority; return get_rank(sym.file, *sym.esym, sym.input_section); } @@ -532,7 +532,7 @@ void ObjectFile::maybe_override_symbol(Symbol &sym, i64 symidx) { } sym.ver_idx = config.default_version; sym.esym = &esym; - sym.is_placeholder = false; + sym.is_lazy = false; sym.is_imported = false; sym.is_exported = false; @@ -578,11 +578,11 @@ void ObjectFile::resolve_symbols() { std::lock_guard lock(sym.mu); bool is_new = !sym.file; bool tie_but_higher_priority = - sym.is_placeholder && this->priority < sym.file->priority; + sym.is_lazy && this->priority < sym.file->priority; if (is_new || tie_but_higher_priority) { sym.file = this; - sym.is_placeholder = true; + sym.is_lazy = true; if (sym.traced) SyncOut() << "trace: " << *sym.file << ": lazy definition of " << sym; @@ -634,7 +634,7 @@ void ObjectFile::handle_undefined_weak_symbols() { Symbol &sym = *symbols[i]; std::lock_guard lock(sym.mu); - bool is_new = !sym.file || sym.is_placeholder; + bool is_new = !sym.file || sym.is_lazy; bool tie_but_higher_priority = !is_new && sym.is_undef_weak() && this->priority < sym.file->priority; @@ -644,7 +644,7 @@ void ObjectFile::handle_undefined_weak_symbols() { sym.value = 0; sym.ver_idx = config.default_version; sym.esym = &esym; - sym.is_placeholder = false; + sym.is_lazy = false; if (sym.traced) SyncOut() << "trace: " << *this << ": unresolved weak symbol " << sym; @@ -766,10 +766,10 @@ void ObjectFile::compute_symtab() { // to remove them from symtab. for (i64 i = 1; i < first_global; i++) { Symbol &sym = *symbols[i]; - if (sym.write_symtab && !sym.is_alive()) { + if (sym.write_to_symtab && !sym.is_alive()) { strtab_size -= sym.name.size() + 1; num_local_symtab--; - sym.write_symtab = false; + sym.write_to_symtab = false; } } } @@ -816,7 +816,7 @@ void ObjectFile::write_symtab() { symtab_off = local_symtab_offset; for (i64 i = 1; i < first_global; i++) - if (symbols[i]->write_symtab) + if (symbols[i]->write_to_symtab) write_sym(i); symtab_off = global_symtab_offset; @@ -987,7 +987,7 @@ void SharedFile::resolve_symbols() { sym.value = esym.st_value; sym.ver_idx = versyms[i]; sym.esym = &esym; - sym.is_placeholder = false; + sym.is_lazy = false; sym.is_imported = true; sym.is_exported = false;