diff --git a/llvm/tools/obj2yaml/elf2yaml.cpp b/llvm/tools/obj2yaml/elf2yaml.cpp index d399b95c1cfb83..cb06e093a2bfcb 100644 --- a/llvm/tools/obj2yaml/elf2yaml.cpp +++ b/llvm/tools/obj2yaml/elf2yaml.cpp @@ -204,7 +204,8 @@ template Expected ELFDumper::dump() { // We need to locate the SHT_SYMTAB_SHNDX section early, because it might be // needed for dumping symbols. if (SymTabShndx) { - if (!SymTab || SymTabShndx->sh_link != SymTab - Sections.begin()) + if (!SymTab || + SymTabShndx->sh_link != (unsigned)(SymTab - Sections.begin())) return createStringError( obj2yaml_error::not_implemented, "only SHT_SYMTAB_SHNDX associated with SHT_SYMTAB are supported");