* ecoff.c (ecoff_symbol_new_hook): Clear ecoff_extern_size, not
authorIan Lance Taylor <ian@airs.com>
Fri, 4 Feb 1994 04:14:24 +0000 (04:14 +0000)
committerIan Lance Taylor <ian@airs.com>
Fri, 4 Feb 1994 04:14:24 +0000 (04:14 +0000)
ecoff_undefined.
(ecoff_frob_symbol): Don't check ecoff_undefined.
(ecoff_build_symbols): Get size of an undefined symbol from
sym->ecoff_extern_size, not S_GET_VALUE (sym).

gas/ChangeLog
gas/ecoff.c

index 322fafa7bcdb5ca5e1e14b6eec9433fe12510917..ad45c85b3287f0082bd659b0e13c50ceba9dda38 100644 (file)
@@ -1,3 +1,18 @@
+Thu Feb  3 23:07:30 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
+
+       * config/obj-ecoff.h (TARGET_SYMBOL_FIELDS): Changed
+       ecoff_undefined to ecoff_extern_size.
+       * config/obj-elf.h (ELF_TARGET_SYMBOL_FIELDS): Likewise.
+       * config/tc-mips.c (s_extern): Set ecoff_extern_size to the
+       external symbol size, rathern than setting the symbol value.
+       (md_estimate_size_before_relax): Check both ecoff_extern_size and
+       symbol value to see if GP referencing can be used.
+       * ecoff.c (ecoff_symbol_new_hook): Clear ecoff_extern_size, not
+       ecoff_undefined.
+       (ecoff_frob_symbol): Don't check ecoff_undefined.
+       (ecoff_build_symbols): Get size of an undefined symbol from
+       sym->ecoff_extern_size, not S_GET_VALUE (sym).
+
 Wed Feb  2 13:55:08 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
 
        * Makefile.in:  Avoid bug in losing hpux sed.
index 27890fabd438f5008b254163d06ffc980311df41..7a72cf7e1badb54710df887cfa54224633bf5350 100644 (file)
@@ -1501,7 +1501,7 @@ ecoff_symbol_new_hook (symbolP)
     add_file ((const char *) NULL, 0);
   symbolP->ecoff_file = cur_file_ptr;
   symbolP->ecoff_symbol = NULL;
-  symbolP->ecoff_undefined = 0;
+  symbolP->ecoff_extern_size = 0;
 }
 \f
 /* Add a page to a varray object.  */
@@ -3421,17 +3421,14 @@ ecoff_stab (what, string, type, other, desc)
   cur_file_ptr = save_file_ptr;
 }
 \f
-/* Frob an ECOFF symbol.  A .extern symbol will have a value, but is
-   not common.  Small common symbols go into a special .scommon
-   section rather than bfd_com_section.  */
+/* Frob an ECOFF symbol.  Small common symbols go into a special
+   .scommon section rather than bfd_com_section.  */
 
 void
 ecoff_frob_symbol (sym)
      symbolS *sym;
 {
-  if (sym->ecoff_undefined)
-    S_SET_SEGMENT (sym, undefined_section);
-  else if (S_IS_COMMON (sym)
+  if (S_IS_COMMON (sym)
           && S_GET_VALUE (sym) > 0
           && S_GET_VALUE (sym) <= bfd_get_gp_size (stdoutput))
     {
@@ -3835,15 +3832,18 @@ ecoff_build_symbols (backend, buf, bufend, offset)
                          else
                            st = st_Static;
 
-                         if (! S_IS_DEFINED (as_sym)
-                             || as_sym->ecoff_undefined)
+                         if (! S_IS_DEFINED (as_sym))
                            {
-                             if (S_GET_VALUE (as_sym) > 0
-                                 && (S_GET_VALUE (as_sym)
-                                     <= bfd_get_gp_size (stdoutput)))
-                               sc = sc_SUndefined;
-                             else
+                             if (as_sym->ecoff_extern_size == 0
+                                 || (as_sym->ecoff_extern_size
+                                     > bfd_get_gp_size (stdoutput)))
                                sc = sc_Undefined;
+                             else
+                               {
+                                 sc = sc_SUndefined;
+                                 sym_ptr->ecoff_sym.asym.value =
+                                   as_sym->ecoff_extern_size;
+                               }
                            }
                          else if (S_IS_COMMON (as_sym))
                            {