Procedure for posting a patch

Kazu Hirata kazu@hxi.com
Mon Mar 13 09:36:00 GMT 2000


Hi,

Attached is a patch for bfd/reloc16.c against the snapshot on Mar 13.

Here is the summary of what it does. This patch is regarding --relax option
in ld. Basically, the bug is an off-by-one error. In the original version of
bfd_coff_reloc16_relax_section() in bfd/reloc16.c, the function does not
reduce the section size properly when the last reloc happens to be relaxed.
This causes the section size to be slightly bigger, leaving a few extra
bytes at the end of the section. With the proposed patch, the total amount
of shrinks is computed correctly and a coff file is generated without
garbage instructions at the end.

I used this patch on h8300-hms with -ms and -mh. I hope this works on other
platforms that support --relax.

p.s.
I have other patches as well, but I will post one by one as I think it's
better to post a patch that does only one thing.

Thanks,

Kazu Hirata

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bfd-reloc16.patch
Type: text/x-diff
Size: 1140 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20000313/0c75c759/attachment.bin>
-------------- next part --------------
2000-03-13  Kazu Hirata  <kazu@hxi.com>

	* bfd.c (bfd_coff_reloc16_relax_section): Count the total number
	of shrinks properly, including the last reloc.


More information about the Binutils mailing list