Problems with Mach-O address significance table generation

I believe lld is already using that heuristics to decide whether it should create a canonical PLT or non-canonical PLT. It creates a canonical PLT only if a function address is taken. So it’s not entirely new.

Besides that, I actually don’t think that you cannot take an address of a function with R_X86_64_PLT32 followed by an ADD to add a PC to the resulting value, because it always creates an address of a PLT entry, even if we are not using the address of the PLT as the function address. So the only correct way to get an address of a function is to refer it using R_X86_64_PLT32 or via a GOT entry.