]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gold/target-reloc.h
* target-reloc.h (scan_relocs): Call scan.local for relocs
[thirdparty/binutils-gdb.git] / gold / target-reloc.h
index 96f2614f0087b7a9e73c8667ac12bd2bc2d8facc..5e6dba7724861d8614806f3a93a2c22d13a79e28 100644 (file)
@@ -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
        {