Automatic date update in version.in
[deliverable/binutils-gdb.git] / gas / symbols.c
index 34ec145ad0426c0deacf9b06079516a07778bd31..79cdb82ba8c09f81f2493d99da1932b1b51c1101 100644 (file)
@@ -1,5 +1,5 @@
 /* symbols.c -symbol table-
-   Copyright (C) 1987-2019 Free Software Foundation, Inc.
+   Copyright (C) 1987-2020 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -73,10 +73,6 @@ struct symbol_flags
      before.  It is cleared as soon as any direct reference to the
      symbol is present.  */
   unsigned int sy_weakrefd : 1;
-
-  /* This if set if the unit of the symbol value is "octets" instead
-     of "bytes".  */
-  unsigned int sy_octets : 1;
 };
 
 /* The information we keep for a symbol.  Note that the symbol table
@@ -850,9 +846,7 @@ symbol_temp_new_now (void)
 symbolS *
 symbol_temp_new_now_octets (void)
 {
-  symbolS * symb = symbol_temp_new (now_seg, frag_now_fix_octets (), frag_now);
-  symb->sy_flags.sy_octets = 1;
-  return symb;
+  return symbol_temp_new (now_seg, frag_now_fix_octets (), frag_now);
 }
 
 symbolS *
@@ -1223,7 +1217,13 @@ resolve_symbol_value (symbolS *symp)
       if (local_symbol_resolved_p (locsym))
        return final_val;
 
-      final_val += local_symbol_get_frag (locsym)->fr_address / OCTETS_PER_BYTE;
+      /* Symbols whose section has SEC_ELF_OCTETS set,
+        resolve to octets instead of target bytes. */
+      if (locsym->lsy_section->flags & SEC_OCTETS)
+       final_val += local_symbol_get_frag (locsym)->fr_address;
+      else
+       final_val += (local_symbol_get_frag (locsym)->fr_address
+                     / OCTETS_PER_BYTE);
 
       if (finalize_syms)
        {
@@ -1336,7 +1336,9 @@ resolve_symbol_value (symbolS *symp)
          /* Fall through.  */
 
        case O_constant:
-         if (symp->sy_flags.sy_octets)
+         /* Symbols whose section has SEC_ELF_OCTETS set,
+            resolve to octets instead of target bytes. */
+         if (symp->bsym->section->flags & SEC_OCTETS)
            final_val += symp->sy_frag->fr_address;
          else
            final_val += symp->sy_frag->fr_address / OCTETS_PER_BYTE;
@@ -2651,18 +2653,6 @@ symbol_set_value_now (symbolS *sym)
   symbol_set_frag (sym, frag_now);
 }
 
-/* Set the value of SYM to the current position in the current segment,
-   in octets.  */
-
-void
-symbol_set_value_now_octets (symbolS *sym)
-{
-  S_SET_SEGMENT (sym, now_seg);
-  S_SET_VALUE (sym, frag_now_fix_octets ());
-  symbol_set_frag (sym, frag_now);
-  sym->sy_flags.sy_octets = 1;
-}
-
 /* Set the frag of a symbol.  */
 
 void
@@ -2934,13 +2924,6 @@ symbol_set_bfdsym (symbolS *s, asymbol *bsym)
   /* else XXX - What do we do now ?  */
 }
 
-/* Return whether symbol unit is "octets" (instead of "bytes").  */
-
-int symbol_octets_p (symbolS *s)
-{
-  return s->sy_flags.sy_octets;
-}
-
 #ifdef OBJ_SYMFIELD_TYPE
 
 /* Get a pointer to the object format information for a symbol.  */
This page took 0.023846 seconds and 4 git commands to generate.