This patch adds support for handling of PIC, generation of GOT/PLT and creation of PIE executables or DSO.
Some comments:
- It's currently missing the first entry of GOT which should be the address of .dynamic section. This seems to be the case for other targets as well, for example x86_64 ABI requires the address in .got so _GLOBAL_OFFSET_TABLE[0] == &_DYNAMIC but lld puts it in .got.plt instead. For now this doesn't appear to be used as well.
- RISC-V uses ADDN/SETN/SUBN relocation pairs to calculate differences of address in DWARF. This means that lld tries to create dynamic relocations for those while they are actually link-time constants as a pair, so we set those in RISCV::usesOnlyLowPageBits.