[PR20402][LD][AARCH64]Don't emit RELATIVE relocation for absolute symbols which are resolved at static linking time.
For absolute symbols which are forced local or not dynamic, the ABS relocation
should be resolved at static linking time.
Originally, an RELATIVE/ABS relocation will be generated even for absolution symbols
for the dynamic linker to resolve.
For the testcase with the patch, before the change, two R_AARCH64_RELATIV relocations
will be generated.
The relocation will be changed into R_AARCH64_NONE. It is not possible to
remove the relocations totally.
At the time of allocating dynamic relocs space, the symbol information is not
finalized. It is not safe to not allocating space for the relocation with the
information available at that time.
For example, symbol agasint '.' will be initially defined in ABS section, but
later updated as section relative symbol. A relocation is needed for this case.
For _GLOBAL_OFFSET_TABLE_ and _DYNAMIC symbols, they are initially created as section relative
and forced local. So for those two symbol, a RELATIVE relocation will be generated.
They are later marked as absolute. This behavior is not changed with the patch here.
aarch64 binutils cross/native regression test Okay. Linux kernel link Okay.
Okay to commit?