This fixes https://bugs.llvm.org/show_bug.cgi?id=40337.
Previously, it was always assumed that relocations referenced symbols in the static symbol table.
Now, if the Link field references a section called ".dynsym" it will look up these symbols
in the dynamic symbol table.
This patch is heavily based on D59097 by James Henderson
btw, since this code is now used for dynamic symbols and yaml2obj is
generally a tool that makes possible to produce the broken binaries,
perhaps I'd try to remove this restriction logic for both regular and dynamic symbols
in a follow up.