Add support for .rela relocation sections
A recent LLVM PR (https://github.com/llvm/llvm-project/pull/80034) changed the backend to generate slightly worse code for symbol+offset calculations, in order to avoid some correctness problems with negative and/or very large offsets. This was done for the PAL and Mesa OSes, because they use .rel relocation sections, which means that each relocation can only use a 32-bit addend (stored in the instruction).
A better way to fix the problem with negative and/or very large offsets would be to switch to using .rela relocation sections, so that each relocation gets a full 64-bit addend (stored in the relocation record). If we did that then we could revert the LLVM PR mentioned above, so the compiler could generate better code for symbol+offset calculations.
There is alread a TODO for this in src/amd/common/ac_rtld.c apply_relocs():
/* TODO: Should we also support .rela sections, where the
* addend is part of the relocation record? */
Could someone please implement this?