This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch, microblaze, gas, bfd] PR/14736 Correct adjustment of global symbols after relax
- From: Michael Eager <eager at eagerm dot com>
- To: David Holsgrove <david dot holsgrove at xilinx dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>, John Williams <jwilliams at xilinx dot com>, Vinod Kathail <vinodk at xilinx dot com>, Tom Shui <tshui at xilinx dot com>, Vidhumouli Hunsigida <vidhum at xilinx dot com>, Nagaraju Mekala <nmekala at xilinx dot com>, "Edgar E. Iglesias" <edgar dot iglesias at gmail dot com>
- Date: Tue, 18 Dec 2012 08:03:47 -0800
- Subject: Re: [Patch, microblaze, gas, bfd] PR/14736 Correct adjustment of global symbols after relax
- References: <30395d74-d0a8-48c7-ab3d-8171cdfaedc0@DB3EHSMHS001.ehs.local>,<50B6C23C.9050306@eagerm.com> <f8c4c248-65ed-4d81-9249-808a1089afef@CH1EHSMHS001.ehs.local>
On 12/13/2012 05:26 AM, David Holsgrove wrote:
Hi Michael,
On 11/22/2012 04:05 AM, David Holsgrove wrote:
Fixup symbol sizes after linker relaxation
Correct an off-by one when comparing relaxation addresses
with symbol start.
Also addresses PR/14736 where clang gave warning;
use of unary operator that may be intended as
compound assignment (-=)
binutils/bfd/Changelog
2012-11-22 Edgar E. Iglesias <edgar.iglesias@gmail.com>
* elf32-microblaze.c (calc_size_fixup): New
(calc_fixup): Use calc_size_fixup to adjust
object size
binutils/gas/testsuite/Changelog
2012-11-22 David Holsgrove <david.holsgrove@xilinx.com>
* gas/microblaze/relax_size.exp: New file - test
object size after linker relaxation
* gas/microblaze/relax_size.s: Likewise
* gas/microblaze/relax_size.elf: Likewise
calc_size_fixup() is almost the same as calc_fixup(). Comments say they
do the same thing. Are both needed? When would the values returned be different?
Thanks again for the review, the patch has been reworked to collapse the extra functionality that
calc_size_fixup added (the ability to calculate fixup for the displacement between two points,
instead of from 0) into the original calc_fixup function.
All instances where the old calc_fixup call took place have been amended to specify a 0 size.
+ int count, count_size;
+
+ count = calc_fixup (isym->st_value, sec);
+ count_size = calc_size_fixup (isym->st_value, isym->st_size, sec);
The values returned by calc_fixup() and calc_size_fixup() are not counts, but
the total size of the fixups. Please use more descriptive names (2 places).
Resolved in attached patch.
Committed.
Please submit a revised ChangeLog if it changes when you submit a revision.
Also, make sure the ChangeLog reflects all new/changed files.
This is the revised change log:
2012-12-18 Edgar E. Iglesias <edgar.iglesias@gmail.com>
PR ld/14736
* elf32-microblaze.c (calc_fixup): Add end range.
2012-12-18 David Holsgrove <david.holsgrove@xilinx.com>
* gas/microblaze/relax_size.exp: New file - test object size after linker
relaxation
* gas/microblaze/relax_size.s: Likewise
* gas/microblaze/relax_size.elf: Likewise
* gas/microblaze/relax_size2.s: Likewise
* gas/microblaze/relax_size2.elf: Likewise
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077