+
+ dst_obj = NULL;
+ dst_indx = 0;
+ bool is_ordinary = false;
+ if (gsym->source() == Symbol::FROM_OBJECT)
+ {
+ dst_obj = gsym->object();
+ dst_indx = gsym->shndx(&is_ordinary);
+ }
+ dst_off = static_cast<const Sized_symbol<size>*>(gsym)->value();
+ dst_off += addend;
+
+ // When doing safe folding, check to see if this relocation is that
+ // of a function pointer being taken.
+ if (gsym->source() == Symbol::FROM_OBJECT
+ && check_section_for_function_pointers
+ && gsym->type() != elfcpp::STT_OBJECT
+ && (!is_ordinary
+ || scan.global_reloc_may_be_function_pointer(
+ symtab, NULL, NULL, src_obj, src_indx, NULL, reloc,
+ r_type, gsym)))
+ symtab->icf()->set_section_has_function_pointers(dst_obj, dst_indx);
+
+ // If the symbol name matches '__start_XXX' then the section with
+ // the C identifier like name 'XXX' should not be garbage collected.
+ // A similar treatment to symbols with the name '__stop_XXX'.
+ if (is_prefix_of(cident_section_start_prefix, gsym->name()))
+ {
+ cident_section_name = (gsym->name()
+ + strlen(cident_section_start_prefix));
+ }
+ else if (is_prefix_of(cident_section_stop_prefix, gsym->name()))
+ {
+ cident_section_name = (gsym->name()
+ + strlen(cident_section_stop_prefix));
+ }
+ if (is_icf_tracked)
+ {
+ Address symvalue = dst_off - addend;
+ if (is_ordinary && gsym->source() == Symbol::FROM_OBJECT)
+ (*secvec).push_back(Section_id(dst_obj, dst_indx));
+ else
+ (*secvec).push_back(Section_id(NULL, 0));
+ (*symvec).push_back(gsym);
+ (*addendvec).push_back(std::make_pair(
+ static_cast<long long>(symvalue),
+ static_cast<long long>(addend)));
+ uint64_t reloc_offset =
+ convert_to_section_size_type(reloc.get_r_offset());
+ (*offsetvec).push_back(reloc_offset);
+ (*reloc_addend_size_vec).push_back(
+ get_embedded_addend_size<Classify_reloc>(sh_type, r_type,
+ src_obj));
+ }
+