Correct ld-pe/aarch64.d test output

Alan Modra amodra@gmail.com
Wed Jan 18 05:51:56 GMT 2023


On Wed, Jan 18, 2023 at 04:35:49AM +0000, Mark Harmstone wrote:
> Thanks Alan, I'll have a look. I've tested it with llvm-mc and lld, and it does match what you've got there.
> 
> The object files were the same, except that llvm-mc doesn't issue relocations for relative jumps within the same file. So it's a linking problem rather than an assembling problem.
> 
> > Is is really a sensible addend with no symbol value confounding?
> 
> Sorry, could you please explain what you mean by this? I'm not sure what "confounding" means in this context.

I mean that many older COFF targets install a combination of the
symbol value and addend in the insn field, almost as if the insn has
been relocated as it would be on final linking, using symbol values as
they are in the relocatable object file.  So the section contents
don't just have the relocation addend if the relocation is against
symbols defined in that object.  What do existing PE assemblers do in
that case?

See the comment I added recently to bfd/coffcode.h above CALC_ADDEND,
and notice the subtraction of symbol section vma and symbol value in
that macro.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list