aboutsummaryrefslogtreecommitdiff
path: root/gold/icf.cc
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-03-15 07:51:32 +0000
committerAlan Modra <amodra@gmail.com>2013-03-15 07:51:32 +0000
commitad3d8a2f047cb50d8a18c01c1d0dad03e32df5d1 (patch)
tree4a7064d3f5793dd85b233b401e7168ec01e676e4 /gold/icf.cc
parent0a251e08fa4e7130f05462ecc9f60e6683cdefca (diff)
downloadfsf-binutils-gdb-ad3d8a2f047cb50d8a18c01c1d0dad03e32df5d1.zip
fsf-binutils-gdb-ad3d8a2f047cb50d8a18c01c1d0dad03e32df5d1.tar.gz
fsf-binutils-gdb-ad3d8a2f047cb50d8a18c01c1d0dad03e32df5d1.tar.bz2
* gc.h (gc_process_relocs): Don't look through function descriptors.
* icf.cc (get_section_contents): Do so here instead.
Diffstat (limited to 'gold/icf.cc')
-rw-r--r--gold/icf.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/gold/icf.cc b/gold/icf.cc
index 5935c5b..a58e34f 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