For comdats (e.g. caused by -ffunction-sections), Section is already
set here; make sure it's null, for the weak external symbol to be undefined.
This fixes PR46779.
Differential Revision: https://reviews.llvm.org/D84507
(cherry picked from commit 9e81d8bbf19d72fca3d87b7334c613d1aa2a5795)