From f85ad9d5c50571a4d242e10c1f720158a6d39970 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 4 Feb 1994 04:14:24 +0000 Subject: [PATCH] * 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). --- gas/ChangeLog | 15 +++++++++++++++ gas/ecoff.c | 28 ++++++++++++++-------------- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 322fafa7bc..ad45c85b32 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -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. diff --git a/gas/ecoff.c b/gas/ecoff.c index 27890fabd4..7a72cf7e1b 100644 --- a/gas/ecoff.c +++ b/gas/ecoff.c @@ -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; } /* Add a page to a varray object. */ @@ -3421,17 +3421,14 @@ ecoff_stab (what, string, type, other, desc) cur_file_ptr = save_file_ptr; } -/* 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)) { -- 2.34.1