A very "strange" bug in gcc 2.96

Alan Modra alan@linuxcare.com.au
Sun May 21 21:35:00 GMT 2000


On Sun, 21 May 2000, H . J . Lu wrote:

> > For x86, gas/config/tc-i386.c:md_estimate_size_before_relax needs to be
> > taught how to handle this case properly.  (I think that's all that's
> > needed...)
> 
> That is only ia32. What about others?

If what I understand about this problem is correct, then it's caused by a
feature in the x86 assembler, namely that jumps are emitted using the
smallest possible opcode that the assembler "knows" it can use.  If jumps
aren't treated specially on other gas architectures then there shouldn't
be a problem.

x86 gas currently assumes that if a jump target is within the same
segment, then it is OK to consider using a small jump, and that a reloc
isn't needed.  That assumption breaks badly now that gcc might be emitting
jumps to weak symbols.

-- 
Linuxcare.  Support for the Revolution.



More information about the Binutils mailing list