This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ICF on PowerPC Bug
- From: Alan Modra <amodra at gmail dot com>
- To: Sriraman Tallam <tmsriram at google dot com>
- Cc: binutils <binutils at sourceware dot org>, Ian Lance Taylor <iant at google dot com>
- Date: Wed, 2 Apr 2014 17:24:44 +1030
- Subject: Re: ICF on PowerPC Bug
- Authentication-results: sourceware.org; auth=none
- References: <CAAs8Hmwt-YWeOGNjOoBhLEbCnRMFsyDnpHYTJtYvioYCM3_b1Q at mail dot gmail dot com>
On Tue, Apr 01, 2014 at 03:06:37PM -0700, Sriraman Tallam wrote:
> because fold2 is folded onto fold1. The only way to differentiate
> fold1 and fold2 which have the same object code is via the relocation
> type and the Info value is different. However, with powerpc this is
> rewritten here in icf.cc:
>
> // Look through function descriptors
> parameters->target().function_location(&loc);
> if (loc.shndx != it_v->second)
> {
> it_v->second = loc.shndx;
> // Modify symvalue/addend to the code entry.
> it_a->first = loc.offset;
> it_a->second = 0;
> }
>
> I am not sure how to fix it.
The following patch fixes the problem, but did you really mean to copy
all the vectors here?
Icf::Sections_reachable_info v =
(it_reloc_info_list->second).section_info;
// Stores the information of the symbol pointed to by the reloc.
Icf::Symbol_info s = (it_reloc_info_list->second).symbol_info;
// Stores the addend and the symbol value.
Icf::Addend_info a = (it_reloc_info_list->second).addend_info;
// Stores the offset of the reloc.
Icf::Offset_info o = (it_reloc_info_list->second).offset_info;
Icf::Reloc_addend_size_info reloc_addend_size_info =
(it_reloc_info_list->second).reloc_addend_size_info;
diff --git a/gold/icf.cc b/gold/icf.cc
index f30eb41..920514c 100644
--- a/gold/icf.cc
+++ b/gold/icf.cc
@@ -288,8 +288,7 @@ get_section_contents(bool first_iteration,
for (; it_v != v.end(); ++it_v, ++it_s, ++it_a, ++it_o, ++it_addend_size)
{
- if (first_iteration
- && it_v->first != NULL)
+ if (it_v->first != NULL)
{
Symbol_location loc;
loc.object = it_v->first;
--
Alan Modra
Australia Development Lab, IBM