* section.c (struct sec): Remove kept_section.
authorAlan Modra <amodra@gmail.com>
Sat, 29 Sep 2001 12:07:01 +0000 (12:07 +0000)
committerAlan Modra <amodra@gmail.com>
Sat, 29 Sep 2001 12:07:01 +0000 (12:07 +0000)
(STD_SECTION): Remove kept_section initialisation.
(bfd_make_section_anyway): Here too.
* ecoff.c (bfd_debug_section): Remove kept_section initialisation.
* cofflink.c (_bfd_coff_link_input_bfd): Don't test kept_section.
* elflink.h (elf_link_input_bfd): Set discarded link-once section
symbols to zero, and remove all code involved with kept_section
and tracking section symbol values.
* bfd-in2.h: Regenerate.
* configure.in: Bump version number.
* configure: Regenerate.

* ldlang.c (section_already_linked): Remove assignment to kept_section.

bfd/ChangeLog
bfd/bfd-in2.h
bfd/cofflink.c
bfd/configure
bfd/configure.in
bfd/ecoff.c
bfd/elflink.h
bfd/section.c
ld/ChangeLog
ld/ldlang.c

index 3b5da8e134d136541223e4e1d361367ae6046cc6..b1782e365b245f3391ad766d8520246fbbea9ff9 100644 (file)
@@ -1,3 +1,17 @@
+2001-09-29  Alan Modra  <amodra@bigpond.net.au>
+
+       * section.c (struct sec): Remove kept_section.
+       (STD_SECTION): Remove kept_section initialisation.
+       (bfd_make_section_anyway): Here too.
+       * ecoff.c (bfd_debug_section): Remove kept_section initialisation.
+       * cofflink.c (_bfd_coff_link_input_bfd): Don't test kept_section.
+       * elflink.h (elf_link_input_bfd): Set discarded link-once section
+       symbols to zero, and remove all code involved with kept_section
+       and tracking section symbol values.
+       * bfd-in2.h: Regenerate.
+       * configure.in: Bump version number.
+       * configure: Regenerate.
+
 2001-09-29  Alan Modra  <amodra@bigpond.net.au>
 
        * elf64-ppc.c (struct ppc_dyn_relocs): New.
index 5e893f98a84017672b92de91af8d0dde07b4d304..793bb6218d4d89f932a4742a8ddf648961c81b40 100644 (file)
@@ -1319,10 +1319,6 @@ typedef struct sec
 
   struct bfd_comdat_info *comdat;
 
-  /* Points to the kept section if this section is a link-once section,
-     and is discarded.  */
-  struct sec *kept_section;
-
   /* When a section is being output, this value changes as more
      linenumbers are written out.  */
 
index 31ac75612cfbbe06732fba104771d53fda4ab1d3..594b169bb219f3728d24909cf00af4345b5c5a30 100644 (file)
@@ -1516,15 +1516,13 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
 
 #ifndef COFF_WITH_PE
       /* Skip section symbols for sections which are not going to be
-        emitted, or which belong to linkonce sections that are going
-        to be discarded.  */
+        emitted.  */
       if (!skip
          && isym.n_sclass == C_STAT
          && isym.n_type == T_NULL
           && isym.n_numaux > 0)
         {
-          if ((*secpp)->output_section == bfd_abs_section_ptr
-              || (*secpp)->kept_section)
+          if ((*secpp)->output_section == bfd_abs_section_ptr)
             skip = true;
         }
 #endif
index fef25b3395e4bf99d7573e354cf88000262ce680..d30e1d4405a5b3b6a23bfdd537a96b543158090f 100755 (executable)
@@ -1127,7 +1127,7 @@ fi
 
 PACKAGE=bfd
 
-VERSION=2.11.91
+VERSION=2.11.92
 
 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
index 46bc1edba4c4c69037bcbe15d7d7d939ff86140e..081fe083765f61972256d06b50b1eb54a6118140 100644 (file)
@@ -7,7 +7,7 @@ AC_INIT(libbfd.c)
 AC_CANONICAL_SYSTEM
 AC_ISC_POSIX
 
-AM_INIT_AUTOMAKE(bfd, 2.11.91)
+AM_INIT_AUTOMAKE(bfd, 2.11.92)
 
 dnl These must be called before AM_PROG_LIBTOOL, because it may want
 dnl to call AC_CHECK_PROG.
index 359c2547db6767a51253bf621a2387e1067de7cc..4e0e9533b90f8de027fbffa031bca556d2d5565e 100644 (file)
@@ -86,8 +86,8 @@ static asection bfd_debug_section =
      NULL,       NULL,        0,           0,       0,
   /* line_filepos, userdata, contents, lineno, lineno_count,       */
      0,            NULL,     NULL,     NULL,   0,
-  /* entsize, comdat, kept_section, moving_line_filepos,           */
-     0,       NULL,   NULL,         0,
+  /* entsize, comdat, moving_line_filepos,                         */
+     0,       NULL,   0,
   /* target_index, used_by_bfd, constructor_chain, owner,          */
      0,            NULL,        NULL,              NULL,
   /* symbol,                                                       */
index 73687fbd487b2012a62f69aad2f0495b49150bb1..39f88119e3f9a8750116fbda68fb705da8f48c9e 100644 (file)
@@ -5962,12 +5962,8 @@ elf_link_input_bfd (finfo, input_bfd)
            }
        }
 
-      name = NULL;
       if (isym->st_shndx == SHN_UNDEF)
