* elflink.h (elf_bfd_final_link): When counting relocations, don't
authorIan Lance Taylor <ian@airs.com>
Fri, 3 Sep 1999 18:34:02 +0000 (18:34 +0000)
committerIan Lance Taylor <ian@airs.com>
Fri, 3 Sep 1999 18:34:02 +0000 (18:34 +0000)
count those in sections we are not including in the link.

bfd/ChangeLog
bfd/elflink.h

index f45eafc8f77bf29922a47eb1473ddbbc628581d5..412262f91aba627ce89f01e9df2066299f01229a 100644 (file)
@@ -1,3 +1,8 @@
+1999-09-03  Ian Lance Taylor  <ian@zembu.com>
+
+       * elflink.h (elf_bfd_final_link): When counting relocations, don't
+       count those in sections we are not including in the link.
+
 Thu Sep  2 17:41:20 1999  Jeffrey A Law  (law@cygnus.com)
 
        * elflink.h (elf_link_add_object_symbols): Work around bogus SH_LINK
index b7b5b23998fadaaf9062295c6883514c4a2467aa..e60beae8a7c08746ebf8e880f32f873335a18e28 100644 (file)
@@ -4053,9 +4053,18 @@ elf_bfd_final_link (abfd, info)
     for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
       for (o = sub->sections; o != NULL; o = o->next)
        {
-         asection* output_section = o->output_section;
+         asection *output_section;
 
-         if (output_section && (o->flags & SEC_RELOC) != 0)
+         if (! o->linker_mark)
+           {
+             /* This section was omitted from the link.  */
+             continue;
+           }
+
+         output_section = o->output_section;
+
+         if (output_section != NULL
+             && (o->flags & SEC_RELOC) != 0)
            {
              struct bfd_elf_section_data *esdi 
                = elf_section_data (o);