summaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2013-03-15 07:51:32 +0000
committerAlan Modra <amodra@bigpond.net.au>2013-03-15 07:51:32 +0000
commit471a2b19059fbfa778b95ecf17b875a26db96cab (patch)
tree8297320a56e6227b75460a83927172da25b38401 /gold
parent4066f9c183ab290f0e8dfc65e3333e63673d3aba (diff)
downloadbinutils-redhat-471a2b19059fbfa778b95ecf17b875a26db96cab.tar.gz
* gc.h (gc_process_relocs): Don't look through function descriptors.
* icf.cc (get_section_contents): Do so here instead.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog5
-rw-r--r--gold/gc.h32
-rw-r--r--gold/icf.cc19
3 files changed, 26 insertions, 30 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 6913ace68f..6be58e9675 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-15 Alan Modra <amodra@gmail.com>
+
+ * gc.h (gc_process_relocs): Don't look through function descriptors.
+ * icf.cc (get_section_contents): Do so here instead.
+
2013-03-13 Alan Modra <amodra@gmail.com>
* powerpc.cc (is_branch_reloc): Forward declare.
diff --git a/gold/gc.h b/gold/gc.h
index 6930aced43..4224a66e17 100644
--- a/gold/gc.h
+++ b/gold/gc.h
@@ -253,21 +253,7 @@ gc_process_relocs(
{
Address symvalue = dst_off - addend;
if (is_ordinary)
- {
- Symbol_location loc;
- loc.object = dst_obj;
- loc.shndx = dst_indx;
- loc.offset = convert_types<off_t, Address>(dst_off);
- // Look through function descriptors.
- parameters->target().function_location(&loc);
- if (loc.shndx != dst_indx)
- {
- // Modify symvalue/addend to the code entry.
- symvalue = loc.offset;
- addend = 0;
- }
- (*secvec).push_back(Section_id(loc.object, loc.shndx));
- }
+ (*secvec).push_back(Section_id(dst_obj, dst_indx));
else
(*secvec).push_back(Section_id(NULL, 0));
(*symvec).push_back(NULL);
@@ -343,21 +329,7 @@ gc_process_relocs(
{
Address symvalue = dst_off - addend;
if (is_ordinary && gsym->source() == Symbol::FROM_OBJECT)
- {
- Symbol_location loc;
- loc.object = dst_obj;
- loc.shndx = dst_indx;
- loc.offset = convert_types<off_t, Address>(dst_off);
- // Look through function descriptors.
- parameters->target().function_location(&loc);
- if (loc.shndx != dst_indx)
- {
- // Modify symvalue/addend to the code entry.
- symvalue = loc.offset;
- addend = 0;
- }
- (*secvec).push_back(Section_id(loc.object, loc.shndx));
- }
+ (*secvec).push_back(Section_id(dst_obj, dst_indx));
else
(*secvec).push_back(Section_id(NULL, 0));
(*symvec).push_back(gsym);
diff --git a/gold/icf.cc b/gold/icf.cc
index 5935c5be2f..a58e34f36d 100644
--- a/gold/icf.cc
+++ b/gold/icf.cc
@@ -288,6 +288,25 @@ 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)
+ {
+ Symbol_location loc;
+ loc.object = it_v->first;
+ loc.shndx = it_v->second;
+ loc.offset = convert_types<off_t, long long>(it_a->first
+ + it_a->second);
+ // 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;
+ }
+ }
+
// ADDEND_STR stores the symbol value and addend and offset,
// each at most 16 hex digits long. it_a points to a pair
// where first is the symbol value and second is the