Remove SEC_LINKER_MARK, and add a linker_mark bitfield to the asection
authorIan Lance Taylor <ian@airs.com>
Wed, 27 Mar 1996 22:23:18 +0000 (22:23 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 27 Mar 1996 22:23:18 +0000 (22:23 +0000)
structure instead.

bfd/ChangeLog
bfd/aoutx.h
bfd/bfd-in2.h
bfd/coff-ppc.c
bfd/cofflink.c
bfd/elflink.h
bfd/section.c
bfd/xcofflink.c

index 91a23bf..9d63a46 100644 (file)
@@ -10,6 +10,9 @@ Wed Mar 27 10:43:34 1996  Ian Lance Taylor  <ian@cygnus.com>
        (coff_ppc_relocate_section): Remove unused variables.  Make
        fprintf strings and argument types correspond.  Put before_addr in
        DEBUG_RELOC ifdef.
+       (dump_toc): Make fprintf strings and argument types correspond.
+       (ppc_process_before_allocation): Remove unused variables.  Always
+       return a value.
        (ppc_reflo_reloc): Ifdef out.
        (ppc_addr32nb_reloc): Ifdef out.
        (ppc_coff_rtype2howto): Make fprintf strings and argument types
@@ -19,13 +22,12 @@ Wed Mar 27 10:43:34 1996  Ian Lance Taylor  <ian@cygnus.com>
 
        * peicode.h (pe_print_idata): Move otherwise unused variables into
        the #ifdef where they are used.  Always return a value.
-       (pe_print_edata): Change fprintf strings and add cast to make
-       fprintf strings correspond to actual types.  Always return a
-       value.
+       (pe_print_edata): Make fprintf strings and argument types
+       correspond.  Always return a value.
        (pe_print_pdata): Removed unused variable addr_value.  Always
        return a value.
        (pe_print_reloc): Remove unused variable onaline.  Make fprintf
-       strings and arguments correspond.  Always return a value.
+       strings and argument types correspond.  Always return a value.
 
        * elf32-ppc.c (ppc_elf_fake_sections): Return true.
        (ppc_elf_finish_dynamic_symbol): Move definition of unused
@@ -43,7 +45,9 @@ Wed Mar 27 10:43:34 1996  Ian Lance Taylor  <ian@cygnus.com>
        * Makefile.in: Rebuild dependencies.
        (HFILES): Add ns32k.h.
 
-       * section.c (SEC_LINKER_MARK): Define.
+       * section.c (struct sec): Add linker_mark field.  Change
+       user_set_vma and reloc_done to be single bit fields.
+       (STD_SECTION): Update accordingly.
        * bfd-in2.h: Rebuild.
        * aoutx.h (NAME(aout,final_link)): Mark sections included in the
        link.
index 07f95ac..2b8407b 100644 (file)
@@ -3690,7 +3690,7 @@ NAME(aout,final_link) (abfd, info, callback)
       for (p = o->link_order_head; p != NULL; p = p->next)
        {
          if (p->type == bfd_indirect_link_order)
-           p->u.indirect.section->flags |= SEC_LINKER_MARK;
+           p->u.indirect.section->linker_mark = true;
        }
     }
 
@@ -3849,10 +3849,10 @@ aout_link_input_bfd (finfo, input_bfd)
     return false;
 
   /* Relocate and write out the sections.  These functions use the
-     symbol map created by aout_link_write_symbols.  SEC_LINKER_MARK
-     will be set if these sections are to be included in the link,
-     which will normally be the case.  */
-  if ((obj_textsec (input_bfd)->flags & SEC_LINKER_MARK) != 0)
+     symbol map created by aout_link_write_symbols.  The linker_mark
+     field will be set if these sections are to be included in the
+     link, which will normally be the case.  */
+  if (obj_textsec (input_bfd)->linker_mark)
     {
       if (! aout_link_input_section (finfo, input_bfd,
                                     obj_textsec (input_bfd),
@@ -3860,7 +3860,7 @@ aout_link_input_bfd (finfo, input_bfd)
                                     exec_hdr (input_bfd)->a_trsize))
        return false;
     }
