[PATCH]: Fix [ Bug #1403 ] Branch adjustment to another section not correct when doing linker relaxation

Stephane Carrez stcarrez@nerim.fr
Sat Oct 12 07:04:00 GMT 2002


Hi!

This patch fixes HC11 linker relaxation bug:

[ Bug #1403 ] Branch adjustment to another section not correct when doing linker relaxation
	http://savannah.gnu.org/bugs/?func=detailbug&bug_id=1403&group_id=2424

In the following code:

	.sect .text
	jmp foo
	jmp bar

	.sect .text.foo_bar
foo:	rts
bar: 
rts

The first jmp is relaxed and reduces the section's size by 1.
When we process the second jmp for relax the symbol value of bar is
computed using the old output section offset (it does not yet take
into account the change of size of the current section).  It is necessary
to let the linker re-compute the section offsets before processing
correctly this reloc.  It will be treated during a next relaxation pass.

Committed this patch to fix the bug.

	Stephane

2002-10-12  Stephane Carrez  <stcarrez@nerim.fr>

	* elf32-m68hc11.c (m68hc11_elf_relax_section): Don't treat relocs
	with symbols in other sections if we relaxed something;  the sections
	output offsets must be re-computed before.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: elf32-m68hc11.c.diffs
URL: <https://sourceware.org/pipermail/binutils/attachments/20021012/a49f7304/attachment.ksh>


More information about the Binutils mailing list