[PATCH] D35944: [ELF] Disable relocation validation when targeting weak undefined symbols
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 27 09:54:48 PDT 2017
ruiu added inline comments.
================
Comment at: ELF/InputSection.cpp:731-733
+ bool UndefinedWeak = (Rel.Sym->isUndefined() || Rel.Sym->isLazy()) &&
+ !Rel.Sym->isLocal() && Rel.Sym->symbol()->isWeak();
+ Target->relocateOne(BufLoc, Type, TargetVA, !UndefinedWeak);
----------------
I wonder if you really have to change this many places to handle weak undefined symbols. If you don't call `relocateOne` if `UndefinedWeak` is true, doesn't it work?
https://reviews.llvm.org/D35944
More information about the llvm-commits
mailing list