-        {
-         isec = bfd_und_section_ptr;
-         name = isec->name;
-       }
+       isec = bfd_und_section_ptr;
       else if (isym->st_shndx > 0 && isym->st_shndx < SHN_LORESERVE)
        {
          isec = section_from_elf_index (input_bfd, isym->st_shndx);
@@ -5979,15 +5975,9 @@ elf_link_input_bfd (finfo, input_bfd)
                                          isym->st_value, (bfd_vma) 0);
        }
       else if (isym->st_shndx == SHN_ABS)
-       {
-         isec = bfd_abs_section_ptr;
-         name = isec->name;
-       }
+       isec = bfd_abs_section_ptr;
       else if (isym->st_shndx == SHN_COMMON)
-       {
-         isec = bfd_com_section_ptr;
-         name = isec->name;
-       }
+       isec = bfd_com_section_ptr;
       else
        {
          /* Who knows?  */
@@ -6002,39 +5992,18 @@ elf_link_input_bfd (finfo, input_bfd)
 
       if (ELF_ST_TYPE (isym->st_info) == STT_SECTION)
        {
-         asection *ksec;
-
-         /* Save away all section symbol values.  */
-         if (isec != NULL)
-           {
-             if (name)
-               {
-                 if (isec->symbol->value != isym->st_value)
-                   (*_bfd_error_handler)
-                     (_("%s: invalid section symbol index 0x%x (%s) ignored"),
-                      bfd_archive_filename (input_bfd), isym->st_shndx,
-                      name);
-                 continue;
-               }
-             isec->symbol->value = isym->st_value;
-           }
-
-         /* If this is a discarded link-once section symbol, update
-            it's value to that of the kept section symbol.  The
-            linker will keep the first of any matching link-once
-            sections, so we should have already seen it's section
-            symbol.  I trust no-one will have the bright idea of
-            re-ordering the bfd list...  */
+         /* If this is a discarded link-once section symbol, set its
+            value to 0.  We should really undefine it, and complain
+            if anything in the final link tries to use it, but
+            DWARF-based exception handling might have an entry in
+            .eh_frame to describe a routine in the linkonce section,
+            and it turns out to be hard to remove the .eh_frame entry
+            too.  FIXME.  */
          if (isec != NULL
              && (bfd_get_section_flags (input_bfd, isec) & SEC_LINK_ONCE) != 0
-             && (ksec = isec->kept_section) != NULL)
+             && bfd_is_abs_section (isec->output_section))
            {
-             isym->st_value = ksec->symbol->value;
-
-             /* That put the value right, but the section info is all
-                wrong.  I hope this works.  */
-             isec->output_offset = ksec->output_offset;
-             isec->output_section = ksec->output_section;
+             isym->st_value = 0;
            }
 
          /* We never output section symbols.  Instead, we use the
index 274979b51670af0551b7afaa6df37b56147f6841..f3bd381a4cca198fd4e277d2cf140ab0cd95f841 100644 (file)
@@ -485,10 +485,6 @@ CODE_FRAGMENT
 .
 .  struct bfd_comdat_info *comdat;
 .
-.  {* Points to the kept section if this section is a link-once section,
-.     and is discarded.  *}
-.  struct sec *kept_section;
-.
 .  {* When a section is being output, this value changes as more
 .     linenumbers are written out.  *}
 .
@@ -599,8 +595,8 @@ static const asymbol global_syms[] =
     /* line_filepos, userdata, contents, lineno, lineno_count,       */        \
        0,            NULL,     NULL,     NULL,   0,                    \
                                                                        \
-    /* entsize, comdat, kept_section, moving_line_filepos,           */        \
-       0,       NULL,   NULL,         0,                               \
+    /* entsize, comdat, moving_line_filepos,                         */        \
+       0,       NULL,   0,                                             \
                                                                        \
     /* target_index, used_by_bfd, constructor_chain, owner,          */        \
        0,            NULL,        NULL,              NULL,             \
@@ -807,7 +803,6 @@ bfd_make_section_anyway (abfd, name)
   newsect->line_filepos = 0;
   newsect->owner = abfd;
   newsect->comdat = NULL;
-  newsect->kept_section = NULL;
 
   /* Create a symbol whos only job is to point to this section. This is
      useful for things like relocs which are relative to the base of a
index 118670546d70e789c1ee1d8af33804a6ef462b91..de5b83dedbdbb2751daf5957662718015fcb0765 100644 (file)
@@ -1,3 +1,7 @@
+2001-09-29  Alan Modra  <amodra@bigpond.net.au>
+
+       * ldlang.c (section_already_linked): Remove assignment to kept_section.
+
 2001-09-26  Alan Modra  <amodra@bigpond.net.au>
 
        * ldmisc.c (USE_STDARG): Remove.
index db420e8e027f80ea49d39de2bfe3f01e8046eb19..1b634684ee882a62b049421118fa1f3920270fe1 100644 (file)
@@ -1013,11 +1013,8 @@ section_already_linked (abfd, sec, data)
 
          /* Set the output_section field so that lang_add_section
             does not create a lang_input_section structure for this
-            section.  Since there might be a symbol in the section
-            being discarded, we must retain a pointer to the section
-            which we are really going to use.  */
+            section.  */
          sec->output_section = bfd_abs_section_ptr;
-         sec->kept_section = l->sec;
 
          return;
        }
This page took 0.040499 seconds and 4 git commands to generate.