This is the mail archive of the
mailing list for the binutils project.
Re: cross-compiling LM32 internal error while linking
- From: Nick Clifton <nickc at redhat dot com>
- To: Federico Vaga <federico dot vaga at gmail dot com>
- Cc: binutils at sourceware dot org, jon at beniston dot com
- Date: Fri, 5 Feb 2016 11:23:53 +0000
- Subject: Re: cross-compiling LM32 internal error while linking
- Authentication-results: sourceware.org; auth=none
- References: <20160129091753 dot GE30568 at pcbe13110 dot cern dot ch>
> When I compile my code I get this message:
> ld: internal error: addend should be zero for R_LM32_16_GOT
> Then the compilation complete without errors (O_O)
> (like if that error is not an error but a warning)
This is a bug. Either the code being linked is broken somehow, possibly
due to a compiler or assembler error, and so the link should not have
succeeded. Or else the error message is actually a warning about behaviour
that the programmer (of the linker) was not expecting, and so the linker
might not have behaved correctly.
A simple testcase to reproduce the problem would certainly be helpful for
whomever does investigate this problem.
> I do not understand what does this mean, and I cannot find information on
> the web. Any hint?
Well the error message comes from the lm32_elf_relocate_section function in the
bfd/elf32-lm32.c source file, where it is processing the R_LM32_16_GOT reloc.
Exactly what this relocation is supposed to do and why its addend should be zero
I do not know. It is presumably specified by the ABI for the LM32 architecture,
but I could not find a copy of this document on the web. :-(
> If this is not the right place, can you redirect me to the
> right place?
Probably the best person to ask would be the maintainer for the LM32 code -
Jon Beniston. I have added him to the CC list of this email.