-  if ((obj_datasec (input_bfd)->flags & SEC_LINKER_MARK) != 0)
+  if (obj_datasec (input_bfd)->linker_mark)
     {
       if (! aout_link_input_section (finfo, input_bfd,
                                     obj_datasec (input_bfd),
index 11cc952..148ee13 100644 (file)
@@ -891,12 +891,21 @@ typedef struct sec
           table.  */
 #define SEC_SORT_ENTRIES 0x80000
 
-        /* A mark flag used by some of the linker backends.  This
-          should not be set by application code.  */
-#define SEC_LINKER_MARK 0x100000
-
         /*  End of section flags.  */
 
+        /* Some internal packed boolean fields.  */
+
+        /* See the vma field.  */
+       unsigned int user_set_vma : 1;
+
+        /* Whether relocations have been processed.  */
+       unsigned int reloc_done : 1;
+
+        /* A mark flag used by some of the linker backends.  */
+       unsigned int linker_mark : 1;
+
+        /* End of internal packed boolean fields.  */
+
         /*  The virtual memory address of the section - where it will be
            at run time.  The symbols are relocated against this.  The
            user_set_vma flag is maintained by bfd; if it's not set, the
@@ -905,7 +914,6 @@ typedef struct sec
            target and various flags).  */
 
    bfd_vma vma;
-   boolean user_set_vma;
 
         /*  The load address of the section - where it would be in a
            rom image; really only used for writing section header
@@ -1006,7 +1014,6 @@ typedef struct sec
 
    bfd *owner;
 
-   boolean reloc_done;
          /* A symbol which points at this section only */
    struct symbol_cache_entry *symbol;
    struct symbol_cache_entry **symbol_ptr_ptr;
index a991fe6..99c3d28 100644 (file)
@@ -2762,7 +2762,7 @@ ppc_bfd_coff_final_link (abfd, info)
                 link.  This will normally be every section.  We need
                 to do this so that we can identify any sections which
                 the linker has decided to not include.  */
-             sec->flags |= SEC_LINKER_MARK;
+             sec->linker_mark = true;
 
              if (info->strip == strip_none
                  || info->strip == strip_some)
index 123685b..4cc3d50 100644 (file)
@@ -495,7 +495,7 @@ _bfd_coff_final_link (abfd, info)
                 link.  This will normally be every section.  We need
                 to do this so that we can identify any sections which
                 the linker has decided to not include.  */
-             sec->flags |= SEC_LINKER_MARK;
+             sec->linker_mark = true;
 
              if (info->strip == strip_none
                  || info->strip == strip_some)
@@ -1750,7 +1750,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
     {
       bfd_byte *contents;
 
-      if ((o->flags & SEC_LINKER_MARK) == 0)
+      if (! o->linker_mark)
        {
          /* This section was omitted from the link.  */
          continue;
index d613d9d..a27f930 100644 (file)
@@ -1802,7 +1802,7 @@ elf_bfd_final_link (abfd, info)
                 link.  This will normally be every section.  We need
                 to do this so that we can identify any sections which
                 the linker has decided to not include.  */
-             sec->flags |= SEC_LINKER_MARK;
+             sec->linker_mark = true;
 
              if (info->relocateable)
                o->reloc_count += sec->reloc_count;
@@ -2811,7 +2811,7 @@ elf_link_input_bfd (finfo, input_bfd)
   /* Relocate the contents of each section.  */
   for (o = input_bfd->sections; o != NULL; o = o->next)
     {
-      if ((o->flags & SEC_LINKER_MARK) == 0)
+      if (! o->linker_mark)
        {
          /* This section was omitted from the link.  */
          continue;
index 840606d..469b026 100644 (file)
@@ -269,12 +269,21 @@ CODE_FRAGMENT
 .         table.  *}
 .#define SEC_SORT_ENTRIES 0x80000
 .
-.      {* A mark flag used by some of the linker backends.  This
-.         should not be set by application code.  *}
-.#define SEC_LINKER_MARK 0x100000
-.
 .      {*  End of section flags.  *}
 .
+.      {* Some internal packed boolean fields.  *}
+.
+.      {* See the vma field.  *}
+.      unsigned int user_set_vma : 1;
+.
+.      {* Whether relocations have been processed.  *}
+.      unsigned int reloc_done : 1;
+.
+.      {* A mark flag used by some of the linker backends.  *}
+.      unsigned int linker_mark : 1;
+.
+.      {* End of internal packed boolean fields.  *}
+.
 .       {*  The virtual memory address of the section - where it will be
 .           at run time.  The symbols are relocated against this.  The
 .          user_set_vma flag is maintained by bfd; if it's not set, the
@@ -283,7 +292,6 @@ CODE_FRAGMENT
 .          target and various flags).  *}
 .
 .   bfd_vma vma;
-.   boolean user_set_vma;
 .
 .       {*  The load address of the section - where it would be in a
 .           rom image; really only used for writing section header
@@ -384,7 +392,6 @@ CODE_FRAGMENT
 .
 .   bfd *owner;
 .
-.   boolean reloc_done;
 .       {* A symbol which points at this section only *}
 .   struct symbol_cache_entry *symbol;
 .   struct symbol_cache_entry **symbol_ptr_ptr;
@@ -443,9 +450,9 @@ static const asymbol global_syms[] =
 #define STD_SECTION(SEC, FLAGS, SYM, NAME, IDX)        \
   const asymbol * const SYM = (asymbol *) &global_syms[IDX]; \
   const asection SEC = \
-    { NAME, 0, 0, FLAGS, 0, false, 0, 0, 0, 0, (asection *) &SEC, \
-      0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0, (boolean) 0, \
-      (asymbol *) &global_syms[IDX], (asymbol **) &SYM, }
+    { NAME, 0, 0, FLAGS, 0, 0, 0, 0, 0, 0, 0, 0, (asection *) &SEC, \
+      0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0, \
+      (asymbol *) &global_syms[IDX], (asymbol **) &SYM, 0, 0 }
 
 STD_SECTION (bfd_com_section, SEC_IS_COMMON, bfd_com_symbol,
             BFD_COM_SECTION_NAME, 0);
index ddb9cad..681e1e2 100644 (file)
@@ -3221,7 +3221,7 @@ _bfd_xcoff_bfd_final_link (abfd, info)
                 link.  This will normally be every section.  We need
                 to do this so that we can identify any sections which
                 the linker has decided to not include.  */
-             sec->flags |= SEC_LINKER_MARK;
+             sec->linker_mark = true;
 
              if (info->strip == strip_none
                  || info->strip == strip_some)
@@ -4577,7 +4577,7 @@ xcoff_link_input_bfd (finfo, input_bfd)
     {
       bfd_byte *contents;
 
-      if ((o->flags & SEC_LINKER_MARK) == 0)
+      if (! o->linker_mark)
        {
          /* This section was omitted from the link.  */
          continue;