* linker.c (generic_link_check_achive_element): Set SEC_ALLOC flag
authorIan Lance Taylor <ian@airs.com>
Mon, 24 Jan 1994 23:56:56 +0000 (23:56 +0000)
committerIan Lance Taylor <ian@airs.com>
Mon, 24 Jan 1994 23:56:56 +0000 (23:56 +0000)
for a created common section.
(_bfd_generic_link_add_one_symbol): Likewise.

bfd/ChangeLog
bfd/linker.c

index 63c3a9fdd07a4b871e7ab65888fd815a34739985..a8a3f276efec723c502311d30cf3811fcc3bf759 100644 (file)
@@ -9,6 +9,14 @@ Mon Jan 24 14:41:23 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
 
 Mon Jan 24 12:38:54 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
 
+       * linker.c (generic_link_check_achive_element): Set SEC_ALLOC flag
+       for a created common section.
+       (_bfd_generic_link_add_one_symbol): Likewise.
+
+       * elfcode.h (swap_out_syms): Use elf_section_from_bfd_section to
+       get the index of a common section, rather than always using
+       SHN_COMMON (MIPS has multiple common sections).
+
        * elf32-hppa.c (hppa_elf_gen_reloc_type): Typo (== for =).
 
        * bfd/aoutx.h (aout_link_input_section_std,
index e5f614d07585aa29560498fc463704363f5b8d4e..2f3ac82aad2756e709ccfa78324fddb31ab63bf4 100644 (file)
@@ -975,6 +975,7 @@ generic_link_check_archive_element (abfd, info, pneeded)
          else
            h->u.c.section = bfd_make_section_old_way (symbfd,
                                                       p->section->name);
+         h->u.c.section->flags = SEC_ALLOC;
        }
       else
        {
@@ -1287,9 +1288,15 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value,
          h->type = bfd_link_hash_common;
          h->u.c.size = value;
          if (section == &bfd_com_section)
-           h->u.c.section = bfd_make_section_old_way (abfd, "COMMON");
+           {
+             h->u.c.section = bfd_make_section_old_way (abfd, "COMMON");
+             h->u.c.section->flags = SEC_ALLOC;
+           }
          else if (section->owner != abfd)
-           h->u.c.section = bfd_make_section_old_way (abfd, section->name);
+           {
+             h->u.c.section = bfd_make_section_old_way (abfd, section->name);
+             h->u.c.section->flags = SEC_ALLOC;
+           }
          else
            h->u.c.section = section;
          break;