aboutsummaryrefslogtreecommitdiff
path: root/gas/ecoff.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-01-25 00:26:33 +0000
committerIan Lance Taylor <ian@airs.com>1994-01-25 00:26:33 +0000
commitc6858c1be530dce572993992de026d1f5b3e9af9 (patch)
treea08ae3232fcd21e582381d76b8aeb25e62467c6a /gas/ecoff.c
parent425625680ac18dd85dfdcc3e65ff51f99d8e5e6e (diff)
downloadgdb-c6858c1be530dce572993992de026d1f5b3e9af9.zip
gdb-c6858c1be530dce572993992de026d1f5b3e9af9.tar.gz
gdb-c6858c1be530dce572993992de026d1f5b3e9af9.tar.bz2
* ecoff.c (ecoff_frob_symbol): New function. Put undefined
symbols of known size in the undefined section. Put small common symbols in a .scommon section. * ecoff.h (ecoff_frob_symbol): Declare. * config/obj-ecoff.h (obj_frob_symbol): Define. * config/obj-elf.c (obj_elf_write_symbol_p, obj_elf_write_symbol, obj_elf_frob_symbol): Removed unused functions. * config/obj-elf.h (obj_frob_symbol, obj_write_symbol): Removed unused macros. (obj_elf_frob_symbol, obj_elf_write_symbol): Removed declarations of unused functions. (obj_frob_symbol): Define if ECOFF_DEBUGGING.
Diffstat (limited to 'gas/ecoff.c')
-rw-r--r--gas/ecoff.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/gas/ecoff.c b/gas/ecoff.c
index 76fc0ce..fd697b4 100644
--- a/gas/ecoff.c
+++ b/gas/ecoff.c
@@ -3421,6 +3421,40 @@ 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. */
+
+void
+ecoff_frob_symbol (sym)
+ symbolS *sym;
+{
+ if (sym->ecoff_undefined)
+ S_SET_SEGMENT (sym, undefined_section);
+ else if (S_IS_COMMON (sym)
+ && S_GET_VALUE (sym) > 0
+ && S_GET_VALUE (sym) < bfd_get_gp_size (stdoutput))
+ {
+ static asection scom_section;
+ static asymbol scom_symbol;
+
+ /* We must construct a fake section similar to bfd_com_section
+ but with the name .scommon. */
+ if (scom_section.name == NULL)
+ {
+ scom_section = bfd_com_section;
+ scom_section.name = ".scommon";
+ scom_section.output_section = &scom_section;
+ scom_section.symbol = &scom_symbol;
+ scom_section.symbol_ptr_ptr = &scom_section.symbol;
+ scom_symbol = *bfd_com_section.symbol;
+ scom_symbol.name = ".scommon";
+ scom_symbol.section = &scom_section;
+ }
+ S_SET_SEGMENT (sym, &scom_section);
+ }
+}
+
/* Add bytes to the symbolic information buffer. */
static char *