I think we are going to need to know a bit more about the ELF ABI for
what looks like the ArcCompact before we can help you.
LLD's calculation of P (the place to be relocated) is as it is in the
generic ELF specification. The Rel.Offset corresponds to the ELF
r_offset field. This is covered by: "For a relocatable file, the value
is the byte offset from the beginning of the section to the storage
unit affected by the relocation."
For LLD we are calculating the virtual address (VA) of P, as I
understand it this is equivalent to the vma used in BFD. Assuming that
the relocation is relocating a regular InputSection from the
basic-arc.o object then the LLD calculation of P =
getOutputSection()->Addr + getOffset(Rel.Offset); translates to: (VA
of OutputSection) + (Offset of InputSection within OutputSection) +
(Offset within InputSection given by r_offset)
The BFD linker seems to be doing the equivalent calculation with an
extra modification of the (Offset within InputSection given by
r_offset) and is rounding down the result to the nearest 4-byte
boundary. This looks unfamiliar to me, and could well be specific to
ArcCompact. I think that you will need to refer to the ELF ABI
documentation as this should tell you if there are any processor
specific modifications to generic ELF that you have to follow.
The other thing that you should do is try and work out why the VA
(vma) is 6 in LD and 8 in LLD and whether this is actually a problem.
The VA of the OutputSection is not guaranteed to be the same between
different linkers so it may have just been that differences in order
of InputSections or alignment has caused a different VA. I would check
the output of the linker map file to see where it placed the Output
and Input Sections to see what the answer should be.
It looks like there are some Arc specific things that might need to be
done. Unfortunately I don't have any experience with Arc, and I'm not
sure the other people that work on LLD do either. I suggest looking at
the public ABI documentation and making any arguments for changes
based on that documentation, it is worth assuming that we know nothing
about Arc, don't have the documentation to hand and don't know where
to find it!
Hope that is of some help, with a bit more context I might be able to
help a bit more, unfortunately I can't spend a lot of time learning