aboutsummaryrefslogtreecommitdiff
path: root/gold/target-reloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'gold/target-reloc.h')
-rw-r--r--gold/target-reloc.h41
1 files changed, 18 insertions, 23 deletions
diff --git a/gold/target-reloc.h b/gold/target-reloc.h
index 96f2614..5e6dba7 100644
--- a/gold/target-reloc.h
+++ b/gold/target-reloc.h
@@ -81,30 +81,25 @@ scan_relocs(
unsigned int shndx = lsym.get_st_shndx();
bool is_ordinary;
shndx = object->adjust_sym_shndx(r_sym, shndx, &is_ordinary);
- if (is_ordinary
- && shndx != elfcpp::SHN_UNDEF
- && !object->is_section_included(shndx)
- && !symtab->is_section_folded(object, shndx))
- {
- // RELOC is a relocation against a local symbol in a
- // section we are discarding. We can ignore this
- // relocation. It will eventually become a reloc
- // against the value zero.
- //
- // FIXME: We should issue a warning if this is an
- // allocated section; is this the best place to do it?
- //
- // FIXME: The old GNU linker would in some cases look
- // for the linkonce section which caused this section to
- // be discarded, and, if the other section was the same
- // size, change the reloc to refer to the other section.
- // That seems risky and weird to me, and I don't know of
- // any case where it is actually required.
-
- continue;
- }
+ // If RELOC is a relocation against a local symbol in a
+ // section we are discarding then we can ignore it. It will
+ // eventually become a reloc against the value zero.
+ //
+ // FIXME: We should issue a warning if this is an
+ // allocated section; is this the best place to do it?
+ //
+ // FIXME: The old GNU linker would in some cases look
+ // for the linkonce section which caused this section to
+ // be discarded, and, if the other section was the same
+ // size, change the reloc to refer to the other section.
+ // That seems risky and weird to me, and I don't know of
+ // any case where it is actually required.
+ bool is_discarded = (is_ordinary
+ && shndx != elfcpp::SHN_UNDEF
+ && !object->is_section_included(shndx)
+ && !symtab->is_section_folded(object, shndx));
scan.local(symtab, layout, target, object, data_shndx,
- output_section, reloc, r_type, lsym);
+ output_section, reloc, r_type, lsym, is_discarded);
}
else
{