* aoutx.h (NAME(aout,final_link)): Check flavour of sub, not abfd,
authorIan Lance Taylor <ian@airs.com>
Mon, 20 Jun 1994 15:51:28 +0000 (15:51 +0000)
committerIan Lance Taylor <ian@airs.com>
Mon, 20 Jun 1994 15:51:28 +0000 (15:51 +0000)
when computing reloc sizes.  From Eric Youngdale
<ericy@cais.cais.com>.
* elfcode.h (elf_bfd_final_link): Don't try to compute maximum
reloc count or size for a non-ELF file.

bfd/ChangeLog
bfd/aoutx.h
bfd/elfcode.h

index 14d7bb17e7021131a6609e9e792416dd6c110581..c114c432976993cc84ad4107b632803758e92780 100644 (file)
@@ -1,5 +1,11 @@
 Mon Jun 20 11:06:27 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
 
+       * aoutx.h (NAME(aout,final_link)): Check flavour of sub, not abfd,
+       when computing reloc sizes.  From Eric Youngdale
+       <ericy@cais.cais.com>.
+       * elfcode.h (elf_bfd_final_link): Don't try to compute maximum
+       reloc count or size for a non-ELF file.
+
        * mipsbsd.c (MY_final_link_callback): Define to avoid warning.
 
        * hp300hpux.c (MY_final_link_callback): Define to avoid warning.
index 0e5a4d81f6c9181248ab000d356fdb41e5fd0da0..da0fa748f9bd515450412859ceb95ec838894d62 100644 (file)
@@ -3291,7 +3291,7 @@ NAME(aout,final_link) (abfd, info, callback)
       drsize = 0;
       for (sub = info->input_bfds; sub != (bfd *) NULL; sub = sub->link_next)
        {
-         if (bfd_get_flavour (abfd) == bfd_target_aout_flavour)
+         if (bfd_get_flavour (sub) == bfd_target_aout_flavour)
            {
              trsize += exec_hdr (sub)->a_trsize;
              drsize += exec_hdr (sub)->a_drsize;
index 26b666e0d2aa3fc4d0909b0ee652d0eafc65f856..54d4bbd405306c209e40d5feb7ce489548f65e51 100644 (file)
@@ -5115,17 +5115,17 @@ elf_bfd_final_link (abfd, info)
 
                  if (sym_count > max_sym_count)
                    max_sym_count = sym_count;
-               }
 
-             if ((sec->flags & SEC_RELOC) != 0)
-               {
-                 size_t ext_size;
+                 if ((sec->flags & SEC_RELOC) != 0)
+                   {
+                     size_t ext_size;
 
-                 ext_size = elf_section_data (sec)->rel_hdr.sh_size;
-                 if (ext_size > max_external_reloc_size)
-                   max_external_reloc_size = ext_size;
-                 if (sec->reloc_count > max_internal_reloc_count)
-                   max_internal_reloc_count = sec->reloc_count;
+                     ext_size = elf_section_data (sec)->rel_hdr.sh_size;
+                     if (ext_size > max_external_reloc_size)
+                       max_external_reloc_size = ext_size;
+                     if (sec->reloc_count > max_internal_reloc_count)
+                       max_internal_reloc_count = sec->reloc_count;
+                   }
                }
            }
        }