Partially fix #15528. Use Linker::link() from r40496 to deal with invalid